summaryrefslogtreecommitdiff
path: root/libs/raylib/cmake/AddIfFlagCompiles.cmake
diff options
context:
space:
mode:
authorLuca Sas <sas.luca.alex@gmail.com>2020-03-06 17:48:44 +0000
committerLuca Sas <sas.luca.alex@gmail.com>2020-03-06 17:48:44 +0000
commit581538a8b371c0a9003dc0f1bf081222b8c4fdd9 (patch)
treef5759a699424211d4a66e24365a596072818ab33 /libs/raylib/cmake/AddIfFlagCompiles.cmake
downloadgamejam-slgj-2024-581538a8b371c0a9003dc0f1bf081222b8c4fdd9.tar.gz
gamejam-slgj-2024-581538a8b371c0a9003dc0f1bf081222b8c4fdd9.tar.bz2
gamejam-slgj-2024-581538a8b371c0a9003dc0f1bf081222b8c4fdd9.zip
Setup the project
Diffstat (limited to 'libs/raylib/cmake/AddIfFlagCompiles.cmake')
-rw-r--r--libs/raylib/cmake/AddIfFlagCompiles.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/raylib/cmake/AddIfFlagCompiles.cmake b/libs/raylib/cmake/AddIfFlagCompiles.cmake
new file mode 100644
index 0000000..403607b
--- /dev/null
+++ b/libs/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()