From a26e2a5bca37d4cfe9d6588a6b59790c293b3e90 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 16 Aug 2023 21:58:41 -0400 Subject: [PATCH] [SCons] Fix OpenMP flags in generated CMakeLists.txt files The two values need to be combined as a single string to prevent CMake from interpreting them as a list and inserting a semicolon that results in a broken compiler command that looks like this: g++ -I/some/path;-fopenmp source_file.cpp ... --- samples/cxx/SConscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/cxx/SConscript b/samples/cxx/SConscript index 58dd807d4..d0b0de2b4 100644 --- a/samples/cxx/SConscript +++ b/samples/cxx/SConscript @@ -28,8 +28,8 @@ for subdir, name, extensions, openmp in samples: localenv['cmake_extra'] = """ find_package(OpenMP REQUIRED) -set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}) -set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") """ else: localenv['cmake_extra'] = ''