2024-06-16 11:49:59 +03:00
|
|
|
# ## Config options ###
|
2018-04-07 23:51:03 +03:00
|
|
|
include(CMakeDependentOption)
|
2018-07-23 21:42:19 +03:00
|
|
|
include(EnumOption)
|
2018-04-07 17:53:19 +03:00
|
|
|
|
2024-02-23 01:05:41 +03:00
|
|
|
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM;SDL" "Platform to build for.")
|
2018-04-12 20:31:53 +03:00
|
|
|
|
2023-11-07 10:41:15 +03:00
|
|
|
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific OpenGL Version?")
|
2018-04-12 20:31:53 +03:00
|
|
|
|
2021-01-14 01:10:02 +03:00
|
|
|
# Configuration options
|
|
|
|
option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN})
|
2021-01-25 12:47:53 +03:00
|
|
|
option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF)
|
2024-06-16 11:49:59 +03:00
|
|
|
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
|
2021-01-14 01:10:02 +03:00
|
|
|
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
|
|
|
|
option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF)
|
|
|
|
|
2018-04-07 17:53:19 +03:00
|
|
|
# Shared library is always PIC. Static library should be PIC too if linked into a shared library
|
|
|
|
option(WITH_PIC "Compile static library as position-independent code" OFF)
|
2021-01-22 02:07:22 +03:00
|
|
|
option(BUILD_SHARED_LIBS "Build raylib as a shared library" OFF)
|
2021-01-25 12:47:53 +03:00
|
|
|
cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON)
|
2018-04-12 20:31:53 +03:00
|
|
|
|
2018-07-23 21:42:19 +03:00
|
|
|
enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")
|
2024-03-04 21:59:26 +03:00
|
|
|
|
|
|
|
# GLFW build options
|
2024-10-25 10:47:35 +03:00
|
|
|
option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" OFF)
|
2024-03-04 21:59:26 +03:00
|
|
|
option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON)
|
2018-04-07 23:51:03 +03:00
|
|
|
|
2018-07-27 19:28:37 +03:00
|
|
|
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
|
|
|
|
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
|
|
|
|
|
2024-06-16 11:49:59 +03:00
|
|
|
include(ParseConfigHeader)
|
2021-12-04 21:56:02 +03:00
|
|
|
|
2024-06-16 11:49:59 +03:00
|
|
|
foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS)
|
|
|
|
string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG})
|
|
|
|
cmake_dependent_option(${CMAKE_MATCH_1} "" ${CMAKE_MATCH_2} CUSTOMIZE_BUILD ${CMAKE_MATCH_2})
|
|
|
|
endforeach()
|