From 1c0cc775732201f4c4d3ee0d6772be786b3b4aa1 Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Sun, 15 Oct 2023 21:28:29 -0300 Subject: A lot has certainly happened! --- raylib/cmake/AddIfFlagCompiles.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 raylib/cmake/AddIfFlagCompiles.cmake (limited to 'raylib/cmake/AddIfFlagCompiles.cmake') diff --git a/raylib/cmake/AddIfFlagCompiles.cmake b/raylib/cmake/AddIfFlagCompiles.cmake new file mode 100644 index 0000000..403607b --- /dev/null +++ b/raylib/cmake/AddIfFlagCompiles.cmake @@ -0,0 +1,12 @@ +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() -- cgit v1.2.3