Skip to content

Commit 842be90

Browse files
committed
update patch
Signed-off-by: wep21 <[email protected]>
1 parent ebeed23 commit 842be90

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
diff --git a/src/04_reading_and_writing/main.cpp b/src/04_reading_and_writing/main.cpp
2+
index a1776914..0d39f6ee 100644
3+
--- a/src/04_reading_and_writing/main.cpp
4+
+++ b/src/04_reading_and_writing/main.cpp
5+
@@ -4,7 +4,12 @@
6+
#include <lanelet2_io/io_handlers/Writer.h>
7+
#include <lanelet2_projection/UTM.h>
8+
9+
+#ifdef _WIN32
10+
+#include <direct.h>
11+
+#include <io.h>
12+
+#else
13+
#include <cstdio>
14+
+#endif
15+
16+
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
17+
18+
@@ -15,12 +20,23 @@ namespace {
19+
std::string exampleMapPath = std::string(PKG_DIR) + "/../lanelet2_maps/res/mapping_example.osm";
20+
21+
std::string tempfile(const std::string& name) {
22+
+#ifdef _WIN32
23+
+ char tmpDir[] = "C:\\tmp\\lanelet2_example_XXXXXX";
24+
+ if (_mktemp_s(tmpDir, sizeof(tmpDir)) != 0) {
25+
+ throw std::runtime_error("Failed to create a unique temporary directory name");
26+
+ }
27+
+ if (_mkdir(tmpDir) != 0) {
28+
+ throw std::runtime_error("Failed to create temporary directory");
29+
+ }
30+
+ return std::string(tmpDir) + '\\' + name;
31+
+#else
32+
char tmpDir[] = "/tmp/lanelet2_example_XXXXXX";
33+
auto* file = mkdtemp(tmpDir);
34+
if (file == nullptr) {
35+
throw lanelet::IOError("Failed to open a temporary file for writing");
36+
}
37+
return std::string(file) + '/' + name;
38+
+#endif
39+
}
40+
} // namespace
41+

patch/ros-humble-lanelet2-python.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 00e06d76..ea0c9dfc 100644
2+
index 00e06d76..b5c9bba9 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
55
@@ -52,6 +52,10 @@ mrt_add_library(${PROJECT_NAME}
66
SOURCES ${PROJECT_SOURCE_FILES_SRC}
77
)
88

9-
+target_compile_options(${PROJECT_NAME} PRIVATE
9+
+target_compile_options(${PROJECT_NAME} INTERFACE
1010
+ $<$<CXX_COMPILER_ID:MSVC>:/bigobj>
1111
+)
1212
+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 6eb87afe..277437ae 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -3,6 +3,10 @@ set(MRT_PKG_VERSION 4.0.0)
6+
cmake_minimum_required(VERSION 3.5.1)
7+
project(lanelet2_validation)
8+
9+
+if(WIN32 AND MSVC)
10+
+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
11+
+endif()
12+
+
13+
###################
14+
## Find packages ##
15+
###################

0 commit comments

Comments
 (0)