7
0
mirror of https://gitlab.com/raylibtemplates/rt.git synced 2026-06-13 12:35:11 -04:00
Files
RaylibTemplate-C/build-web/_deps/raylib-src/cmake/AddIfFlagCompiles.cmake
2025-11-03 02:11:38 +00:00

13 lines
393 B
CMake

include(CheckCCompilerFlag)
function(add_if_flag_compiles flag)
CHECK_C_COMPILER_FLAG("${flag}" COMPILER_HAS_THOSE_TOGGLES)
set(outcome "Failed")
if(COMPILER_HAS_THOSE_TOGGLES)
foreach(var ${ARGN})
set(${var} "${flag} ${${var}}" PARENT_SCOPE)
endforeach()
set(outcome "compiles")
endif()
message(STATUS "Testing if ${flag} can be used -- ${outcome}")
endfunction()