Fix error in recent refactor to add_check_c{xx}_compiler_flag functions

The variable needs to be set in the parents scope.
This commit is contained in:
Campbell Barton
2023-08-10 12:15:55 +10:00
parent b057c0cce1
commit 5e44b3c147

View File

@@ -946,19 +946,21 @@ function(ADD_CHECK_C_COMPILER_FLAGS _CFLAGS)
set(cache_var "${arg}")
endif()
endforeach()
set(${_CFLAGS} "${${_CFLAGS}}" PARENT_SCOPE)
endfunction()
function(ADD_CHECK_CXX_COMPILER_FLAGS _CFLAGS)
function(ADD_CHECK_CXX_COMPILER_FLAGS _CXXFLAGS)
# Iterate over pairs & check each.
set(cache_var "")
foreach(arg ${ARGN})
if(cache_var)
ADD_CHECK_CXX_COMPILER_FLAG_IMPL("${_CFLAGS}" "${cache_var}" "${arg}")
ADD_CHECK_CXX_COMPILER_FLAG_IMPL("${_CXXFLAGS}" "${cache_var}" "${arg}")
set(cache_var "")
else()
set(cache_var "${arg}")
endif()
endforeach()
set(${_CXXFLAGS} "${${_CXXFLAGS}}" PARENT_SCOPE)
endfunction()
function(get_blender_version)