platform_build_soong/cc/cmake_ext_append_flags.txt
Hao Chen 1c8ea5b6e1 Implement cc_cmake_snapshot
Bug: 302718225
Test: cd build/soong/cc && go test
Test: https://r.android.com/2803466
Change-Id: Ie7df635233ed68c40d917ea1f83f9fd4b5bfe729
2024-05-09 15:25:27 -07:00

10 lines
248 B
Text

include(CheckCXXCompilerFlag)
macro(append_cxx_flags_if_supported VAR)
foreach(FLAG ${ARGN})
check_cxx_compiler_flag(${FLAG} HAS_FLAG${FLAG})
if(${HAS_FLAG${FLAG}})
list(APPEND ${VAR} ${FLAG})
endif()
endforeach()
endmacro()