aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/behaviortree-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/behaviortree-cpp')
-rw-r--r--vcpkg/ports/behaviortree-cpp/fix-dependencies.patch28
-rw-r--r--vcpkg/ports/behaviortree-cpp/fix-x86_build.patch35
-rw-r--r--vcpkg/ports/behaviortree-cpp/portfile.cmake48
-rw-r--r--vcpkg/ports/behaviortree-cpp/remove-source-charset.diff12
-rw-r--r--vcpkg/ports/behaviortree-cpp/vcpkg.json23
5 files changed, 146 insertions, 0 deletions
diff --git a/vcpkg/ports/behaviortree-cpp/fix-dependencies.patch b/vcpkg/ports/behaviortree-cpp/fix-dependencies.patch
new file mode 100644
index 0000000..e43e7fd
--- /dev/null
+++ b/vcpkg/ports/behaviortree-cpp/fix-dependencies.patch
@@ -0,0 +1,28 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c9528bd..0fd9f26 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -231,7 +231,7 @@ target_link_libraries(${BTCPP_LIBRARY}
+ ${CMAKE_DL_LIBS}
+ $<BUILD_INTERFACE:foonathan::lexy>
+ $<BUILD_INTERFACE:minitrace::minitrace>
+- $<BUILD_INTERFACE:tinyxml2::tinyxml2>
++ tinyxml2::tinyxml2
+ $<BUILD_INTERFACE:minicoro::minicoro>
+ $<BUILD_INTERFACE:flatbuffers::flatbuffers>
+ PUBLIC
+diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in
+index eaed471..dd8a4a8 100644
+--- a/cmake/Config.cmake.in
++++ b/cmake/Config.cmake.in
+@@ -1,5 +1,10 @@
+ @PACKAGE_INIT@
+
++include(CMakeFindDependencyMacro)
++
++find_dependency(Threads)
++find_dependency(tinyxml2 CONFIG)
++
+ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
+
+ set(@PROJECT_NAME@_TARGETS "BT::@PROJECT_NAME@")
diff --git a/vcpkg/ports/behaviortree-cpp/fix-x86_build.patch b/vcpkg/ports/behaviortree-cpp/fix-x86_build.patch
new file mode 100644
index 0000000..92f1f55
--- /dev/null
+++ b/vcpkg/ports/behaviortree-cpp/fix-x86_build.patch
@@ -0,0 +1,35 @@
+diff --git a/3rdparty/lexy/include/lexy/_detail/swar.hpp b/3rdparty/lexy/include/lexy/_detail/swar.hpp
+index d7734d0..7250912 100644
+--- a/3rdparty/lexy/include/lexy/_detail/swar.hpp
++++ b/3rdparty/lexy/include/lexy/_detail/swar.hpp
+@@ -141,8 +141,13 @@ constexpr std::size_t swar_find_difference(swar_int lhs, swar_int rhs)
+ auto bit_idx = __builtin_ctzll(mask);
+ #elif defined(_MSC_VER)
+ unsigned long bit_idx;
+- if (!_BitScanForward64(&bit_idx, mask))
+- bit_idx = 64;
++ #if defined(_WIN64)
++ if (!_BitScanForward64(&bit_idx, mask))
++ bit_idx = 64;
++ #elif defined(_WIN32)
++ if (!_BitScanForward(&bit_idx, mask))
++ bit_idx = 32;
++ #endif
+ #else
+ # error "unsupported compiler; please file an issue"
+ #endif
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6d463ba..90abc0e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -173,6 +173,10 @@ else()
+ add_library(${BTCPP_LIBRARY} STATIC ${BT_SOURCE})
+ endif()
+
++if (MSVC)
++ target_compile_definitions(${BTCPP_LIBRARY} PRIVATE NOMINMAX)
++endif ()
++
+ message(STATUS "BTCPP_EXTRA_LIBRARIES: ${BTCPP_EXTRA_LIBRARIES}")
+
+ target_link_libraries(${BTCPP_LIBRARY}
diff --git a/vcpkg/ports/behaviortree-cpp/portfile.cmake b/vcpkg/ports/behaviortree-cpp/portfile.cmake
new file mode 100644
index 0000000..b4818e1
--- /dev/null
+++ b/vcpkg/ports/behaviortree-cpp/portfile.cmake
@@ -0,0 +1,48 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO BehaviorTree/BehaviorTree.CPP
+ REF ${VERSION}
+ SHA512 65bb1c11ca48b199c2c3a6818fb8896dcddf52f02683214aba73bd4db3d8c749b200f0cc75f932ac25f8c5dbf19a6ccbf5d1ad556a7d70e430c4336b3de8039b
+ HEAD_REF master
+ PATCHES
+ fix-x86_build.patch
+ remove-source-charset.diff
+ fix-dependencies.patch
+)
+
+# Set BTCPP_SHARED_LIBS based on VCPKG_LIBRARY_LINKAGE
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ set(BTCPP_SHARED_LIBS ON)
+else()
+ set(BTCPP_SHARED_LIBS OFF)
+endif()
+
+# Remove vendored lexy directory to prevent conflicts with foonathan-lexy port
+file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty/lexy")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DCMAKE_DISABLE_FIND_PACKAGE_ament_cmake=1
+ -DCMAKE_DISABLE_FIND_PACKAGE_Curses=1
+ -DBTCPP_EXAMPLES=OFF
+ -DBUILD_TESTING=OFF
+ -DBTCPP_BUILD_TOOLS=OFF
+ -DBTCPP_GROOT_INTERFACE=OFF
+ -DBTCPP_SQLITE_LOGGING=OFF
+ -DBTCPP_SHARED_LIBS=${BTCPP_SHARED_LIBS}
+ -DUSE_VENDORED_FLATBUFFERS=OFF
+ -DUSE_VENDORED_LEXY=OFF
+ -DUSE_VENDORED_MINITRACE=OFF
+ -DUSE_VENDORED_TINYXML2=OFF
+ MAYBE_UNUSED_VARIABLES
+ CMAKE_DISABLE_FIND_PACKAGE_Curses
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/behaviortree_cpp PACKAGE_NAME behaviortree_cpp)
+vcpkg_copy_pdbs()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
diff --git a/vcpkg/ports/behaviortree-cpp/remove-source-charset.diff b/vcpkg/ports/behaviortree-cpp/remove-source-charset.diff
new file mode 100644
index 0000000..b3b74c4
--- /dev/null
+++ b/vcpkg/ports/behaviortree-cpp/remove-source-charset.diff
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 90abc0e..d23ae7f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -205,7 +205,6 @@ target_compile_definitions(${BTCPP_LIBRARY} PUBLIC BTCPP_LIBRARY_VERSION="${CMAK
+ target_compile_features(${BTCPP_LIBRARY} PUBLIC cxx_std_17)
+
+ if(MSVC)
+- target_compile_options(${BTCPP_LIBRARY} PRIVATE "/source-charset:utf-8")
+ else()
+ if(ENABLE_DEBUG)
+ target_compile_options(${BTCPP_LIBRARY} PRIVATE -Wall -Wextra -g3 -ggdb3 -O0 -fno-omit-frame-pointer)
diff --git a/vcpkg/ports/behaviortree-cpp/vcpkg.json b/vcpkg/ports/behaviortree-cpp/vcpkg.json
new file mode 100644
index 0000000..c7edac6
--- /dev/null
+++ b/vcpkg/ports/behaviortree-cpp/vcpkg.json
@@ -0,0 +1,23 @@
+{
+ "name": "behaviortree-cpp",
+ "version": "4.8.2",
+ "description": "Behavior Trees Library in C++.",
+ "homepage": "https://www.behaviortree.dev",
+ "supports": "!uwp",
+ "dependencies": [
+ "boost-coroutine2",
+ "cppzmq",
+ "flatbuffers",
+ "foonathan-lexy",
+ "minitrace",
+ "tinyxml2",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}