Skip to content

Commit

Permalink
update patch
Browse files Browse the repository at this point in the history
Signed-off-by: wep21 <daisuke.nishimatsu1021@gmail.com>
  • Loading branch information
wep21 committed Jan 13, 2025
1 parent ebeed23 commit 842be90
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
41 changes: 41 additions & 0 deletions patch/ros-humble-lanelet2-examples.patch
Original file line number Diff line number Diff line change
@@ -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 <lanelet2_io/io_handlers/Writer.h>
#include <lanelet2_projection/UTM.h>

+#ifdef _WIN32
+#include <direct.h>
+#include <io.h>
+#else
#include <cstdio>
+#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

4 changes: 2 additions & 2 deletions patch/ros-humble-lanelet2-python.patch
Original file line number Diff line number Diff line change
@@ -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
+ $<$<CXX_COMPILER_ID:MSVC>:/bigobj>
+)
+
Expand Down
15 changes: 15 additions & 0 deletions patch/ros-humble-lanelet2-validation.patch
Original file line number Diff line number Diff line change
@@ -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 ##
###################

0 comments on commit 842be90

Please sign in to comment.