Skip to content

Commit 6571ace

Browse files
authored
[behaviortree-cpp] De-vendor lexy (#46998)
1 parent 2f52e03 commit 6571ace

File tree

6 files changed

+50
-5
lines changed

6 files changed

+50
-5
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in
2+
index 77a7c18..7eeaceb 100644
3+
--- a/cmake/Config.cmake.in
4+
+++ b/cmake/Config.cmake.in
5+
@@ -1,5 +1,10 @@
6+
@PACKAGE_INIT@
7+
8+
+include(CMakeFindDependencyMacro)
9+
+
10+
+find_dependency(Threads)
11+
+find_dependency(lexy CONFIG)
12+
+
13+
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
14+
15+
set(@PROJECT_NAME@_TARGETS "BT::@PROJECT_NAME@")

ports/behaviortree-cpp/portfile.cmake

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,20 @@ vcpkg_from_github(
77
PATCHES
88
fix-x86_build.patch
99
remove-source-charset.diff
10+
use-external-lexy.patch
11+
fix-dependencies.patch
1012
)
1113

14+
# Set BTCPP_SHARED_LIBS based on VCPKG_LIBRARY_LINKAGE
15+
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
16+
set(BTCPP_SHARED_LIBS ON)
17+
else()
18+
set(BTCPP_SHARED_LIBS OFF)
19+
endif()
20+
21+
# Remove vendored lexy directory to prevent conflicts with foonathan-lexy port
22+
file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty/lexy")
23+
1224
vcpkg_cmake_configure(
1325
SOURCE_PATH "${SOURCE_PATH}"
1426
OPTIONS
@@ -19,6 +31,7 @@ vcpkg_cmake_configure(
1931
-DBTCPP_BUILD_TOOLS=OFF
2032
-DBTCPP_GROOT_INTERFACE=OFF
2133
-DBTCPP_SQLITE_LOGGING=OFF
34+
-DBTCPP_SHARED_LIBS=${BTCPP_SHARED_LIBS}
2235
MAYBE_UNUSED_VARIABLES
2336
CMAKE_DISABLE_FIND_PACKAGE_Curses
2437
)
@@ -30,7 +43,3 @@ vcpkg_copy_pdbs()
3043
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
3144

3245
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
33-
34-
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
35-
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
36-
endif()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index aa19bdb..5b12345 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -96,7 +96,8 @@ endif()
6+
#############################################################
7+
# LIBRARY
8+
9+
-add_subdirectory(3rdparty/lexy)
10+
+find_package(lexy CONFIG REQUIRED)
11+
+message(STATUS "Found foonathan-lexy: ${lexy_VERSION}")
12+
13+
add_library(minitrace STATIC 3rdparty/minitrace/minitrace.cpp)
14+
target_compile_definitions(minitrace PRIVATE MTR_ENABLED=True)

ports/behaviortree-cpp/vcpkg.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
22
"name": "behaviortree-cpp",
33
"version": "4.7.0",
4+
"port-version": 1,
45
"description": "Behavior Trees Library in C++.",
56
"homepage": "https://www.behaviortree.dev",
67
"supports": "!uwp",
78
"dependencies": [
89
"boost-coroutine2",
910
"cppzmq",
11+
"foonathan-lexy",
1012
{
1113
"name": "vcpkg-cmake",
1214
"host": true

versions/b-/behaviortree-cpp.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "698d27b36d7e3b53430558a6e92d51cc8bd22d79",
5+
"version": "4.7.0",
6+
"port-version": 1
7+
},
38
{
49
"git-tree": "9e4342eb2c4df9d10a5c47b947bdb121c706a073",
510
"version": "4.7.0",

versions/baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@
642642
},
643643
"behaviortree-cpp": {
644644
"baseline": "4.7.0",
645-
"port-version": 0
645+
"port-version": 1
646646
},
647647
"benchmark": {
648648
"baseline": "1.9.4",

0 commit comments

Comments
 (0)