diff --git a/patch/ros-humble-lanelet2-examples.patch b/patch/ros-humble-lanelet2-examples.patch new file mode 100644 index 00000000..b6a5e82a --- /dev/null +++ b/patch/ros-humble-lanelet2-examples.patch @@ -0,0 +1,41 @@ +diff --git a/src/04_reading_and_writing/main.cpp b/src/04_reading_and_writing/main.cpp +index a1776914..0d39f6ee 100644 +--- a/src/04_reading_and_writing/main.cpp ++++ b/src/04_reading_and_writing/main.cpp +@@ -4,7 +4,12 @@ + #include + #include + ++#ifdef _WIN32 ++#include ++#include ++#else + #include ++#endif + + #pragma GCC diagnostic ignored "-Wunused-but-set-variable" + +@@ -15,12 +20,23 @@ namespace { + std::string exampleMapPath = std::string(PKG_DIR) + "/../lanelet2_maps/res/mapping_example.osm"; + + std::string tempfile(const std::string& name) { ++#ifdef _WIN32 ++ char tmpDir[] = "C:\\tmp\\lanelet2_example_XXXXXX"; ++ if (_mktemp_s(tmpDir, sizeof(tmpDir)) != 0) { ++ throw std::runtime_error("Failed to create a unique temporary directory name"); ++ } ++ if (_mkdir(tmpDir) != 0) { ++ throw std::runtime_error("Failed to create temporary directory"); ++ } ++ return std::string(tmpDir) + '\\' + name; ++#else + char tmpDir[] = "/tmp/lanelet2_example_XXXXXX"; + auto* file = mkdtemp(tmpDir); + if (file == nullptr) { + throw lanelet::IOError("Failed to open a temporary file for writing"); + } + return std::string(file) + '/' + name; ++#endif + } + } // namespace + diff --git a/patch/ros-humble-lanelet2-python.patch b/patch/ros-humble-lanelet2-python.patch index 9d21f922..c3a792e3 100644 --- a/patch/ros-humble-lanelet2-python.patch +++ b/patch/ros-humble-lanelet2-python.patch @@ -1,12 +1,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 00e06d76..ea0c9dfc 100644 +index 00e06d76..b5c9bba9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,10 @@ mrt_add_library(${PROJECT_NAME} SOURCES ${PROJECT_SOURCE_FILES_SRC} ) -+target_compile_options(${PROJECT_NAME} PRIVATE ++target_compile_options(${PROJECT_NAME} INTERFACE + $<$:/bigobj> +) + diff --git a/patch/ros-humble-lanelet2-validation.patch b/patch/ros-humble-lanelet2-validation.patch new file mode 100644 index 00000000..05dd0665 --- /dev/null +++ b/patch/ros-humble-lanelet2-validation.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6eb87afe..277437ae 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,6 +3,10 @@ set(MRT_PKG_VERSION 4.0.0) + cmake_minimum_required(VERSION 3.5.1) + project(lanelet2_validation) + ++if(WIN32 AND MSVC) ++ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) ++endif() ++ + ################### + ## Find packages ## + ###################