| 1 |
# Adding compile definitions |
| 2 |
target_compile_definitions("raylib" PUBLIC "${PLATFORM_CPP}") |
| 3 |
target_compile_definitions("raylib" PUBLIC "${GRAPHICS}") |
| 4 |
|
| 5 |
function(define_if target variable) |
| 6 |
if(${${variable}}) |
| 7 |
message(STATUS "${variable}=${${variable}}") |
| 8 |
target_compile_definitions(${target} PRIVATE "${variable}") |
| 9 |
endif() |
| 10 |
endfunction() |
| 11 |
|
| 12 |
if(${CUSTOMIZE_BUILD}) |
| 13 |
target_compile_definitions("raylib" PRIVATE EXTERNAL_CONFIG_FLAGS) |
| 14 |
|
| 15 |
foreach(FLAG IN LISTS CONFIG_HEADER_FLAGS) |
| 16 |
string(REGEX MATCH "([^=]+)=(.+)" _ ${FLAG}) |
| 17 |
define_if("raylib" ${CMAKE_MATCH_1}) |
| 18 |
endforeach() |
| 19 |
|
| 20 |
foreach(VALUE IN LISTS CONFIG_HEADER_VALUES) |
| 21 |
target_compile_definitions("raylib" PRIVATE ${VALUE}) |
| 22 |
endforeach() |
| 23 |
endif() |