From 581538a8b371c0a9003dc0f1bf081222b8c4fdd9 Mon Sep 17 00:00:00 2001 From: Luca Sas Date: Fri, 6 Mar 2020 17:48:44 +0000 Subject: Setup the project --- libs/raylib/cmake/AddIfFlagCompiles.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 libs/raylib/cmake/AddIfFlagCompiles.cmake (limited to 'libs/raylib/cmake/AddIfFlagCompiles.cmake') 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() -- cgit v1.2.3