1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Modules: Update JUCE module format for improved consistency

This commit is contained in:
Anthony Nicholls 2023-03-24 17:13:18 +00:00 committed by reuk
parent 05d5c94990
commit c04354e1ee
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
4 changed files with 38 additions and 41 deletions

View file

@ -155,24 +155,25 @@ function(_juce_get_metadata target key out_var)
endfunction()
# ==================================================================================================
function(_juce_should_build_module_source filename output_var)
get_filename_component(trimmed_name "${filename}" NAME_WE)
get_filename_component(trimmed_filename "${filename}" NAME_WE)
string(TOLOWER "${trimmed_filename}" trimmed_filename_lowercase)
set(system_name_regex_for_suffix
"android\;Android"
"ios\;iOS"
"linux\;Linux|.*BSD"
"mac\;Darwin"
"osx\;Darwin"
"windows\;Windows")
set(result TRUE)
set(pairs
"OSX\;Darwin"
"Windows\;Windows"
"Linux\;Linux"
"Android\;Android"
"iOS\;iOS")
foreach(pair IN LISTS pairs)
foreach(pair IN LISTS system_name_regex_for_suffix)
list(GET pair 0 suffix)
list(GET pair 1 system_name)
list(GET pair 1 regex)
if((trimmed_name MATCHES "_${suffix}$") AND NOT (CMAKE_SYSTEM_NAME STREQUAL "${system_name}"))
if((trimmed_filename_lowercase MATCHES "_${suffix}$") AND NOT (CMAKE_SYSTEM_NAME MATCHES "${regex}"))
set(result FALSE)
endif()
endforeach()