Skip to content

Commit 7627b85

Browse files
committed
build: fix building with OpenMP on macOS
Something changed in the way compiler flags are passed by CMake to the compiler, which caused the OpenMP flags to be passed as a single flag and resulting in a build failure. Use CMake's `SHELL:` syntax to tell CMake to pass these as separate flags, but without reordering them or performing deduplication.
1 parent 1b5036a commit 7627b85

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ if(ENABLE_OPENMP)
136136
find_package( OpenMP REQUIRED )
137137
if(OPENMP_FOUND)
138138
add_library(slvs_openmp INTERFACE)
139-
target_compile_options(slvs_openmp INTERFACE ${OpenMP_CXX_FLAGS})
139+
target_compile_options(slvs_openmp INTERFACE "SHELL:${OpenMP_CXX_FLAGS}")
140140
target_link_libraries(slvs_openmp INTERFACE
141141
${OpenMP_CXX_LIBRARIES})
142142
target_include_directories(slvs_openmp SYSTEM INTERFACE

0 commit comments

Comments
 (0)