-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
blt_add_target_compile_flags()
does not prefix SHELL:
the way blt_add_target_link_flags()
does. This means that BLTSetupOpenMP.cmake gets multiple arguments in the ${OpenMP_CXX_FLAGS}
string, we get a single list element containing a space instead of a semicolon delimited list of arguments.
The OpenMP::OpenMP_CXX target deals with this by prefixing SHELL:
, so that seems like a reasonable approach.
For a failure case, consider that the Apple Clang compilers with libomp
from Homebrew require '-Xclang -fopenmp'. Configure the following CMake project with -DOpenMP_ROOT=/opt/homebrew/opt/libomp
.
cmake_minimum_required(VERSION 3.15)
project(testbltopenmp)
set(ENABLE_OPENMP TRUE)
include(blt/SetupBLT.cmake)
blt_print_target_properties(TARGET blt::openmp)
blt_print_target_properties(TARGET OpenMP::OpenMP_CXX)
Result:
...
Problems were encountered while collecting compiler information:
clang++: error: unknown argument: '-Xclang -fopenmp'
Metadata
Metadata
Assignees
Labels
No labels