* 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 commit1785fc06b5
. * Revert "Update CompileDefinitions.cmake" This reverts commit62f9a3a0ea
. * Revert "Update CMakeLists.txt" This reverts commit3e7912144e
. * Revert "Update LibraryConfigurations.cmake" This reverts commitbcc4310c49
.
24 lines
785 B
CMake
24 lines
785 B
CMake
# Adding compile definitions
|
|
target_compile_definitions("raylib" PUBLIC "${PLATFORM_CPP}")
|
|
target_compile_definitions("raylib" PUBLIC "${GRAPHICS}")
|
|
|
|
function(define_if target variable)
|
|
if(${${variable}})
|
|
message(STATUS "${variable}=${${variable}}")
|
|
target_compile_definitions(${target} PRIVATE "${variable}")
|
|
endif()
|
|
endfunction()
|
|
|
|
if(${CUSTOMIZE_BUILD})
|
|
target_compile_definitions("raylib" PRIVATE EXTERNAL_CONFIG_FLAGS)
|
|
define_if("raylib" USE_AUDIO)
|
|
|
|
foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS)
|
|
string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG})
|
|
define_if("raylib" ${CMAKE_MATCH_1})
|
|
endforeach()
|
|
|
|
foreach(VALUE IN LISTS CONFIG_HEADER_VALUES)
|
|
target_compile_definitions("raylib" PRIVATE ${VALUE})
|
|
endforeach()
|
|
endif()
|