您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

35 行
1.7 KiB

[build] Making `config.h` fully available to CMake users (#4044) * Create ParseConfigHeader.cmake This script parses the config.h file to automate the process of exposing the configuration flags and configuration values found in the latter. * Update CompileDefinitions.cmake Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeOptions.txt Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeLists.txt Changes required to make possible building raylib for web on Windows 10. * Update LibraryConfigurations.cmake Removes a warning that linker-only flags were being passed to the compiler, which is in accordance to https://emscripten.org/docs/tools_reference/settings_reference.html. * Update CMakeOptions.txt Removed clutter. * Update CompileDefinitions.cmake Removed clutter. * Update CompileDefinitions.cmake Some applications might check for PLATFORM_WEB instead of __EMSCRIPTEN__. * Update CompileDefinitions.cmake Reverting * Update CMakeLists.txt USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update CompileDefinitions.cmake USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update ParseConfigHeader.cmake * Revert "Update CMakeLists.txt" This reverts commit 1785fc06b5b89e65515cea3afd3e3c095f15e350. * Revert "Update CompileDefinitions.cmake" This reverts commit 62f9a3a0ea21af7bd0a1ab74d10a305fca2a5695. * Revert "Update CMakeLists.txt" This reverts commit 3e7912144edc5c69c53ed5a9515ae21d66937963. * Revert "Update LibraryConfigurations.cmake" This reverts commit bcc4310c4960c200c340671caa298983340ea386.
6 个月前
Big cmake changes (#1514) * Delete emscripten.cmake This file is not needed at this point. EMSDK provides a toolchain file that has a lot more things in it and is better supported. Project currently works fine with the documentation provided in Emscripten SDK on how to build projects. * First pass file separation. The main two files are cleaner now. Only important things can be seen. Major changes include: - raylib_static is now the alias instead of raylib - Repeating segments are removed and pulled into separate files into <root>/cmake - File is reordered to make more sense - Installs are better structured - Library is build into an output directory "raylib" instead of "src" - All public header files are now set as a public header file - Source files need to be listed (it is a bad practice to capture them using wildcards and file globs) - CMakeLists are better commented * Second pass on the example dirs. They are quite complex so I'm more hesitant to do major changes. Also it works pretty well. Noticed that I forgot one of the seperated files and added it into src/CMakeLists.txt. * Returned the header copy as it was convenient to have the public headers copied. * A better description to the variable RAYLIB_IS_MAIN Co-authored-by: Rob Loach <robloach@gmail.com> * Remove debug message Co-authored-by: Rob Loach <robloach@gmail.com> * Improvements based on review. * Simplify the install condition to not be platform specific as it was before. Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> * Remove some CMAKE variables as they don't affect the build in any way Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Co-authored-by: Rob Loach <robloach@gmail.com> Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
3 年前
[build] Making `config.h` fully available to CMake users (#4044) * Create ParseConfigHeader.cmake This script parses the config.h file to automate the process of exposing the configuration flags and configuration values found in the latter. * Update CompileDefinitions.cmake Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeOptions.txt Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeLists.txt Changes required to make possible building raylib for web on Windows 10. * Update LibraryConfigurations.cmake Removes a warning that linker-only flags were being passed to the compiler, which is in accordance to https://emscripten.org/docs/tools_reference/settings_reference.html. * Update CMakeOptions.txt Removed clutter. * Update CompileDefinitions.cmake Removed clutter. * Update CompileDefinitions.cmake Some applications might check for PLATFORM_WEB instead of __EMSCRIPTEN__. * Update CompileDefinitions.cmake Reverting * Update CMakeLists.txt USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update CompileDefinitions.cmake USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update ParseConfigHeader.cmake * Revert "Update CMakeLists.txt" This reverts commit 1785fc06b5b89e65515cea3afd3e3c095f15e350. * Revert "Update CompileDefinitions.cmake" This reverts commit 62f9a3a0ea21af7bd0a1ab74d10a305fca2a5695. * Revert "Update CMakeLists.txt" This reverts commit 3e7912144edc5c69c53ed5a9515ae21d66937963. * Revert "Update LibraryConfigurations.cmake" This reverts commit bcc4310c4960c200c340671caa298983340ea386.
6 个月前
Big cmake changes (#1514) * Delete emscripten.cmake This file is not needed at this point. EMSDK provides a toolchain file that has a lot more things in it and is better supported. Project currently works fine with the documentation provided in Emscripten SDK on how to build projects. * First pass file separation. The main two files are cleaner now. Only important things can be seen. Major changes include: - raylib_static is now the alias instead of raylib - Repeating segments are removed and pulled into separate files into <root>/cmake - File is reordered to make more sense - Installs are better structured - Library is build into an output directory "raylib" instead of "src" - All public header files are now set as a public header file - Source files need to be listed (it is a bad practice to capture them using wildcards and file globs) - CMakeLists are better commented * Second pass on the example dirs. They are quite complex so I'm more hesitant to do major changes. Also it works pretty well. Noticed that I forgot one of the seperated files and added it into src/CMakeLists.txt. * Returned the header copy as it was convenient to have the public headers copied. * A better description to the variable RAYLIB_IS_MAIN Co-authored-by: Rob Loach <robloach@gmail.com> * Remove debug message Co-authored-by: Rob Loach <robloach@gmail.com> * Improvements based on review. * Simplify the install condition to not be platform specific as it was before. Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> * Remove some CMAKE variables as they don't affect the build in any way Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Co-authored-by: Rob Loach <robloach@gmail.com> Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
3 年前
[build] Making `config.h` fully available to CMake users (#4044) * Create ParseConfigHeader.cmake This script parses the config.h file to automate the process of exposing the configuration flags and configuration values found in the latter. * Update CompileDefinitions.cmake Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeOptions.txt Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeLists.txt Changes required to make possible building raylib for web on Windows 10. * Update LibraryConfigurations.cmake Removes a warning that linker-only flags were being passed to the compiler, which is in accordance to https://emscripten.org/docs/tools_reference/settings_reference.html. * Update CMakeOptions.txt Removed clutter. * Update CompileDefinitions.cmake Removed clutter. * Update CompileDefinitions.cmake Some applications might check for PLATFORM_WEB instead of __EMSCRIPTEN__. * Update CompileDefinitions.cmake Reverting * Update CMakeLists.txt USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update CompileDefinitions.cmake USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update ParseConfigHeader.cmake * Revert "Update CMakeLists.txt" This reverts commit 1785fc06b5b89e65515cea3afd3e3c095f15e350. * Revert "Update CompileDefinitions.cmake" This reverts commit 62f9a3a0ea21af7bd0a1ab74d10a305fca2a5695. * Revert "Update CMakeLists.txt" This reverts commit 3e7912144edc5c69c53ed5a9515ae21d66937963. * Revert "Update LibraryConfigurations.cmake" This reverts commit bcc4310c4960c200c340671caa298983340ea386.
6 个月前
[build] Making `config.h` fully available to CMake users (#4044) * Create ParseConfigHeader.cmake This script parses the config.h file to automate the process of exposing the configuration flags and configuration values found in the latter. * Update CompileDefinitions.cmake Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeOptions.txt Makes use of the new functionality found in ParseConfigHeader.cmake to make things consistent. * Update CMakeLists.txt Changes required to make possible building raylib for web on Windows 10. * Update LibraryConfigurations.cmake Removes a warning that linker-only flags were being passed to the compiler, which is in accordance to https://emscripten.org/docs/tools_reference/settings_reference.html. * Update CMakeOptions.txt Removed clutter. * Update CompileDefinitions.cmake Removed clutter. * Update CompileDefinitions.cmake Some applications might check for PLATFORM_WEB instead of __EMSCRIPTEN__. * Update CompileDefinitions.cmake Reverting * Update CMakeLists.txt USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update CompileDefinitions.cmake USE_AUDIO is redundant in the presence of the already existent and more descriptive SUPPORT_MODULE_RAUDIO. * Update ParseConfigHeader.cmake * Revert "Update CMakeLists.txt" This reverts commit 1785fc06b5b89e65515cea3afd3e3c095f15e350. * Revert "Update CompileDefinitions.cmake" This reverts commit 62f9a3a0ea21af7bd0a1ab74d10a305fca2a5695. * Revert "Update CMakeLists.txt" This reverts commit 3e7912144edc5c69c53ed5a9515ae21d66937963. * Revert "Update LibraryConfigurations.cmake" This reverts commit bcc4310c4960c200c340671caa298983340ea386.
6 个月前
  1. # ## Config options ###
  2. include(CMakeDependentOption)
  3. include(EnumOption)
  4. enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM;SDL" "Platform to build for.")
  5. enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0;ES 3.0" "Force a specific OpenGL Version?")
  6. # Configuration options
  7. option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN})
  8. option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF)
  9. option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
  10. option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
  11. option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF)
  12. # Shared library is always PIC. Static library should be PIC too if linked into a shared library
  13. option(WITH_PIC "Compile static library as position-independent code" OFF)
  14. option(BUILD_SHARED_LIBS "Build raylib as a shared library" OFF)
  15. cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON)
  16. enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")
  17. # GLFW build options
  18. option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" ON)
  19. option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON)
  20. option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
  21. set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
  22. include(ParseConfigHeader)
  23. foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS)
  24. string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG})
  25. cmake_dependent_option(${CMAKE_MATCH_1} "" ${CMAKE_MATCH_2} CUSTOMIZE_BUILD ${CMAKE_MATCH_2})
  26. endforeach()