Skip to content
Snippets Groups Projects
Commit c0bbf1a5 authored by Jö Fahlke's avatar Jö Fahlke
Browse files

Don't pass the cpu flags detected by Vc to the compiler

Vc detects CPU flags based on the name of the CPU.  This can be a problem in
virtualization environment, when the name of the CPU is visible, but not all
features are enabled in the guest.

Also, enabling all detected features in the the compiler makes it difficult to
impossible for the user to force his own feature flags, e.g. to cross-build
generic executables on hosts with many features to be run later on hosts with
fewer features.

Closes: docker/ci#9
parent a028eb31
No related branches found
No related tags found
1 merge request!677Don't pass the cpu flags detected by Vc to the compiler
Pipeline #19026 passed
......@@ -17,7 +17,7 @@ function(add_dune_vc_flags _targets)
if(Vc_FOUND)
foreach(_target ${_targets})
target_link_libraries(${_target} ${Vc_LIBRARIES})
target_compile_options(${_target} PUBLIC ${Vc_ALL_FLAGS})
target_compile_options(${_target} PUBLIC ${Vc_COMPILE_FLAGS})
target_compile_definitions(${_target} PUBLIC ENABLE_VC=1)
target_include_directories(${_target} SYSTEM PUBLIC ${Vc_INCLUDE_DIR})
endforeach(_target ${_targets})
......@@ -25,7 +25,7 @@ function(add_dune_vc_flags _targets)
endfunction(add_dune_vc_flags)
if(Vc_FOUND)
dune_register_package_flags(COMPILE_OPTIONS "${Vc_ALL_FLAGS};-DENABLE_VC=1"
dune_register_package_flags(COMPILE_OPTIONS "${Vc_COMPILE_FLAGS};-DENABLE_VC=1"
LIBRARIES "${Vc_LIBRARIES}"
INCLUDE_DIRS "${Vc_INCLUDE_DIR}")
endif(Vc_FOUND)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment