2021-01-25 12:47:53 +03:00
|
|
|
# Adding compile definitions
|
|
|
|
target_compile_definitions("raylib" PUBLIC "${PLATFORM_CPP}")
|
|
|
|
target_compile_definitions("raylib" PUBLIC "${GRAPHICS}")
|
|
|
|
|
|
|
|
function(define_if target variable)
|
2024-06-16 11:49:59 +03:00
|
|
|
if(${${variable}})
|
2022-01-29 21:11:45 +03:00
|
|
|
message(STATUS "${variable}=${${variable}}")
|
2024-06-16 11:49:59 +03:00
|
|
|
target_compile_definitions(${target} PRIVATE "${variable}")
|
|
|
|
endif()
|
2021-01-25 12:47:53 +03:00
|
|
|
endfunction()
|
|
|
|
|
2024-06-16 11:49:59 +03:00
|
|
|
if(${CUSTOMIZE_BUILD})
|
|
|
|
target_compile_definitions("raylib" PRIVATE EXTERNAL_CONFIG_FLAGS)
|
2022-01-29 21:11:45 +03:00
|
|
|
|
2024-06-16 11:49:59 +03:00
|
|
|
foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS)
|
|
|
|
string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG})
|
|
|
|
define_if("raylib" ${CMAKE_MATCH_1})
|
|
|
|
endforeach()
|
2021-01-25 12:47:53 +03:00
|
|
|
|
2024-06-16 11:49:59 +03:00
|
|
|
foreach(VALUE IN LISTS CONFIG_HEADER_VALUES)
|
|
|
|
target_compile_definitions("raylib" PRIVATE ${VALUE})
|
|
|
|
endforeach()
|
|
|
|
endif()
|