diff options
Diffstat (limited to 'vcpkg/ports/fastdds')
| -rw-r--r-- | vcpkg/ports/fastdds/disable-werror.patch | 14 | ||||
| -rw-r--r-- | vcpkg/ports/fastdds/fix-deps.patch | 39 | ||||
| -rw-r--r-- | vcpkg/ports/fastdds/include-cstdint.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/fastdds/pdb-file.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/fastdds/portfile.cmake | 91 | ||||
| -rw-r--r-- | vcpkg/ports/fastdds/usage | 5 | ||||
| -rw-r--r-- | vcpkg/ports/fastdds/vcpkg.json | 24 |
7 files changed, 198 insertions, 0 deletions
diff --git a/vcpkg/ports/fastdds/disable-werror.patch b/vcpkg/ports/fastdds/disable-werror.patch new file mode 100644 index 0000000..9eb7a2d --- /dev/null +++ b/vcpkg/ports/fastdds/disable-werror.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2ea15f..ffa61d9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -191,9 +191,6 @@ if (${SANITIZER_THREAD} EQUAL -1) + message(STATUS "Setting warnings as errors...") + if(MSVC OR MSVC_IDE) + add_compile_options(/WX) +- else() +- set(CMAKE_CXX_FLAGS +- "${CMAKE_CXX_FLAGS} -Werror") + endif() + endif() + diff --git a/vcpkg/ports/fastdds/fix-deps.patch b/vcpkg/ports/fastdds/fix-deps.patch new file mode 100644 index 0000000..c346e4b --- /dev/null +++ b/vcpkg/ports/fastdds/fix-deps.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7974e8b..8afdb5a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -255,8 +255,8 @@ if(NOT BUILD_SHARED_LIBS) + endif() + + eprosima_find_package(fastcdr 2 REQUIRED) +-eprosima_find_thirdparty(Asio asio VERSION 1.13.0) +-eprosima_find_thirdparty(TinyXML2 tinyxml2) ++find_package(asio CONFIG REQUIRED) ++find_package(tinyxml2 CONFIG REQUIRED) + + find_package(foonathan_memory REQUIRED) + message(STATUS "Found foonathan_memory: ${foonathan_memory_DIR}") +@@ -268,7 +268,7 @@ if(ANDROID) + endif() + endif() + +-include_directories(thirdparty/nlohmann-json) ++find_package(nlohmann_json CONFIG REQUIRED) + include_directories(thirdparty/filewatch) + + ############################################################################### +diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt +index 3f4a3aa..3394cc3 100644 +--- a/src/cpp/CMakeLists.txt ++++ b/src/cpp/CMakeLists.txt +@@ -508,8 +508,9 @@ target_link_libraries(${PROJECT_NAME} + ${PRIVACY} + fastcdr + foonathan_memory ++ nlohmann_json::nlohmann_json + ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} +- ${TINYXML2_LIBRARY} ++ tinyxml2::tinyxml2 + $<$<BOOL:${LINK_SSL}>:OpenSSL::SSL$<SEMICOLON>OpenSSL::Crypto$<$<BOOL:${WIN32}>:$<SEMICOLON>crypt32.lib>> + $<$<BOOL:${WIN32}>:iphlpapi$<SEMICOLON>Shlwapi> + ${THIRDPARTY_BOOST_LINK_LIBS} diff --git a/vcpkg/ports/fastdds/include-cstdint.patch b/vcpkg/ports/fastdds/include-cstdint.patch new file mode 100644 index 0000000..1f34d81 --- /dev/null +++ b/vcpkg/ports/fastdds/include-cstdint.patch @@ -0,0 +1,12 @@ +diff --git a/src/cpp/rtps/security/common/SharedSecretHandle.h b/src/cpp/rtps/security/common/SharedSecretHandle.h +index c53b153..b2b6507 100644 +--- a/src/cpp/rtps/security/common/SharedSecretHandle.h ++++ b/src/cpp/rtps/security/common/SharedSecretHandle.h +@@ -21,6 +21,7 @@ + #include <rtps/security/common/Handle.h> + + #include <vector> ++#include <cstdint> + + namespace eprosima { + namespace fastdds { diff --git a/vcpkg/ports/fastdds/pdb-file.patch b/vcpkg/ports/fastdds/pdb-file.patch new file mode 100644 index 0000000..e36bfc3 --- /dev/null +++ b/vcpkg/ports/fastdds/pdb-file.patch @@ -0,0 +1,13 @@ +diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt +index e0be0a7..9eb07a6 100644 +--- a/src/cpp/CMakeLists.txt ++++ b/src/cpp/CMakeLists.txt +@@ -661,7 +661,7 @@ if(MSVC OR MSVC_IDE) + endif() + + # install symbols if any +- if(PDB_FILE) ++ if(PDB_FILE AND BUILD_SHARED_LIBS) + install(FILES ${PDB_FILE} + DESTINATION ${LIB_INSTALL_DIR}${MSVCARCH_DIR_EXTENSION} + COMPONENT symbols diff --git a/vcpkg/ports/fastdds/portfile.cmake b/vcpkg/ports/fastdds/portfile.cmake new file mode 100644 index 0000000..050a3f7 --- /dev/null +++ b/vcpkg/ports/fastdds/portfile.cmake @@ -0,0 +1,91 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO eProsima/Fast-DDS
+ REF "v${VERSION}"
+ SHA512 970b80dc87224183f730b32f21dba4cdd55cf9ac88ce662c0a0f710a2bca6233754d1274a71cca64a543407a4d5f09db3badf73201b6bb5f49ff68c81b368509
+ HEAD_REF master
+ PATCHES
+ fix-deps.patch
+ pdb-file.patch
+ disable-werror.patch
+ include-cstdint.patch
+)
+
+set(extra_opts "")
+if (VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+ # when cross-compiling, try_run will not work.
+ set(extra_opts
+ -DSM_RUN_RESULT=TRUE
+ -DSM_RUN_RESULT__TRYRUN_OUTPUT=
+ )
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DSECURITY=ON
+ -DFORCE_CXX=14 # foonathan memory debug needs C++14 constexpr
+ ${extra_opts}
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH share/fastdds/cmake)
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ # copy tools from "bin" to "tools" folder
+ foreach(TOOL "fast-discovery-server-1.0.1.exe" "fastdds.bat" "ros-discovery.bat")
+ file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${TOOL}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${TOOL}")
+ endforeach()
+
+ # remove tools from debug builds
+ foreach(TOOL "fast-discovery-serverd-1.0.1.exe" "fastdds.bat" "ros-discovery.bat")
+ if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL}")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL}")
+ endif()
+ endforeach()
+
+ # adjust paths in batch files
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/fastdds.bat" "%dir%\\..\\tools\\fastdds\\fastdds.py" "%dir%\\..\\fastdds\\fastdds.py")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/ros-discovery.bat" "%dir%\\..\\tools\\fastdds\\fastdds.py" "%dir%\\..\\fastdds\\fastdds.py")
+
+ vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+elseif(VCPKG_TARGET_IS_LINUX)
+ # copy tools from "bin" to "tools" folder
+ foreach(TOOL "fast-discovery-server-1.0.1" "fast-discovery-server" "fastdds" "ros-discovery")
+ file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${TOOL}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${TOOL}")
+ endforeach()
+
+ # replace symlink by a copy because symlinks do not work well together with vcpkg binary caching
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/fast-discovery-server")
+ file(INSTALL "${CURRENT_PACKAGES_DIR}/tools/${PORT}/fast-discovery-server-1.0.1" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}" RENAME "fast-discovery-server")
+
+ # remove tools from debug builds
+ foreach(TOOL "fast-discovery-serverd-1.0.1" "fast-discovery-server" "fastdds" "ros-discovery")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL}")
+ endforeach()
+
+ # adjust paths in batch files
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/fastdds" "$dir/../tools/fastdds/fastdds.py" "$dir/../fastdds/fastdds.py")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/ros-discovery" "$dir/../tools/fastdds/fastdds.py" "$dir/../fastdds/fastdds.py")
+endif()
+
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/fastdds/discovery/parser.py" "tool_path / '../../../bin'" "tool_path / '../../${PORT}'")
+if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/fastdds/fast-discovery-server-targets-debug.cmake" [[${_IMPORT_PREFIX}/tools/fastdds/fast-discovery-serverd-1.0.1]] [[${_IMPORT_PREFIX}/tools/fastdds/fast-discovery-server-1.0.1]])
+endif()
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/fastdds/usage b/vcpkg/ports/fastdds/usage new file mode 100644 index 0000000..46de10a --- /dev/null +++ b/vcpkg/ports/fastdds/usage @@ -0,0 +1,5 @@ +fastdds provides CMake targets:
+
+ find_package(fastdds CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE fastdds)
+
diff --git a/vcpkg/ports/fastdds/vcpkg.json b/vcpkg/ports/fastdds/vcpkg.json new file mode 100644 index 0000000..46dbd82 --- /dev/null +++ b/vcpkg/ports/fastdds/vcpkg.json @@ -0,0 +1,24 @@ +{ + "name": "fastdds", + "version": "3.3.0", + "description": "eprosima Fast DDS (formerly Fast RTPS) is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). eProsima Fast DDS implements the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium.", + "homepage": "https://www.eprosima.com/", + "license": "Apache-2.0", + "supports": "!uwp", + "dependencies": [ + "asio", + "fastcdr", + "foonathan-memory", + "nlohmann-json", + "openssl", + "tinyxml2", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |