aboutsummaryrefslogtreecommitdiffstats
path: root/raylib/cmake/AddIfFlagCompiles.cmake
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-06-13 22:15:48 +0200
committersalaaad2 <arthurdurant263@gmail.com>2022-06-13 22:15:48 +0200
commit95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3 (patch)
tree352480349a46d19ab5b8078ac4ccb79d27166f04 /raylib/cmake/AddIfFlagCompiles.cmake
parentmouse is captured again, pretty gud (diff)
downloadyabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.tar.gz
yabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.tar.bz2
yabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.tar.xz
yabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.tar.zst
yabs-95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3.zip
add raylib to the build chain with -O3 and -march=native
Diffstat (limited to 'raylib/cmake/AddIfFlagCompiles.cmake')
-rw-r--r--raylib/cmake/AddIfFlagCompiles.cmake12
1 files changed, 12 insertions, 0 deletions
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()