aboutsummaryrefslogtreecommitdiff
path: root/deps/raylib/cmake/AddIfFlagCompiles.cmake
diff options
context:
space:
mode:
authorbonmas14 <bonmas14@gmail.com>2025-09-20 22:28:15 +0300
committerbonmas14 <bonmas14@gmail.com>2025-09-20 22:28:15 +0300
commitcdda4c4182c9ee068567529715e4a5c68a8efb58 (patch)
tree38a63f62a64018a2d35fc33354f8589fd33b7514 /deps/raylib/cmake/AddIfFlagCompiles.cmake
downloadc_wizard-cdda4c4182c9ee068567529715e4a5c68a8efb58.tar.gz
c_wizard-cdda4c4182c9ee068567529715e4a5c68a8efb58.zip
Init commit v1.0
Diffstat (limited to 'deps/raylib/cmake/AddIfFlagCompiles.cmake')
-rw-r--r--deps/raylib/cmake/AddIfFlagCompiles.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/deps/raylib/cmake/AddIfFlagCompiles.cmake b/deps/raylib/cmake/AddIfFlagCompiles.cmake
new file mode 100644
index 0000000..403607b
--- /dev/null
+++ b/deps/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()