Disable AVX2 for samples

This commit is contained in:
momo5502
2025-03-22 18:02:02 +01:00
parent f42005ce5d
commit b701d44e90
2 changed files with 23 additions and 1 deletions

View File

@@ -109,12 +109,16 @@ macro(momo_target_remove_compile_option target option)
get_target_property(target_flags ${target} COMPILE_OPTIONS)
if(target_flags)
list(REMOVE_ITEM target_flags ${option})
list(REMOVE_ITEM target_flags "$<$<COMPILE_LANGUAGE:C>:${option}>")
list(REMOVE_ITEM target_flags "$<$<COMPILE_LANGUAGE:CXX>:${option}>")
set_target_properties(${target} PROPERTIES COMPILE_OPTIONS "${target_flags}")
endif()
get_target_property(target_interface_flags ${target} INTERFACE_COMPILE_OPTIONS)
if(target_interface_flags)
list(REMOVE_ITEM target_interface_flags ${option})
list(REMOVE_ITEM target_interface_flags "$<$<COMPILE_LANGUAGE:C>:${option}>")
list(REMOVE_ITEM target_interface_flags "$<$<COMPILE_LANGUAGE:CXX>:${option}>")
set_target_properties(${target} PROPERTIES INTERFACE_COMPILE_OPTIONS "${target_interface_flags}")
endif()
endmacro()
@@ -122,13 +126,21 @@ endmacro()
##########################################
macro(momo_target_remove_compile_options target)
foreach(option ${ARGV})
foreach(option ${ARGN})
momo_target_remove_compile_option(${target} ${option})
endforeach()
endmacro()
##########################################
function(momo_targets_remove_compile_options targets)
foreach(target ${targets})
momo_target_remove_compile_options(${target} ${ARGN})
endforeach()
endfunction()
##########################################
function(momo_add_compile_options language)
foreach(option ${ARGN})
add_compile_options(