[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 ...
This commit is contained in:
Ray Speth 2023-08-16 21:58:41 -04:00 committed by Ingmar Schoegl
parent 9692e4ebf7
commit a26e2a5bca

View File

@ -28,8 +28,8 @@ for subdir, name, extensions, openmp in samples:
localenv['cmake_extra'] = """ localenv['cmake_extra'] = """
find_package(OpenMP REQUIRED) find_package(OpenMP REQUIRED)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}) 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_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
""" """
else: else:
localenv['cmake_extra'] = '' localenv['cmake_extra'] = ''