aboutsummaryrefslogtreecommitdiffstats
path: root/raylib/cmake/EnumOption.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/EnumOption.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/EnumOption.cmake')
-rw-r--r--raylib/cmake/EnumOption.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/raylib/cmake/EnumOption.cmake b/raylib/cmake/EnumOption.cmake
new file mode 100644
index 0000000..d7d343f
--- /dev/null
+++ b/raylib/cmake/EnumOption.cmake
@@ -0,0 +1,9 @@
+macro(enum_option var values description)
+ set(${var}_VALUES ${values})
+ list(GET ${var}_VALUES 0 default)
+ set(${var} "${default}" CACHE STRING "${description}")
+ set_property(CACHE ${var} PROPERTY STRINGS ${${var}_VALUES})
+ if (NOT ";${${var}_VALUES};" MATCHES ";${${var}};")
+ message(FATAL_ERROR "Unknown value ${${var}}. Only -D${var}=${${var}_VALUES} allowed.")
+ endif()
+endmacro()