From 95cde5c181b5fd1d9ee3f13db749799c4e8ac9d3 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Mon, 13 Jun 2022 22:15:48 +0200 Subject: add raylib to the build chain with -O3 and -march=native --- raylib/cmake/AddIfFlagCompiles.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 raylib/cmake/AddIfFlagCompiles.cmake (limited to 'raylib/cmake/AddIfFlagCompiles.cmake') 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() -- cgit v1.2.3