summaryrefslogtreecommitdiffhomepage
path: root/cmake/AddIfFlagCompiles.cmake
diff options
context:
space:
mode:
authorAhmad Fatoum <[email protected]>2018-05-21 01:27:17 +0200
committerGitHub <[email protected]>2018-05-21 01:27:17 +0200
commitcea78e4fc16a317ef7ffd7dd537c8b47f77dca57 (patch)
tree249680970621564360684968da7396fe8d9c11cb /cmake/AddIfFlagCompiles.cmake
parenta752092055ca7c6c3d9d2b74d6ab212db14d0909 (diff)
parentbd2300fed34b458e4a419a486019afccf2ab39b1 (diff)
downloadraylib-cea78e4fc16a317ef7ffd7dd537c8b47f77dca57.tar.gz
raylib-cea78e4fc16a317ef7ffd7dd537c8b47f77dca57.zip
Travis CI: Test Android configuration (#546)
I don't know if this actually works, but it compiles, which is good enough for CI.
Diffstat (limited to 'cmake/AddIfFlagCompiles.cmake')
-rw-r--r--cmake/AddIfFlagCompiles.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/AddIfFlagCompiles.cmake b/cmake/AddIfFlagCompiles.cmake
new file mode 100644
index 00000000..403607b5
--- /dev/null
+++ b/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()