diff --git a/cmake/platforms/macos/Info.plist b/cmake/platforms/osx/Info.plist similarity index 100% rename from cmake/platforms/macos/Info.plist rename to cmake/platforms/osx/Info.plist diff --git a/cmake/yup.cmake b/cmake/yup.cmake index 7dfd69161..6da8a3fe9 100644 --- a/cmake/yup.cmake +++ b/cmake/yup.cmake @@ -27,13 +27,14 @@ include (FetchContent) #============================================================================== -function (_yup_message type message) - message (${type} "YUP -- ${message}") +function (_yup_message type) + list (JOIN ARGN "" final_message) + message (${type} "YUP -- ${final_message}") endfunction() #============================================================================== -macro (_yup_setup_platform) +function (_yup_setup_platform) if (IOS OR CMAKE_SYSTEM_NAME MATCHES "iOS" OR CMAKE_TOOLCHAIN_FILE MATCHES ".*ios\.cmake$") set (yup_platform "ios") @@ -63,1178 +64,16 @@ macro (_yup_setup_platform) _yup_message (STATUS "Setting up for ${yup_platform} platform") _yup_message (STATUS "Running on cmake ${CMAKE_VERSION}") -endmacro() - -#============================================================================== - -function (_yup_strip_list input_list output_variable) - set (inner_list "" PARENT_SCOPE) - foreach (item ${input_list}) - string (STRIP ${item} stripped_item) - if (${stripped_item} STREQUAL "") - continue() - endif() - list (APPEND inner_list ${stripped_item}) - endforeach() - set (${output_variable} "${inner_list}" PARENT_SCOPE) -endfunction() - -function (_yup_make_short_version version output_variable) - string (REPLACE "." ";" version_list ${version}) - list (LENGTH version_list version_list_length) - math (EXPR version_list_last_index "${version_list_length} - 1") - list (REMOVE_AT version_list ${version_list_last_index}) - string (JOIN "." version_short ${version_list}) - set (${output_variable} "${version_short}" PARENT_SCOPE) -endfunction() - -function (_yup_comma_or_space_separated_list input_list output_variable) - string (REPLACE "," " " temp1_list ${input_list}) - string (REPLACE " " ";" temp2_list ${temp1_list}) - _yup_strip_list ("${temp2_list}" final_list) - set (${output_variable} "${final_list}" PARENT_SCOPE) -endfunction() - -function (_yup_boolean_property input_bool output_variable) - string (STRIP "${input_bool}" ${input_bool}) - string (TOLOWER "${input_bool}" ${input_bool}) - if ("${input_bool}" STREQUAL "on" OR "${input_bool}" STREQUAL "true" OR "${input_bool}" STREQUAL "1") - set (${output_variable} ON PARENT_SCOPE) - else() - set (${output_variable} OFF PARENT_SCOPE) - endif() -endfunction() - -function (_yup_version_string_to_version_code version_string output_variable) - string (REPLACE "." ";" version_parts ${version_string}) - list (LENGTH version_parts num_parts) - set (major_version 0) - set (minor_version 0) - set (patch_version 0) - - if (${num_parts} GREATER 0) - list (GET version_parts 0 major_version) - endif() - if (${num_parts} GREATER 1) - list (GET version_parts 1 minor_version) - endif() - if (${num_parts} GREATER 2) - list (GET version_parts 2 patch_version) - endif() - - math (EXPR major_version_number "${major_version}") - math (EXPR minor_version_number "${minor_version}") - math (EXPR patch_version_number "${patch_version}") - - math (EXPR version_code "${major_version_number} * 100000 + ${minor_version_number} * 1000 + ${patch_version}") - set (${output_variable} ${version_code} PARENT_SCOPE) -endfunction() - -function (_yup_file_to_byte_array file_path output_variable) - file (READ ${file_path} hex_contents HEX) - string (REGEX MATCHALL "([A-Fa-f0-9][A-Fa-f0-9])" separated_hex ${hex_contents}) - - list (JOIN separated_hex ", 0x" formatted_hex) - string (PREPEND formatted_hex "0x") - string (APPEND formatted_hex "") - - set (${output_variable} "${formatted_hex}" PARENT_SCOPE) -endfunction() - -function (_yup_get_package_config_libs package_name output_variable) - find_package (PkgConfig REQUIRED) - pkg_check_modules (${package_name} REQUIRED IMPORTED_TARGET ${package_name}) - set (${output_variable} "PkgConfig::${package_name}" PARENT_SCOPE) -endfunction() - -function (_yup_glob_recurse folder output_variable) - file (GLOB_RECURSE all_files "${folder}") - - set (non_hidden_files "") - foreach (item ${all_files}) - get_filename_component (file_name ${item} NAME) - if (NOT ${file_name} MATCHES "^\\..*$") - list (APPEND non_hidden_files ${item}) - endif() - endforeach() - - set (${output_variable} "${non_hidden_files}" PARENT_SCOPE) -endfunction() - -function (_yup_convert_png_to_icns png_path icons_path output_variable) - set (temp_iconset_path "${icons_path}.iconset") - set (output_iconset_path "${icons_path}.icns") - - # TODO - check png has png extension - - add_custom_command( - OUTPUT "${output_iconset_path}" - COMMAND mkdir -p "${temp_iconset_name}" - COMMAND sips -z 16 16 -s format png "${png_path}" --out "${temp_iconset_path}/icon_16x16.png" - COMMAND sips -z 32 32 -s format png "${png_path}" --out "${temp_iconset_path}/icon_32x32.png" - COMMAND sips -z 32 32 -s format png "${png_path}" --out "${temp_iconset_path}/icon_16x16@2x.png" - COMMAND sips -z 64 64 -s format png "${png_path}" --out "${temp_iconset_path}/icon_32x32@2x.png" - COMMAND sips -z 128 128 -s format png "${png_path}" --out "${temp_iconset_path}/icon_128x128.png" - COMMAND sips -z 256 256 -s format png "${png_path}" --out "${temp_iconset_path}/icon_128x128@2x.png" - COMMAND sips -z 256 256 -s format png "${png_path}" --out "${temp_iconset_path}/icon_256x256.png" - COMMAND sips -z 512 512 -s format png "${png_path}" --out "${temp_iconset_path}/icon_256x256@2x.png" - COMMAND sips -z 512 512 -s format png "${png_path}" --out "${temp_iconset_path}/icon_512x512.png" - COMMAND sips -z 1024 1024 -s format png "${png_path}" --out "${temp_iconset_path}/icon_512x512@2x.png" - COMMAND iconutil -c icns "${temp_iconset_path}" - COMMAND rm -R "${temp_iconset_path}") - - set (${output_variable} "${output_iconset_path}" PARENT_SCOPE) -endfunction() - -function (_yup_fetch_glfw3) - FetchContent_Declare (glfw - GIT_REPOSITORY https://github.com/kunitoki/glfw.git - GIT_TAG dev/android_support - GIT_SHALLOW TRUE - GIT_PROGRESS TRUE) - - set (GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) - set (GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) - set (GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) - set (GLFW_BUILD_WAYLAND OFF CACHE BOOL "" FORCE) - set (GLFW_INSTALL OFF CACHE STRING "" FORCE) - - FetchContent_MakeAvailable (glfw) - - set_target_properties (glfw PROPERTIES FOLDER "Thirdparty") -endfunction() - -function (_yup_fetch_perfetto) - FetchContent_Declare (Perfetto - GIT_REPOSITORY https://android.googlesource.com/platform/external/perfetto - GIT_TAG v42.0 - GIT_SHALLOW TRUE - GIT_PROGRESS TRUE) - - FetchContent_MakeAvailable (Perfetto) - - add_library (perfetto STATIC) - target_compile_features (perfetto PUBLIC cxx_std_17) - - target_sources (perfetto - PRIVATE "$" - PUBLIC "$") - - target_include_directories (perfetto PUBLIC - "$") - - set_target_properties (perfetto PROPERTIES - POSITION_INDEPENDENT_CODE TRUE - FOLDER "Thirdparty") - - if (WIN32) - target_compile_definitions (perfetto PUBLIC NOMINMAX=1 WIN32_LEAN_AND_MEAN=1) - if (MSVC) - target_compile_options (perfetto PRIVATE /bigobj PUBLIC /Zc:__cplusplus /permissive-) - endif() - endif() - - add_library (perfetto::perfetto ALIAS perfetto) -endfunction() - -#============================================================================== - -function (_yup_module_parse_config module_header output_module_configs output_module_user_configs) - set (module_configs "") - set (module_user_configs "") - - set (begin_decl OFF) - set (end_decl OFF) - file (STRINGS ${module_header} module_header_lines) - while (module_header_lines) - list (POP_FRONT module_header_lines line) - if (line MATCHES "^.*BEGIN_JUCE_MODULE_DECLARATION.*") - set (begin_decl ON) - elseif (line MATCHES "^.*END_JUCE_MODULE_DECLARATION.*") - if (NOT begin_decl) - message (FATAL_ERROR "YUP -- Invalid module declaration") - endif() - set (begin_decl OFF) - elseif (begin_decl) - string (STRIP "${line}" stripped_line) - if ("${stripped_line}" STREQUAL "") - continue() - endif() - list (APPEND module_configs ${stripped_line}) - elseif (line MATCHES "^.*Config:.*") - string (STRIP "${line}" stripped_line) - string (REGEX REPLACE "^.*Config:(.*)$" "\\1" user_config_name ${stripped_line}) - string (STRIP "${user_config_name}" stripped_user_config_name) - if ("${stripped_user_config_name}" STREQUAL "") - continue() - endif() - list (APPEND module_user_configs ${stripped_user_config_name}) - endif() - endwhile() - - set (${output_module_configs} "${module_configs}" PARENT_SCOPE) - set (${output_module_user_configs} "${module_user_configs}" PARENT_SCOPE) -endfunction() - -#============================================================================== - -function (_yup_module_collect_sources folder output_variable) - set(source_extensions ".c;.cc;.cxx;.cpp;.h;.hh;.hxx;.hpp") - if (APPLE) - list (APPEND source_extensions ".m" ".mm") - endif() - - set (base_path "${folder}/${module_name}") - set (all_module_sources "") - - foreach (extension ${source_extensions}) - file (GLOB found_source_files "${base_path}*${extension}") - - if (NOT "${yup_platform}" MATCHES "^(win32|uwp)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_windows${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(win32)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_win32${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(uwp)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_uwp${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(ios|osx)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_apple${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(ios)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_ios${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(osx)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_osx${extension}") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_mac${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(linux)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_linux${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(ios|android)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_mobile${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(android)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_android${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(emscripten)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_emscripten${extension}") - endif() - - if (NOT "${yup_platform}" MATCHES "^(ios|osx|android|linux|emscripten)$") - list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_posix${extension}") - endif() - - foreach (source ${found_source_files}) - list (APPEND all_module_sources ${source}) - endforeach() - endforeach() - - set (module_sources "") - foreach (module_source ${all_module_sources}) - if (APPLE) - if (module_source MATCHES "^.*\.(cc|cxx|cpp)$") - get_filename_component (source_directory ${module_source} DIRECTORY) - get_filename_component (source_file ${module_source} NAME_WLE) - set (imported_module_source "${source_directory}/${source_file}.mm") - if (${imported_module_source} IN_LIST all_module_sources) - continue() - endif() - elseif (module_source MATCHES "^.*\.c$") - get_filename_component (source_directory ${module_source} DIRECTORY) - get_filename_component (source_file ${module_source} NAME_WLE) - set (imported_module_source "${source_directory}/${source_file}.m") - if (${imported_module_source} IN_LIST all_module_sources) - continue() - endif() - endif() - endif() - list (APPEND module_sources ${module_source}) - endforeach() - - set (${output_variable} "${module_sources}" PARENT_SCOPE) -endfunction() - -#============================================================================== - -function (_yup_module_prepare_frameworks frameworks weak_frameworks output_variable) - set (temp_frameworks "") - foreach (framework ${frameworks}) - list (APPEND temp_frameworks "-framework ${framework}") - endforeach() - - foreach (framework ${weak_frameworks}) - list (APPEND temp_frameworks "-weak_framework ${framework}") - endforeach() - - list (JOIN temp_frameworks " " final_frameworks) - set (${output_variable} "${final_frameworks}" PARENT_SCOPE) -endfunction() - -#============================================================================== - -function (_yup_prepare_gradle_android) - set (options "") - set (one_value_args - MIN_SDK_VERSION COMPILE_SDK_VERSION TARGET_SDK_VERSION - TARGET_NAME ABI TOOLCHAIN PLATFORM STL CPP_VERSION - APPLICATION_ID APPLICATION_NAMESPACE APPLICATION_CMAKELISTS_PATH APPLICATION_VERSION) - set (multi_value_args "") - - cmake_parse_arguments (YUP_ANDROID "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) - - # Prepare variables - if (NOT DEFINED YUP_ANDROID_MIN_SDK_VERSION) - set (YUP_ANDROID_MIN_SDK_VERSION "19") - endif() - - if (NOT DEFINED YUP_ANDROID_COMPILE_SDK_VERSION) - set (YUP_ANDROID_COMPILE_SDK_VERSION "34") - endif() - - if (NOT DEFINED YUP_ANDROID_TARGET_SDK_VERSION) - set (YUP_ANDROID_TARGET_SDK_VERSION "${YUP_ANDROID_COMPILE_SDK_VERSION}") - endif() - - if (NOT DEFINED YUP_ANDROID_TARGET_NAME) - set (YUP_ANDROID_TARGET_NAME "default_app") - endif() - - if (NOT DEFINED YUP_ANDROID_ABI) - set (YUP_ANDROID_ABI "arm64-v8a") - endif() - - set (separator "") - foreach (abi ${YUP_ANDROID_ABI}) - set (result_abi "${result_abi}${separator}abiFilters += \"${abi}\"") - set (separator "\n ") - endforeach() - set (YUP_ANDROID_ABI "${result_abi}") - - if (NOT DEFINED YUP_ANDROID_TOOLCHAIN) - set (YUP_ANDROID_TOOLCHAIN "clang") - endif() - - if (NOT DEFINED YUP_ANDROID_PLATFORM) - set (YUP_ANDROID_PLATFORM "android-${YUP_ANDROID_MIN_SDK_VERSION}") - endif() - - if (NOT DEFINED YUP_ANDROID_STL) - set (YUP_ANDROID_STL "c++_shared") - endif() - - if (NOT DEFINED YUP_ANDROID_CPP_VERSION) - set (YUP_ANDROID_CPP_VERSION "17") - endif() - - if (NOT DEFINED YUP_ANDROID_APPLICATION_ID) - set (YUP_ANDROID_APPLICATION_ID "com.yup.default_app") - endif() - - if (NOT DEFINED YUP_ANDROID_APPLICATION_NAMESPACE) - set (YUP_ANDROID_APPLICATION_NAMESPACE "${YUP_ANDROID_APPLICATION_ID}") - endif() - - if (NOT DEFINED YUP_ANDROID_APPLICATION_VERSION) - set (YUP_ANDROID_APPLICATION_VERSION "1.0") - endif() - - if (NOT DEFINED YUP_ANDROID_APPLICATION_PATH) - set (YUP_ANDROID_APPLICATION_PATH "${CMAKE_CURRENT_SOURCE_DIR}") - endif() - - set (YUP_ANDROID_CMAKE_VERSION ${CMAKE_VERSION}) - _yup_version_string_to_version_code (${YUP_ANDROID_APPLICATION_VERSION} YUP_ANDROID_APPLICATION_VERSION_CODE) - file (RELATIVE_PATH YUP_ANDROID_APPLICATION_PATH - "${CMAKE_CURRENT_BINARY_DIR}/app" "${YUP_ANDROID_APPLICATION_PATH}") - - # Prepare files - set (BASE_FILES_PATH "${CMAKE_SOURCE_DIR}/cmake/platforms/android") - configure_file (${BASE_FILES_PATH}/build.gradle.kts.in ${CMAKE_CURRENT_BINARY_DIR}/build.gradle.kts) - configure_file (${BASE_FILES_PATH}/settings.gradle.kts.in ${CMAKE_CURRENT_BINARY_DIR}/settings.gradle.kts) - configure_file (${BASE_FILES_PATH}/app/build.gradle.kts.in ${CMAKE_CURRENT_BINARY_DIR}/app/build.gradle.kts) - configure_file (${BASE_FILES_PATH}/app/proguard-rules.pro.in ${CMAKE_CURRENT_BINARY_DIR}/app/proguard-rules.pro) - configure_file (${BASE_FILES_PATH}/app/src/main/AndroidManifest.xml.in ${CMAKE_CURRENT_BINARY_DIR}/app/src/main/AndroidManifest.xml) - configure_file (${BASE_FILES_PATH}/gradle/libs.versions.toml.in ${CMAKE_CURRENT_BINARY_DIR}/gradle/libs.versions.toml COPYONLY) - configure_file (${BASE_FILES_PATH}/gradle/wrapper/gradle-wrapper.jar.in ${CMAKE_CURRENT_BINARY_DIR}/gradle/wrapper/gradle-wrapper.jar COPYONLY) - configure_file (${BASE_FILES_PATH}/gradle/wrapper/gradle-wrapper.properties.in ${CMAKE_CURRENT_BINARY_DIR}/gradle/wrapper/gradle-wrapper.properties COPYONLY) - configure_file (${BASE_FILES_PATH}/gradlew.in ${CMAKE_CURRENT_BINARY_DIR}/gradlew COPYONLY) - configure_file (${BASE_FILES_PATH}/gradlew.bat.in ${CMAKE_CURRENT_BINARY_DIR}/gradlew.bat COPYONLY) - configure_file (${BASE_FILES_PATH}/gradle.properties.in ${CMAKE_CURRENT_BINARY_DIR}/gradle.properties COPYONLY) -endfunction() - -#============================================================================== - -function (_yup_module_setup_target module_name - module_cpp_standard - module_include_paths - module_options - module_defines - module_sources - module_libs - module_frameworks - module_dependencies - module_arc_enabled) - if ("${yup_platform}" MATCHES "^(win32|uwp)$") - list (APPEND module_defines NOMINMAX=1 WIN32_LEAN_AND_MEAN=1) - endif() - - if ("${yup_platform}" MATCHES "^(android)$") - list (APPEND module_include_paths - "${ANDROID_NDK}/sources/android/cpufeatures") - list (APPEND module_sources - "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c") - endif() - - target_sources (${module_name} INTERFACE ${module_sources}) - - if (module_cpp_standard) - target_compile_features (${module_name} INTERFACE cxx_std_${module_cpp_standard}) - else() - target_compile_features (${module_name} INTERFACE cxx_std_17) - endif() - - set_target_properties (${module_name} PROPERTIES - CXX_EXTENSIONS OFF - CXX_VISIBILITY_PRESET "hidden" - VISIBILITY_INLINES_HIDDEN ON) - - if ("${yup_platform}" MATCHES "^(osx|ios)$") - set_target_properties (${module_name} PROPERTIES - XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC ${module_arc_enabled}) - endif() - - target_compile_options (${module_name} INTERFACE - ${module_options}) - - target_compile_definitions (${module_name} INTERFACE - $,DEBUG=1,NDEBUG=1> - JUCE_MODULE_AVAILABLE_${module_name}=1 - JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 - ${module_defines}) - - target_include_directories (${module_name} INTERFACE - ${module_include_paths}) - - target_link_libraries (${module_name} INTERFACE - ${module_libs} - ${module_frameworks}) - - target_link_libraries (${module_name} INTERFACE - ${module_dependencies}) - - #add_library("yup::${module_name}" ALIAS ${module_name}) - -endfunction() - -#============================================================================== - -function (_yup_module_setup_plugin_client_clap target_name plugin_client_target folder_name) - if (NOT "${yup_platform}" MATCHES "^(osx|linux|win32)$") - return() - endif() - - set (options "") - set (one_value_args PLUGIN_ID PLUGIN_NAME PLUGIN_VENDOR PLUGIN_VERSION PLUGIN_DESCRIPTION PLUGIN_URL PLUGING_IS_SYNTH PLUGIN_IS_MONO) - set (multi_value_args "") - - cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) - - set (custom_target_name "${target_name}_clap") - - add_library (${custom_target_name} INTERFACE) - set_target_properties (${custom_target_name} PROPERTIES FOLDER "${folder_name}") - - get_target_property (module_path ${plugin_client_target} YUP_MODULE_PATH) - get_target_property (module_cpp_standard ${plugin_client_target} YUP_MODULE_CPP_STANDARD) - get_target_property (module_include_paths ${plugin_client_target} YUP_MODULE_INCLUDE_PATHS) - get_target_property (module_defines ${plugin_client_target} YUP_MODULE_DEFINES) - get_target_property (module_options ${plugin_client_target} YUP_MODULE_OPTIONS) - get_target_property (module_libs ${plugin_client_target} YUP_MODULE_LIBS) - get_target_property (module_frameworks ${plugin_client_target} YUP_MODULE_FRAMEWORK) - get_target_property (module_dependencies ${plugin_client_target} YUP_MODULE_DEPENDENCIES) - get_target_property (module_arc_enabled ${plugin_client_target} YUP_MODULE_ARC_ENABLED) - - list (APPEND module_defines YUP_AUDIO_PLUGIN_ENABLE_CLAP=1) - list (APPEND module_defines YupPlugin_Id="${YUP_ARG_PLUGIN_ID}") - list (APPEND module_defines YupPlugin_Name="${YUP_ARG_PLUGIN_NAME}") - list (APPEND module_defines YupPlugin_Version="${YUP_ARG_PLUGIN_VERSION}") - list (APPEND module_defines YupPlugin_Vendor="${YUP_ARG_PLUGIN_VENDOR}") - list (APPEND module_defines YupPlugin_Description="${YUP_ARG_PLUGIN_DESCRIPTION}") - list (APPEND module_defines YupPlugin_URL="${YUP_ARG_PLUGIN_URL}") - if (YUP_ARG_PLUGIN_IS_SYNTH) - list (APPEND module_defines YupPlugin_IsSynth=1) - else() - list (APPEND module_defines YupPlugin_IsSynth=0) - endif() - if (YUP_ARG_PLUGIN_IS_MONO) - list (APPEND module_defines YupPlugin_IsMono=1) - else() - list (APPEND module_defines YupPlugin_IsMono=0) - endif() - - if ("${yup_platform}" MATCHES "^(ios|osx)$") - _yup_glob_recurse ("${module_path}/clap/*.mm" module_sources) - else() - _yup_glob_recurse ("${module_path}/clap/*.cpp" module_sources) - endif() - - _yup_module_setup_target (${custom_target_name} - "${module_cpp_standard}" - "${module_include_paths}" - "${module_options}" - "${module_defines}" - "${module_sources}" - "${module_libs}" - "${module_frameworks}" - "${module_dependencies}" - "${module_arc_enabled}") - - - _yup_glob_recurse ("${module_path}/clap/*" all_module_files_clap) - target_sources (${custom_target_name} PRIVATE ${all_module_files_clap}) - source_group (TREE ${module_path}/clap/ FILES ${all_module_files_clap}) - list (REMOVE_ITEM all_module_files_clap ${module_sources}) - set_source_files_properties (${all_module_files_clap} PROPERTIES HEADER_FILE_ONLY TRUE) - -endfunction() - -#============================================================================== - -function (yup_add_module module_path) - get_filename_component (module_path ${module_path} ABSOLUTE) - get_filename_component (module_name ${module_path} NAME) - - message (STATUS "YUP -- Processing module " ${module_name} " at " ${module_path}) - set (${module_name}_Found OFF PARENT_SCOPE) - - if (NOT EXISTS ${module_path}) - message (FATAL_ERROR "YUP -- Module location not found") - endif() - - set (module_header "${module_path}/${module_name}.h") - if (NOT EXISTS ${module_header}) - message (FATAL_ERROR "YUP -- Module header ${module_header} not found") - endif() - - # ==== Add module as library - add_library (${module_name} INTERFACE) - set_target_properties (${module_name} PROPERTIES FOLDER "Modules") - - # ==== Parse module declaration string - _yup_module_parse_config ("${module_header}" module_configs module_user_configs) - - # ==== Assign configs to variables from module declaration string - set (module_cpp_standard "") - set (module_dependencies "") - set (module_include_paths "") - set (module_options "") - set (module_defines "") - set (module_searchpaths "") - set (module_searchpaths_private "") - set (module_arc_enabled OFF) - - set (module_osx_dependencies "") - set (module_osx_frameworks "") - set (module_osx_weak_frameworks "") - set (module_osx_libs "") - set (module_osx_defines "") - - set (module_ios_dependencies "") - set (module_ios_frameworks "") - set (module_ios_weak_frameworks "") - set (module_ios_libs "") - set (module_ios_defines "") - - set (module_linux_dependencies "") - set (module_linux_libs "") - set (module_linux_packages "") - set (module_linux_defines "") - - set (module_windows_dependencies "") - set (module_windows_libs "") - set (module_windows_defines "") - set (module_windows_options "") - set (module_mingw_libs "") - - set (module_wasm_dependencies "") - set (module_wasm_libs "") - set (module_wasm_defines "") - - set (module_android_dependencies "") - set (module_android_libs "") - set (module_android_defines "") - - set (parsed_dependencies "") - foreach (module_config ${module_configs}) - string (REGEX REPLACE "^(.+):([ \t\r\n]+.*)$" "\\1" module_config_key ${module_config}) - string (REGEX REPLACE "^.+:[ \t\r\n]+(.+)$" "\\1" module_config_value ${module_config}) - - if (${module_config_key} STREQUAL "minimumCppStandard") - set (module_cpp_standard "${module_config_value}") - elseif (${module_config_key} STREQUAL "dependencies") - _yup_comma_or_space_separated_list (${module_config_value} module_dependencies) - elseif (${module_config_key} STREQUAL "defines") - _yup_comma_or_space_separated_list (${module_config_value} module_defines) - elseif (${module_config_key} STREQUAL "searchpaths") - _yup_comma_or_space_separated_list (${module_config_value} module_searchpaths) - - elseif (${module_config_key} STREQUAL "osxDeps") - _yup_comma_or_space_separated_list (${module_config_value} module_osx_dependencies) - elseif (${module_config_key} STREQUAL "osxFrameworks") - _yup_comma_or_space_separated_list (${module_config_value} module_osx_frameworks) - elseif (${module_config_key} STREQUAL "osxWeakFrameworks") - _yup_comma_or_space_separated_list (${module_config_value} module_osx_weak_frameworks) - elseif (${module_config_key} STREQUAL "osxLibs") - _yup_comma_or_space_separated_list (${module_config_value} module_osx_libs) - elseif (${module_config_key} STREQUAL "osxDefines") - _yup_comma_or_space_separated_list (${module_config_value} module_osx_defines) - - elseif (${module_config_key} STREQUAL "iosDeps") - _yup_comma_or_space_separated_list (${module_config_value} module_ios_dependencies) - elseif (${module_config_key} STREQUAL "iosFrameworks") - _yup_comma_or_space_separated_list (${module_config_value} module_ios_frameworks) - elseif (${module_config_key} STREQUAL "iosWeakFrameworks") - _yup_comma_or_space_separated_list (${module_config_value} module_ios_weak_frameworks) - elseif (${module_config_key} STREQUAL "iosLibs") - _yup_comma_or_space_separated_list (${module_config_value} module_ios_libs) - elseif (${module_config_key} STREQUAL "iosDefines") - _yup_comma_or_space_separated_list (${module_config_value} module_ios_defines) - - elseif (${module_config_key} STREQUAL "linuxDeps") - _yup_comma_or_space_separated_list (${module_config_value} module_linux_dependencies) - elseif (${module_config_key} STREQUAL "linuxLibs") - _yup_comma_or_space_separated_list (${module_config_value} module_linux_libs) - elseif (${module_config_key} STREQUAL "linuxPackages") - _yup_comma_or_space_separated_list (${module_config_value} module_linux_packages) - elseif (${module_config_key} STREQUAL "linuxDefines") - _yup_comma_or_space_separated_list (${module_config_value} module_linux_defines) - - elseif (${module_config_key} STREQUAL "windowsDeps") - _yup_comma_or_space_separated_list (${module_config_value} module_windows_dependencies) - elseif (${module_config_key} STREQUAL "windowsLibs") - _yup_comma_or_space_separated_list (${module_config_value} module_windows_libs) - elseif (${module_config_key} STREQUAL "windowsDefines") - _yup_comma_or_space_separated_list (${module_config_value} module_windows_defines) - elseif (${module_config_key} STREQUAL "windowsOptions") - _yup_comma_or_space_separated_list (${module_config_value} module_windows_options) - elseif (${module_config_key} STREQUAL "mingwLibs") - _yup_comma_or_space_separated_list (${module_config_value} module_mingw_libs) - - elseif (${module_config_key} STREQUAL "wasmDeps") - _yup_comma_or_space_separated_list (${module_config_value} module_wasm_dependencies) - elseif (${module_config_key} STREQUAL "wasmLibs") - _yup_comma_or_space_separated_list (${module_config_value} module_wasm_libs) - elseif (${module_config_key} STREQUAL "wasmDefines") - _yup_comma_or_space_separated_list (${module_config_value} module_wasm_defines) - - elseif (${module_config_key} STREQUAL "androidDeps") - _yup_comma_or_space_separated_list (${module_config_value} module_android_dependencies) - elseif (${module_config_key} STREQUAL "androidLibs") - _yup_comma_or_space_separated_list (${module_config_value} module_android_libs) - elseif (${module_config_key} STREQUAL "androidDefines") - _yup_comma_or_space_separated_list (${module_config_value} module_android_defines) - - elseif (${module_config_key} STREQUAL "enableARC") - _yup_boolean_property (${module_config_value} module_arc_enabled) - - endif() - endforeach() - - # ==== Scan sources to include - _yup_module_collect_sources ("${module_path}" module_sources) - - # ==== Setup libs and frameworks - set (module_frameworks "") - set (module_libs "") - if ("${yup_platform}" MATCHES "^(ios)$") - list (APPEND module_dependencies ${module_ios_dependencies}) - list (APPEND module_libs ${module_ios_libs}) - list (APPEND module_defines ${module_ios_defines}) - _yup_module_prepare_frameworks ("${module_ios_frameworks}" "${module_ios_weak_frameworks}" module_frameworks) - elseif ("${yup_platform}" MATCHES "^(osx)$") - list (APPEND module_dependencies ${module_osx_dependencies}) - list (APPEND module_libs ${module_osx_libs}) - list (APPEND module_defines ${module_osx_defines}) - _yup_module_prepare_frameworks ("${module_osx_frameworks}" "${module_osx_weak_frameworks}" module_frameworks) - elseif ("${yup_platform}" MATCHES "^(linux)$") - list (APPEND module_dependencies ${module_linux_dependencies}) - list (APPEND module_libs ${module_linux_libs}) - list (APPEND module_defines ${module_linux_defines}) - foreach (package ${module_linux_packages}) - _yup_get_package_config_libs ("${package}" package_libs) - list (APPEND module_libs ${package_libs}) - endforeach() - elseif ("${yup_platform}" MATCHES "^(emscripten)$") - list (APPEND module_dependencies ${module_wasm_dependencies}) - list (APPEND module_libs ${module_wasm_libs}) - list (APPEND module_defines ${module_wasm_defines}) - elseif ("${yup_platform}" MATCHES "^(android)$") - list (APPEND module_dependencies ${module_android_dependencies}) - list (APPEND module_libs ${module_android_libs}) - list (APPEND module_defines ${module_android_defines}) - list (APPEND module_include_paths "${ANDROID_NDK}/sources/android/native_app_glue") - elseif ("${yup_platform}" MATCHES "^(win32|uwp)$") - list (APPEND module_dependencies ${module_windows_dependencies}) - list (APPEND module_defines ${module_windows_defines}) - list (APPEND module_options ${module_windows_options}) - if (MINGW) - list (APPEND module_libs ${module_mingw_libs}) - else() - list (APPEND module_libs ${module_windows_libs}) - endif() - endif() - - #if (("${module_name}" STREQUAL "juce_audio_devices") AND ("${yup_platform}" MATCHES "^(android)$")) - # add_subdirectory("${module_path}/native/oboe") - # list (APPEND module_libs oboe) - #endif() - - # ==== Prepare include paths - get_filename_component (module_include_path ${module_path} DIRECTORY) - list (APPEND module_include_paths "${module_include_path}") - - foreach (searchpath ${module_searchpaths}) - if (EXISTS "${module_path}/${searchpath}") - list (APPEND module_include_paths "${module_path}/${searchpath}") - endif() - endforeach() - - # ==== Setup module sources and properties - _yup_module_setup_target (${module_name} - "${module_cpp_standard}" - "${module_include_paths}" - "${module_options}" - "${module_defines}" - "${module_sources}" - "${module_libs}" - "${module_frameworks}" - "${module_dependencies}" - "${module_arc_enabled}") - - #set (${module_name}_Configs "${module_user_configs}") - #set (${module_name}_Configs ${${module_name}_Configs} PARENT_SCOPE) - - _yup_glob_recurse ("${module_path}/*" all_module_files) - target_sources (${module_name} PRIVATE ${all_module_files}) - source_group (TREE ${module_path}/ FILES ${all_module_files}) - list (REMOVE_ITEM all_module_files ${module_sources}) - set_source_files_properties (${all_module_files} PROPERTIES HEADER_FILE_ONLY TRUE) - - # ==== Setup parent scope variables - set (${module_name}_Found ON PARENT_SCOPE) - set_target_properties (${module_name} PROPERTIES - YUP_MODULE_PATH "${module_path}" - YUP_MODULE_HEADER "${module_header}" - YUP_MODULE_CPP_STANDARD "${module_cpp_standard}" - YUP_MODULE_INCLUDE_PATHS "${module_include_paths}" - YUP_MODULE_OPTIONS "${module_options}" - YUP_MODULE_DEFINES "${module_defines}" - YUP_MODULE_SOURCES "${module_sources}" - YUP_MODULE_LIBS "${module_libs}" - YUP_MODULE_FRAMEWORK "${module_frameworks}" - YUP_MODULE_DEPENDENCIES "${module_dependencies}" - YUP_MODULE_ARC_ENABLED "${module_arc_enabled}") - -endfunction() - -#============================================================================== - -function (yup_standalone_app) - # ==== Fetch options - set (options CONSOLE) - set (one_value_args - TARGET_NAME TARGET_VERSION TARGET_IDE_GROUP TARGET_APP_ID TARGET_APP_NAMESPACE - CUSTOM_PLIST CUSTOM_SHELL) - set (multi_value_args - DEFINITIONS MODULES PRELOAD_FILES LINK_OPTIONS) - - cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) - - set (target_name "${YUP_ARG_TARGET_NAME}") - set (target_version "${YUP_ARG_TARGET_VERSION}") - set (target_app_id "${YUP_ARG_TARGET_APP_ID}") - set (target_app_namespace "${YUP_ARG_TARGET_APP_NAMESPACE}") - set (additional_definitions "") - set (additional_options "") - set (additional_libraries "") - set (additional_link_options "") - - _yup_make_short_version ("${target_version}" target_version_short) - - # ==== Setup Android platform, build gradle stage - if (YUP_TARGET_ANDROID) - _yup_prepare_gradle_android( - TARGET_NAME ${target_name} - APPLICATION_ID ${target_app_id} - APPLICATION_NAMESPACE ${target_app_namespace} - APPLICATION_VERSION ${target_version}) - return() - endif() - - # ==== Find dependencies - if (NOT "${yup_platform}" MATCHES "^(emscripten|ios)$") - _yup_fetch_glfw3() - list (APPEND additional_libraries glfw) - endif() - - # ==== Enable profiling - if (YUP_ENABLE_PROFILING AND NOT "${target_name}" STREQUAL "yup_tests") - list (APPEND additional_definitions JUCE_ENABLE_PROFILING=1 YUP_ENABLE_PROFILING=1) - list (APPEND additional_libraries perfetto::perfetto) - endif() - - # ==== Prepare executable - set (executable_options "") - if (NOT YUP_ARG_CONSOLE AND "${yup_platform}" MATCHES "^(win32)$") - set (executable_options "WIN32") - endif() - - if ("${yup_platform}" MATCHES "^(android)$") - add_library (${target_name} SHARED) - else() - add_executable (${target_name} ${executable_options}) - endif() - - target_compile_features (${target_name} PRIVATE cxx_std_17) - - # ==== Per platform configuration - if ("${yup_platform}" MATCHES "^(osx|ios)$") - if (NOT YUP_ARG_CONSOLE) - if (NOT DEFINED YUP_ARG_CUSTOM_PLIST) - set (YUP_ARG_CUSTOM_PLIST "${CMAKE_SOURCE_DIR}/cmake/platforms/${yup_platform}/Info.plist") - endif() - - set_target_properties (${target_name} PROPERTIES - BUNDLE ON - CXX_EXTENSIONS OFF - MACOSX_BUNDLE_EXECUTABLE_NAME "${target_name}" - MACOSX_BUNDLE_GUI_IDENTIFIER "org.kunitoki.yup.${target_name}" - MACOSX_BUNDLE_BUNDLE_NAME "${target_name}" - MACOSX_BUNDLE_BUNDLE_VERSION "${target_version}" - MACOSX_BUNDLE_LONG_VERSION_STRING "${target_version}" - MACOSX_BUNDLE_SHORT_VERSION_STRING "${target_version_short}" - MACOSX_BUNDLE_ICON_FILE "Icon.icns" - MACOSX_BUNDLE_INFO_PLIST "${YUP_ARG_CUSTOM_PLIST}" - #RESOURCE "${RESOURCE_FILES}" - #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" - XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED OFF - XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf - XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN ON - XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF) - endif() - - set_target_properties (${target_name} PROPERTIES - XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC OFF) - - elseif ("${yup_platform}" MATCHES "^(emscripten)$") - if (NOT YUP_ARG_CONSOLE) - set_target_properties (${target_name} PROPERTIES SUFFIX ".html") - - list (APPEND additional_definitions RIVE_WEBGL=1) - list (APPEND additional_link_options -sUSE_GLFW=3 -sMAX_WEBGL_VERSION=2) - endif() - - if (NOT DEFINED YUP_ARG_CUSTOM_SHELL) - set (YUP_ARG_CUSTOM_SHELL "${CMAKE_SOURCE_DIR}/cmake/platforms/${yup_platform}/shell.html") - endif() - - list (APPEND additional_options - $<$:-O0 -g> - $<$:-O3> - -fexceptions - -pthread - -sDISABLE_EXCEPTION_CATCHING=0) - - list (APPEND additional_link_options - $<$:-gsource-map -g> - -fexceptions - -pthread - -sWASM=1 - -sWASM_WORKERS=1 - -sAUDIO_WORKLET=1 - -sSHARED_MEMORY=1 - -sALLOW_MEMORY_GROWTH=0 - -sASSERTIONS=1 - -sDISABLE_EXCEPTION_CATCHING=0 - -sERROR_ON_UNDEFINED_SYMBOLS=1 - -sDEMANGLE_SUPPORT=1 - -sSTACK_OVERFLOW_CHECK=2 - -sPTHREAD_POOL_SIZE=8 - -sFORCE_FILESYSTEM=1 - -sNODERAWFS=0 - -sFETCH=1 - -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$dynCall' - --shell-file "${YUP_ARG_CUSTOM_SHELL}") - - foreach (preload_file ${YUP_ARG_PRELOAD_FILES}) - list (APPEND additional_link_options --preload-file ${preload_file}) - endforeach() - - set (target_copy_dest "$") - add_custom_command( - TARGET ${target_name} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - "${CMAKE_SOURCE_DIR}/cmake/platforms/${yup_platform}/mini-coi.js" - "${target_copy_dest}/mini-coi.js") - - endif() - - if (YUP_ARG_TARGET_IDE_GROUP) - set_target_properties (${target_name} PROPERTIES FOLDER "${YUP_ARG_TARGET_IDE_GROUP}") - endif() - - # ==== Definitions and link libraries - target_compile_options (${target_name} PRIVATE - ${additional_options} - ${YUP_ARG_OPTIONS}) - - target_compile_definitions (${target_name} PRIVATE - $,DEBUG=1,NDEBUG=1> - JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 - JUCE_STANDALONE_APPLICATION=1 - ${additional_definitions} - ${YUP_ARG_DEFINITIONS}) - - target_link_options (${target_name} PRIVATE - ${additional_link_options} - ${YUP_ARG_LINK_OPTIONS}) - - target_link_libraries (${target_name} PRIVATE - ${additional_libraries} - ${YUP_ARG_MODULES}) - -endfunction() - -#============================================================================== - -function (yup_audio_plugin) - # ==== Fetch options - set (options CONSOLE) - set (one_value_args TARGET_NAME TARGET_IDE_GROUP PLUGIN_CREATE_CLAP PLUGIN_CREATE_STANDALONE) - set (multi_value_args DEFINITIONS MODULES LINK_OPTIONS) - - cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) - - set (target_name "${YUP_ARG_TARGET_NAME}") - set (additional_definitions "") - set (additional_options "") - set (additional_libraries "yup_audio_plugin_client") - set (additional_link_options "") - - # ==== Find dependencies - include (FetchContent) - - if (NOT "${yup_platform}" MATCHES "^(emscripten)$") - _yup_fetch_glfw3() - list (APPEND additional_libraries glfw) - - # ==== Fetch plugins SDKS - if (YUP_ARG_PLUGIN_CREATE_CLAP) - FetchContent_Declare(clap GIT_REPOSITORY https://github.com/free-audio/clap.git GIT_TAG main) - FetchContent_MakeAvailable (clap) - set_target_properties (clap-tests PROPERTIES FOLDER "Tests") - - _yup_module_setup_plugin_client_clap (${target_name} yup_audio_plugin_client ${YUP_ARG_TARGET_IDE_GROUP} ${YUP_ARG_UNPARSED_ARGUMENTS}) - - list (APPEND additional_libraries clap ${target_name}_clap) - endif() - - if (NOT YUP_ARG_PLUGIN_CREATE_CLAP AND NOT PLUGIN_CREATE_STANDALONE) # AND NOT YUP_ARG_PLUGIN_CREATE_VST3 ... - message (FATAL_ERROR "YUP -- Cannot enable audio plugins on WASM targets yet") - endif() - endif() - - if (YUP_ARG_PLUGIN_CREATE_STANDALONE) - list (APPEND additional_definitions YUP_AUDIO_PLUGIN_ENABLE_STANDALONE=1) - endif() - - # ==== Prepare shared binary - add_library (${target_name} SHARED) - target_compile_features (${target_name} PRIVATE cxx_std_17) - - # ==== Per platform configuration - if ("${yup_platform}" MATCHES "^(osx)$") - #if (NOT YUP_ARG_CONSOLE) - # set_target_properties (${target_name} PROPERTIES - # BUNDLE ON - # CXX_EXTENSIONS OFF - # MACOSX_BUNDLE_GUI_IDENTIFIER "org.kunitoki.yup.${target_name}" - # MACOSX_BUNDLE_NAME "${target_name}" - # MACOSX_BUNDLE_VERSION "1.0.0" - # #MACOSX_BUNDLE_ICON_FILE "Icon.icns" - # MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/platforms/${yup_platform}/Info.plist" - # #RESOURCE "${RESOURCE_FILES}" - # #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" - # XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED OFF - # XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf - # XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN ON - # XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF) - #endif() - - set_target_properties (${target_name} PROPERTIES - XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC OFF) - - endif() - - if (YUP_ARG_PLUGIN_CREATE_CLAP) - set_target_properties (${target_name} PROPERTIES SUFFIX ".clap") - endif() - - if (YUP_ARG_TARGET_IDE_GROUP) - set_target_properties (${target_name} PROPERTIES FOLDER "${YUP_ARG_TARGET_IDE_GROUP}") - endif() - - # ==== Definitions and link libraries - target_compile_options (${target_name} PRIVATE - ${additional_options} - ${YUP_ARG_OPTIONS}) - - target_compile_definitions (${target_name} PRIVATE - $,DEBUG=1,NDEBUG=1> - JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 - JUCE_STANDALONE_APPLICATION=0 - JUCE_MODAL_LOOPS_PERMITTED=1 - ${additional_definitions} - ${YUP_ARG_DEFINITIONS}) - - target_link_options (${target_name} PRIVATE - ${additional_link_options} - ${YUP_ARG_LINK_OPTIONS}) - - target_link_libraries (${target_name} PRIVATE - ${additional_libraries} - ${YUP_ARG_MODULES}) - -endfunction() - -#============================================================================== - -function (yup_add_embedded_binary_resources library_name) - set (options "") - set (one_value_args OUT_DIR HEADER NAMESPACE) - set (multi_value_args RESOURCE_NAMES RESOURCES) - - cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) - - set (binary_path "${CMAKE_CURRENT_BINARY_DIR}/${YUP_ARG_OUT_DIR}") - set (binary_header_path "${binary_path}/${YUP_ARG_HEADER}") - set (binary_sources "") - - add_library (${library_name} OBJECT) - - target_include_directories (${library_name} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") - target_compile_features (${library_name} PUBLIC cxx_std_17) - - set_target_properties (${library_name} PROPERTIES POSITION_INDEPENDENT_CODE ON) - - file (WRITE "${binary_header_path}" - "#pragma once\n" - "\n" - "#include \n" - "#include \n" - "\n") - - if (DEFINED YUP_ARG_NAMESPACE) - file (APPEND "${binary_header_path}" - "namespace ${YUP_ARG_NAMESPACE}\n" - "{\n" - "\n") - endif() - - foreach (resource_name resource IN ZIP_LISTS YUP_ARG_RESOURCE_NAMES YUP_ARG_RESOURCES) - set (full_resource_unit_path "${CMAKE_CURRENT_BINARY_DIR}/${YUP_ARG_OUT_DIR}/${resource_name}.cpp") - set (full_resource_hex_path "${CMAKE_CURRENT_BINARY_DIR}/${YUP_ARG_OUT_DIR}/${resource_name}.inc") - - # Add symbol to header - file (APPEND "${binary_header_path}" - "extern const uint8_t ${resource_name}_data[];\n" - "extern const std::size_t ${resource_name}_size;\n" - "\n") - - # Write .cpp - file (WRITE "${full_resource_unit_path}" - "#include \"${YUP_ARG_HEADER}\"\n" - "\n" - "#include \n" - "\n") - - if (DEFINED YUP_ARG_NAMESPACE) - file (APPEND "${full_resource_unit_path}" - "namespace ${YUP_ARG_NAMESPACE}\n" - "{\n" - "\n") - endif() - - file (APPEND "${full_resource_unit_path}" - "const uint8_t ${resource_name}_data[] = \n" - "{\n" - "#include \"${resource_name}.inc\"\n" - "};\n" - "\n" - "const std::size_t ${resource_name}_size = sizeof (${resource_name}_data);\n" - "\n") - - if (DEFINED YUP_ARG_NAMESPACE) - file (APPEND "${full_resource_unit_path}" - "\n" - "} // namespace ${YUP_ARG_NAMESPACE}\n") - endif() - - _yup_file_to_byte_array (${resource} resource_byte_array) - file (WRITE "${full_resource_hex_path}" "${resource_byte_array}") - - list (APPEND binary_sources "${full_resource_unit_path}") - list (APPEND resources_hex_files "${full_resource_hex_path}") - endforeach() - - if (DEFINED YUP_ARG_NAMESPACE) - file (APPEND "${binary_header_path}" - "} // namespace ${YUP_ARG_NAMESPACE}\n") - endif() - - target_sources (${library_name} - PUBLIC "${binary_header_path}" - PRIVATE "${binary_sources}") - - target_include_directories (${library_name} PUBLIC "${binary_path}") - - add_custom_target ("${library_name}_content" DEPENDS "${resources_hex_files}") - add_dependencies (${library_name} "${library_name}_content") + set (yup_platform "${yup_platform}" PARENT_SCOPE) endfunction() #============================================================================== -function (_yup_add_default_modules modules_path) - yup_add_module (${modules_path}/thirdparty/zlib) - yup_add_module (${modules_path}/thirdparty/glad) - yup_add_module (${modules_path}/thirdparty/harfbuzz) - yup_add_module (${modules_path}/thirdparty/sheenbidi) - yup_add_module (${modules_path}/thirdparty/yoga_library) - yup_add_module (${modules_path}/thirdparty/rive) - yup_add_module (${modules_path}/thirdparty/rive_renderer) - yup_add_module (${modules_path}/thirdparty/oboe) - - # Original juce modules - yup_add_module (${modules_path}/modules/juce_core) - yup_add_module (${modules_path}/modules/juce_events) - yup_add_module (${modules_path}/modules/juce_audio_basics) - yup_add_module (${modules_path}/modules/juce_audio_devices) - - # New yup modules - yup_add_module (${modules_path}/modules/yup_audio_processors) - yup_add_module (${modules_path}/modules/yup_audio_plugin_client) - yup_add_module (${modules_path}/modules/yup_graphics) - yup_add_module (${modules_path}/modules/yup_gui) -endfunction() +include (${CMAKE_CURRENT_LIST_DIR}/yup_utilities.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/yup_platforms.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/yup_dependencies.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/yup_modules.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/yup_standalone.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/yup_audio_plugin.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/yup_embed_binary.cmake) diff --git a/cmake/yup_audio_plugin.cmake b/cmake/yup_audio_plugin.cmake new file mode 100644 index 000000000..0458d552e --- /dev/null +++ b/cmake/yup_audio_plugin.cmake @@ -0,0 +1,120 @@ +# ============================================================================== +# +# This file is part of the YUP library. +# Copyright (c) 2024 - kunitoki@gmail.com +# +# YUP is an open source library subject to open-source licensing. +# +# The code included in this file is provided under the terms of the ISC license +# http://www.isc.org/downloads/software-support-policy/isc-license. Permission +# To use, copy, modify, and/or distribute this software for any purpose with or +# without fee is hereby granted provided that the above copyright notice and +# this permission notice appear in all copies. +# +# YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER +# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE +# DISCLAIMED. +# +# ============================================================================== + +#============================================================================== + +function (yup_audio_plugin) + # ==== Fetch options + set (options CONSOLE) + set (one_value_args TARGET_NAME TARGET_IDE_GROUP PLUGIN_CREATE_CLAP PLUGIN_CREATE_STANDALONE) + set (multi_value_args DEFINITIONS MODULES LINK_OPTIONS) + + cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) + + set (target_name "${YUP_ARG_TARGET_NAME}") + set (additional_definitions "") + set (additional_options "") + set (additional_libraries "yup_audio_plugin_client") + set (additional_link_options "") + + # ==== Find dependencies + include (FetchContent) + + if (NOT "${yup_platform}" MATCHES "^(emscripten)$") + _yup_fetch_glfw3() + list (APPEND additional_libraries glfw) + + # ==== Fetch plugins SDKS + if (YUP_ARG_PLUGIN_CREATE_CLAP) + FetchContent_Declare (clap GIT_REPOSITORY https://github.com/free-audio/clap.git GIT_TAG main) + FetchContent_MakeAvailable (clap) + set_target_properties (clap-tests PROPERTIES FOLDER "Tests") + + _yup_module_setup_plugin_client_clap (${target_name} yup_audio_plugin_client ${YUP_ARG_TARGET_IDE_GROUP} ${YUP_ARG_UNPARSED_ARGUMENTS}) + + list (APPEND additional_libraries clap ${target_name}_clap) + endif() + + if (NOT YUP_ARG_PLUGIN_CREATE_CLAP AND NOT PLUGIN_CREATE_STANDALONE) # AND NOT YUP_ARG_PLUGIN_CREATE_VST3 ... + _yup_message (FATAL_ERROR "Cannot enable audio plugins on WASM targets yet") + endif() + endif() + + if (YUP_ARG_PLUGIN_CREATE_STANDALONE) + list (APPEND additional_definitions YUP_AUDIO_PLUGIN_ENABLE_STANDALONE=1) + endif() + + # ==== Prepare shared binary + add_library (${target_name} SHARED) + target_compile_features (${target_name} PRIVATE cxx_std_17) + + # ==== Per platform configuration + if ("${yup_platform}" MATCHES "^(osx)$") + #if (NOT YUP_ARG_CONSOLE) + # set_target_properties (${target_name} PROPERTIES + # BUNDLE ON + # CXX_EXTENSIONS OFF + # MACOSX_BUNDLE_GUI_IDENTIFIER "org.kunitoki.yup.${target_name}" + # MACOSX_BUNDLE_NAME "${target_name}" + # MACOSX_BUNDLE_VERSION "1.0.0" + # #MACOSX_BUNDLE_ICON_FILE "Icon.icns" + # MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/platforms/${yup_platform}/Info.plist" + # #RESOURCE "${RESOURCE_FILES}" + # #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" + # XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED OFF + # XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf + # XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN ON + # XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF) + #endif() + + set_target_properties (${target_name} PROPERTIES + XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC OFF) + + endif() + + if (YUP_ARG_PLUGIN_CREATE_CLAP) + set_target_properties (${target_name} PROPERTIES SUFFIX ".clap") + endif() + + if (YUP_ARG_TARGET_IDE_GROUP) + set_target_properties (${target_name} PROPERTIES FOLDER "${YUP_ARG_TARGET_IDE_GROUP}") + endif() + + # ==== Definitions and link libraries + target_compile_options (${target_name} PRIVATE + ${additional_options} + ${YUP_ARG_OPTIONS}) + + target_compile_definitions (${target_name} PRIVATE + $,DEBUG=1,NDEBUG=1> + JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 + JUCE_STANDALONE_APPLICATION=0 + JUCE_MODAL_LOOPS_PERMITTED=1 + ${additional_definitions} + ${YUP_ARG_DEFINITIONS}) + + target_link_options (${target_name} PRIVATE + ${additional_link_options} + ${YUP_ARG_LINK_OPTIONS}) + + target_link_libraries (${target_name} PRIVATE + ${additional_libraries} + ${YUP_ARG_MODULES}) + +endfunction() diff --git a/cmake/yup_dependencies.cmake b/cmake/yup_dependencies.cmake new file mode 100644 index 000000000..bffc1de42 --- /dev/null +++ b/cmake/yup_dependencies.cmake @@ -0,0 +1,73 @@ +# ============================================================================== +# +# This file is part of the YUP library. +# Copyright (c) 2024 - kunitoki@gmail.com +# +# YUP is an open source library subject to open-source licensing. +# +# The code included in this file is provided under the terms of the ISC license +# http://www.isc.org/downloads/software-support-policy/isc-license. Permission +# To use, copy, modify, and/or distribute this software for any purpose with or +# without fee is hereby granted provided that the above copyright notice and +# this permission notice appear in all copies. +# +# YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER +# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE +# DISCLAIMED. +# +# ============================================================================== + +#============================================================================== + +function (_yup_fetch_glfw3) + FetchContent_Declare (glfw + GIT_REPOSITORY https://github.com/kunitoki/glfw.git + GIT_TAG dev/android_support + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE) + + set (GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) + set (GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) + set (GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) + set (GLFW_BUILD_WAYLAND OFF CACHE BOOL "" FORCE) + set (GLFW_INSTALL OFF CACHE STRING "" FORCE) + + FetchContent_MakeAvailable (glfw) + + set_target_properties (glfw PROPERTIES FOLDER "Thirdparty") +endfunction() + +#============================================================================== + +function (_yup_fetch_perfetto) + FetchContent_Declare (Perfetto + GIT_REPOSITORY https://android.googlesource.com/platform/external/perfetto + GIT_TAG v42.0 + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE) + + FetchContent_MakeAvailable (Perfetto) + + add_library (perfetto STATIC) + target_compile_features (perfetto PUBLIC cxx_std_17) + + target_sources (perfetto + PRIVATE "$" + PUBLIC "$") + + target_include_directories (perfetto PUBLIC + "$") + + set_target_properties (perfetto PROPERTIES + POSITION_INDEPENDENT_CODE TRUE + FOLDER "Thirdparty") + + if (WIN32) + target_compile_definitions (perfetto PUBLIC NOMINMAX=1 WIN32_LEAN_AND_MEAN=1) + if (MSVC) + target_compile_options (perfetto PRIVATE /bigobj PUBLIC /Zc:__cplusplus /permissive-) + endif() + endif() + + add_library (perfetto::perfetto ALIAS perfetto) +endfunction() diff --git a/cmake/yup_embed_binary.cmake b/cmake/yup_embed_binary.cmake new file mode 100644 index 000000000..c2ebf8a3a --- /dev/null +++ b/cmake/yup_embed_binary.cmake @@ -0,0 +1,114 @@ +# ============================================================================== +# +# This file is part of the YUP library. +# Copyright (c) 2024 - kunitoki@gmail.com +# +# YUP is an open source library subject to open-source licensing. +# +# The code included in this file is provided under the terms of the ISC license +# http://www.isc.org/downloads/software-support-policy/isc-license. Permission +# To use, copy, modify, and/or distribute this software for any purpose with or +# without fee is hereby granted provided that the above copyright notice and +# this permission notice appear in all copies. +# +# YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER +# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE +# DISCLAIMED. +# +# ============================================================================== + +#============================================================================== + +function (yup_add_embedded_binary_resources library_name) + set (options "") + set (one_value_args OUT_DIR HEADER NAMESPACE) + set (multi_value_args RESOURCE_NAMES RESOURCES) + + cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) + + set (binary_path "${CMAKE_CURRENT_BINARY_DIR}/${YUP_ARG_OUT_DIR}") + set (binary_header_path "${binary_path}/${YUP_ARG_HEADER}") + set (binary_sources "") + + add_library (${library_name} OBJECT) + + target_include_directories (${library_name} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") + target_compile_features (${library_name} PUBLIC cxx_std_17) + + set_target_properties (${library_name} PROPERTIES POSITION_INDEPENDENT_CODE ON) + + file (WRITE "${binary_header_path}" + "#pragma once\n" + "\n" + "#include \n" + "#include \n" + "\n") + + if (DEFINED YUP_ARG_NAMESPACE) + file (APPEND "${binary_header_path}" + "namespace ${YUP_ARG_NAMESPACE}\n" + "{\n" + "\n") + endif() + + foreach (resource_name resource IN ZIP_LISTS YUP_ARG_RESOURCE_NAMES YUP_ARG_RESOURCES) + set (full_resource_unit_path "${CMAKE_CURRENT_BINARY_DIR}/${YUP_ARG_OUT_DIR}/${resource_name}.cpp") + set (full_resource_hex_path "${CMAKE_CURRENT_BINARY_DIR}/${YUP_ARG_OUT_DIR}/${resource_name}.inc") + + # Add symbol to header + file (APPEND "${binary_header_path}" + "extern const uint8_t ${resource_name}_data[];\n" + "extern const std::size_t ${resource_name}_size;\n" + "\n") + + # Write .cpp + file (WRITE "${full_resource_unit_path}" + "#include \"${YUP_ARG_HEADER}\"\n" + "\n" + "#include \n" + "\n") + + if (DEFINED YUP_ARG_NAMESPACE) + file (APPEND "${full_resource_unit_path}" + "namespace ${YUP_ARG_NAMESPACE}\n" + "{\n" + "\n") + endif() + + file (APPEND "${full_resource_unit_path}" + "const uint8_t ${resource_name}_data[] = \n" + "{\n" + "#include \"${resource_name}.inc\"\n" + "};\n" + "\n" + "const std::size_t ${resource_name}_size = sizeof (${resource_name}_data);\n" + "\n") + + if (DEFINED YUP_ARG_NAMESPACE) + file (APPEND "${full_resource_unit_path}" + "\n" + "} // namespace ${YUP_ARG_NAMESPACE}\n") + endif() + + _yup_file_to_byte_array (${resource} resource_byte_array) + file (WRITE "${full_resource_hex_path}" "${resource_byte_array}") + + list (APPEND binary_sources "${full_resource_unit_path}") + list (APPEND resources_hex_files "${full_resource_hex_path}") + endforeach() + + if (DEFINED YUP_ARG_NAMESPACE) + file (APPEND "${binary_header_path}" + "} // namespace ${YUP_ARG_NAMESPACE}\n") + endif() + + target_sources (${library_name} + PUBLIC "${binary_header_path}" + PRIVATE "${binary_sources}") + + target_include_directories (${library_name} PUBLIC "${binary_path}") + + add_custom_target ("${library_name}_content" DEPENDS "${resources_hex_files}") + add_dependencies (${library_name} "${library_name}_content") + +endfunction() diff --git a/cmake/yup_modules.cmake b/cmake/yup_modules.cmake new file mode 100644 index 000000000..a113a5726 --- /dev/null +++ b/cmake/yup_modules.cmake @@ -0,0 +1,563 @@ +# ============================================================================== +# +# This file is part of the YUP library. +# Copyright (c) 2024 - kunitoki@gmail.com +# +# YUP is an open source library subject to open-source licensing. +# +# The code included in this file is provided under the terms of the ISC license +# http://www.isc.org/downloads/software-support-policy/isc-license. Permission +# To use, copy, modify, and/or distribute this software for any purpose with or +# without fee is hereby granted provided that the above copyright notice and +# this permission notice appear in all copies. +# +# YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER +# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE +# DISCLAIMED. +# +# ============================================================================== + +#============================================================================== + +function (_yup_module_parse_config module_header output_module_configs output_module_user_configs) + set (module_configs "") + set (module_user_configs "") + + set (begin_decl OFF) + set (end_decl OFF) + file (STRINGS ${module_header} module_header_lines) + while (module_header_lines) + list (POP_FRONT module_header_lines line) + if (line MATCHES "^.*BEGIN_JUCE_MODULE_DECLARATION.*") + set (begin_decl ON) + elseif (line MATCHES "^.*END_JUCE_MODULE_DECLARATION.*") + if (NOT begin_decl) + _yup_message (FATAL_ERROR "Invalid module declaration") + endif() + set (begin_decl OFF) + elseif (begin_decl) + string (STRIP "${line}" stripped_line) + if ("${stripped_line}" STREQUAL "") + continue() + endif() + list (APPEND module_configs ${stripped_line}) + elseif (line MATCHES "^.*Config:.*") + string (STRIP "${line}" stripped_line) + string (REGEX REPLACE "^.*Config:(.*)$" "\\1" user_config_name ${stripped_line}) + string (STRIP "${user_config_name}" stripped_user_config_name) + if ("${stripped_user_config_name}" STREQUAL "") + continue() + endif() + list (APPEND module_user_configs ${stripped_user_config_name}) + endif() + endwhile() + + set (${output_module_configs} "${module_configs}" PARENT_SCOPE) + set (${output_module_user_configs} "${module_user_configs}" PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_module_collect_sources folder output_variable) + set(source_extensions ".c;.cc;.cxx;.cpp;.h;.hh;.hxx;.hpp") + if (APPLE) + list (APPEND source_extensions ".m" ".mm") + endif() + + set (base_path "${folder}/${module_name}") + set (all_module_sources "") + + foreach (extension ${source_extensions}) + file (GLOB found_source_files "${base_path}*${extension}") + + if (NOT "${yup_platform}" MATCHES "^(win32|uwp)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_windows${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(win32)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_win32${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(uwp)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_uwp${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(ios|osx)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_apple${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(ios)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_ios${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(osx)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_osx${extension}") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_mac${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(linux)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_linux${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(ios|android)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_mobile${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(android)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_android${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(emscripten)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_emscripten${extension}") + endif() + + if (NOT "${yup_platform}" MATCHES "^(ios|osx|android|linux|emscripten)$") + list (FILTER found_source_files EXCLUDE REGEX "${base_path}*_posix${extension}") + endif() + + foreach (source ${found_source_files}) + list (APPEND all_module_sources ${source}) + endforeach() + endforeach() + + set (module_sources "") + foreach (module_source ${all_module_sources}) + if (APPLE) + if (module_source MATCHES "^.*\.(cc|cxx|cpp)$") + get_filename_component (source_directory ${module_source} DIRECTORY) + get_filename_component (source_file ${module_source} NAME_WLE) + set (imported_module_source "${source_directory}/${source_file}.mm") + if (${imported_module_source} IN_LIST all_module_sources) + continue() + endif() + elseif (module_source MATCHES "^.*\.c$") + get_filename_component (source_directory ${module_source} DIRECTORY) + get_filename_component (source_file ${module_source} NAME_WLE) + set (imported_module_source "${source_directory}/${source_file}.m") + if (${imported_module_source} IN_LIST all_module_sources) + continue() + endif() + endif() + endif() + list (APPEND module_sources ${module_source}) + endforeach() + + set (${output_variable} "${module_sources}" PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_module_prepare_frameworks frameworks weak_frameworks output_variable) + set (temp_frameworks "") + foreach (framework ${frameworks}) + list (APPEND temp_frameworks "-framework ${framework}") + endforeach() + + foreach (framework ${weak_frameworks}) + list (APPEND temp_frameworks "-weak_framework ${framework}") + endforeach() + + list (JOIN temp_frameworks " " final_frameworks) + set (${output_variable} "${final_frameworks}" PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_module_setup_target module_name + module_cpp_standard + module_include_paths + module_options + module_defines + module_sources + module_libs + module_frameworks + module_dependencies + module_arc_enabled) + if ("${yup_platform}" MATCHES "^(win32|uwp)$") + list (APPEND module_defines NOMINMAX=1 WIN32_LEAN_AND_MEAN=1) + endif() + + if ("${yup_platform}" MATCHES "^(android)$") + list (APPEND module_include_paths + "${ANDROID_NDK}/sources/android/cpufeatures") + list (APPEND module_sources + "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c") + endif() + + target_sources (${module_name} INTERFACE ${module_sources}) + + if (module_cpp_standard) + target_compile_features (${module_name} INTERFACE cxx_std_${module_cpp_standard}) + else() + target_compile_features (${module_name} INTERFACE cxx_std_17) + endif() + + set_target_properties (${module_name} PROPERTIES + CXX_EXTENSIONS OFF + CXX_VISIBILITY_PRESET "hidden" + VISIBILITY_INLINES_HIDDEN ON) + + if ("${yup_platform}" MATCHES "^(osx|ios)$") + set_target_properties (${module_name} PROPERTIES + XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC ${module_arc_enabled}) + endif() + + target_compile_options (${module_name} INTERFACE + ${module_options}) + + target_compile_definitions (${module_name} INTERFACE + $,DEBUG=1,NDEBUG=1> + JUCE_MODULE_AVAILABLE_${module_name}=1 + JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 + ${module_defines}) + + target_include_directories (${module_name} INTERFACE + ${module_include_paths}) + + target_link_libraries (${module_name} INTERFACE + ${module_libs} + ${module_frameworks}) + + target_link_libraries (${module_name} INTERFACE + ${module_dependencies}) + + #add_library("yup::${module_name}" ALIAS ${module_name}) + +endfunction() + +#============================================================================== + +function (_yup_module_setup_plugin_client_clap target_name plugin_client_target folder_name) + if (NOT "${yup_platform}" MATCHES "^(osx|linux|win32)$") + return() + endif() + + set (options "") + set (one_value_args PLUGIN_ID PLUGIN_NAME PLUGIN_VENDOR PLUGIN_VERSION PLUGIN_DESCRIPTION PLUGIN_URL PLUGING_IS_SYNTH PLUGIN_IS_MONO) + set (multi_value_args "") + + cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) + + set (custom_target_name "${target_name}_clap") + + add_library (${custom_target_name} INTERFACE) + set_target_properties (${custom_target_name} PROPERTIES FOLDER "${folder_name}") + + get_target_property (module_path ${plugin_client_target} YUP_MODULE_PATH) + get_target_property (module_cpp_standard ${plugin_client_target} YUP_MODULE_CPP_STANDARD) + get_target_property (module_include_paths ${plugin_client_target} YUP_MODULE_INCLUDE_PATHS) + get_target_property (module_defines ${plugin_client_target} YUP_MODULE_DEFINES) + get_target_property (module_options ${plugin_client_target} YUP_MODULE_OPTIONS) + get_target_property (module_libs ${plugin_client_target} YUP_MODULE_LIBS) + get_target_property (module_frameworks ${plugin_client_target} YUP_MODULE_FRAMEWORK) + get_target_property (module_dependencies ${plugin_client_target} YUP_MODULE_DEPENDENCIES) + get_target_property (module_arc_enabled ${plugin_client_target} YUP_MODULE_ARC_ENABLED) + + list (APPEND module_defines YUP_AUDIO_PLUGIN_ENABLE_CLAP=1) + list (APPEND module_defines YupPlugin_Id="${YUP_ARG_PLUGIN_ID}") + list (APPEND module_defines YupPlugin_Name="${YUP_ARG_PLUGIN_NAME}") + list (APPEND module_defines YupPlugin_Version="${YUP_ARG_PLUGIN_VERSION}") + list (APPEND module_defines YupPlugin_Vendor="${YUP_ARG_PLUGIN_VENDOR}") + list (APPEND module_defines YupPlugin_Description="${YUP_ARG_PLUGIN_DESCRIPTION}") + list (APPEND module_defines YupPlugin_URL="${YUP_ARG_PLUGIN_URL}") + if (YUP_ARG_PLUGIN_IS_SYNTH) + list (APPEND module_defines YupPlugin_IsSynth=1) + else() + list (APPEND module_defines YupPlugin_IsSynth=0) + endif() + if (YUP_ARG_PLUGIN_IS_MONO) + list (APPEND module_defines YupPlugin_IsMono=1) + else() + list (APPEND module_defines YupPlugin_IsMono=0) + endif() + + if ("${yup_platform}" MATCHES "^(ios|osx)$") + _yup_glob_recurse ("${module_path}/clap/*.mm" module_sources) + else() + _yup_glob_recurse ("${module_path}/clap/*.cpp" module_sources) + endif() + + _yup_module_setup_target (${custom_target_name} + "${module_cpp_standard}" + "${module_include_paths}" + "${module_options}" + "${module_defines}" + "${module_sources}" + "${module_libs}" + "${module_frameworks}" + "${module_dependencies}" + "${module_arc_enabled}") + + + _yup_glob_recurse ("${module_path}/clap/*" all_module_files_clap) + target_sources (${custom_target_name} PRIVATE ${all_module_files_clap}) + source_group (TREE ${module_path}/clap/ FILES ${all_module_files_clap}) + list (REMOVE_ITEM all_module_files_clap ${module_sources}) + set_source_files_properties (${all_module_files_clap} PROPERTIES HEADER_FILE_ONLY TRUE) + +endfunction() + +#============================================================================== + +function (yup_add_module module_path) + get_filename_component (module_path ${module_path} ABSOLUTE) + get_filename_component (module_name ${module_path} NAME) + + _yup_message (STATUS "Processing module " ${module_name} " at " ${module_path}) + set (${module_name}_Found OFF PARENT_SCOPE) + + if (NOT EXISTS ${module_path}) + _yup_message (FATAL_ERROR "Module location not found") + endif() + + set (module_header "${module_path}/${module_name}.h") + if (NOT EXISTS ${module_header}) + _yup_message (FATAL_ERROR "Module header ${module_header} not found") + endif() + + # ==== Add module as library + add_library (${module_name} INTERFACE) + set_target_properties (${module_name} PROPERTIES FOLDER "Modules") + + # ==== Parse module declaration string + _yup_module_parse_config ("${module_header}" module_configs module_user_configs) + + # ==== Assign configs to variables from module declaration string + # Globals -------------------------------------------------------------- + set (module_cpp_standard "") + set (module_dependencies "") + set (module_include_paths "") + set (module_options "") + set (module_defines "") + set (module_searchpaths "") + set (module_searchpaths_private "") + set (module_arc_enabled OFF) + # macOS ----------------------------------------------------------------- + set (module_osx_dependencies "") + set (module_osx_frameworks "") + set (module_osx_weak_frameworks "") + set (module_osx_libs "") + set (module_osx_defines "") + # iOS ------------------------------------------------------------------- + set (module_ios_dependencies "") + set (module_ios_frameworks "") + set (module_ios_weak_frameworks "") + set (module_ios_libs "") + set (module_ios_defines "") + # Linux ----------------------------------------------------------------- + set (module_linux_dependencies "") + set (module_linux_libs "") + set (module_linux_packages "") + set (module_linux_defines "") + # Windows --------------------------------------------------------------- + set (module_windows_dependencies "") + set (module_windows_libs "") + set (module_windows_defines "") + set (module_windows_options "") + set (module_mingw_libs "") + # Wasm ------------------------------------------------------------------ + set (module_wasm_dependencies "") + set (module_wasm_libs "") + set (module_wasm_defines "") + # Android --------------------------------------------------------------- + set (module_android_dependencies "") + set (module_android_libs "") + set (module_android_defines "") + + set (parsed_dependencies "") + foreach (module_config ${module_configs}) + string (REGEX REPLACE "^(.+):([ \t\r\n]+.*)$" "\\1" module_config_key ${module_config}) + string (REGEX REPLACE "^.+:[ \t\r\n]+(.+)$" "\\1" module_config_value ${module_config}) + + if (${module_config_key} STREQUAL "minimumCppStandard") + set (module_cpp_standard "${module_config_value}") + elseif (${module_config_key} STREQUAL "dependencies") + _yup_comma_or_space_separated_list (${module_config_value} module_dependencies) + elseif (${module_config_key} STREQUAL "defines") + _yup_comma_or_space_separated_list (${module_config_value} module_defines) + elseif (${module_config_key} STREQUAL "searchpaths") + _yup_comma_or_space_separated_list (${module_config_value} module_searchpaths) + + elseif (${module_config_key} STREQUAL "osxDeps") + _yup_comma_or_space_separated_list (${module_config_value} module_osx_dependencies) + elseif (${module_config_key} STREQUAL "osxFrameworks") + _yup_comma_or_space_separated_list (${module_config_value} module_osx_frameworks) + elseif (${module_config_key} STREQUAL "osxWeakFrameworks") + _yup_comma_or_space_separated_list (${module_config_value} module_osx_weak_frameworks) + elseif (${module_config_key} STREQUAL "osxLibs") + _yup_comma_or_space_separated_list (${module_config_value} module_osx_libs) + elseif (${module_config_key} STREQUAL "osxDefines") + _yup_comma_or_space_separated_list (${module_config_value} module_osx_defines) + + elseif (${module_config_key} STREQUAL "iosDeps") + _yup_comma_or_space_separated_list (${module_config_value} module_ios_dependencies) + elseif (${module_config_key} STREQUAL "iosFrameworks") + _yup_comma_or_space_separated_list (${module_config_value} module_ios_frameworks) + elseif (${module_config_key} STREQUAL "iosWeakFrameworks") + _yup_comma_or_space_separated_list (${module_config_value} module_ios_weak_frameworks) + elseif (${module_config_key} STREQUAL "iosLibs") + _yup_comma_or_space_separated_list (${module_config_value} module_ios_libs) + elseif (${module_config_key} STREQUAL "iosDefines") + _yup_comma_or_space_separated_list (${module_config_value} module_ios_defines) + + elseif (${module_config_key} STREQUAL "linuxDeps") + _yup_comma_or_space_separated_list (${module_config_value} module_linux_dependencies) + elseif (${module_config_key} STREQUAL "linuxLibs") + _yup_comma_or_space_separated_list (${module_config_value} module_linux_libs) + elseif (${module_config_key} STREQUAL "linuxPackages") + _yup_comma_or_space_separated_list (${module_config_value} module_linux_packages) + elseif (${module_config_key} STREQUAL "linuxDefines") + _yup_comma_or_space_separated_list (${module_config_value} module_linux_defines) + + elseif (${module_config_key} STREQUAL "windowsDeps") + _yup_comma_or_space_separated_list (${module_config_value} module_windows_dependencies) + elseif (${module_config_key} STREQUAL "windowsLibs") + _yup_comma_or_space_separated_list (${module_config_value} module_windows_libs) + elseif (${module_config_key} STREQUAL "windowsDefines") + _yup_comma_or_space_separated_list (${module_config_value} module_windows_defines) + elseif (${module_config_key} STREQUAL "windowsOptions") + _yup_comma_or_space_separated_list (${module_config_value} module_windows_options) + elseif (${module_config_key} STREQUAL "mingwLibs") + _yup_comma_or_space_separated_list (${module_config_value} module_mingw_libs) + + elseif (${module_config_key} STREQUAL "wasmDeps") + _yup_comma_or_space_separated_list (${module_config_value} module_wasm_dependencies) + elseif (${module_config_key} STREQUAL "wasmLibs") + _yup_comma_or_space_separated_list (${module_config_value} module_wasm_libs) + elseif (${module_config_key} STREQUAL "wasmDefines") + _yup_comma_or_space_separated_list (${module_config_value} module_wasm_defines) + + elseif (${module_config_key} STREQUAL "androidDeps") + _yup_comma_or_space_separated_list (${module_config_value} module_android_dependencies) + elseif (${module_config_key} STREQUAL "androidLibs") + _yup_comma_or_space_separated_list (${module_config_value} module_android_libs) + elseif (${module_config_key} STREQUAL "androidDefines") + _yup_comma_or_space_separated_list (${module_config_value} module_android_defines) + + elseif (${module_config_key} STREQUAL "enableARC") + _yup_boolean_property (${module_config_value} module_arc_enabled) + + endif() + endforeach() + + # ==== Scan sources to include + _yup_module_collect_sources ("${module_path}" module_sources) + + # ==== Setup libs and frameworks + set (module_frameworks "") + set (module_libs "") + if ("${yup_platform}" MATCHES "^(ios)$") + list (APPEND module_dependencies ${module_ios_dependencies}) + list (APPEND module_libs ${module_ios_libs}) + list (APPEND module_defines ${module_ios_defines}) + _yup_module_prepare_frameworks ("${module_ios_frameworks}" "${module_ios_weak_frameworks}" module_frameworks) + elseif ("${yup_platform}" MATCHES "^(osx)$") + list (APPEND module_dependencies ${module_osx_dependencies}) + list (APPEND module_libs ${module_osx_libs}) + list (APPEND module_defines ${module_osx_defines}) + _yup_module_prepare_frameworks ("${module_osx_frameworks}" "${module_osx_weak_frameworks}" module_frameworks) + elseif ("${yup_platform}" MATCHES "^(linux)$") + list (APPEND module_dependencies ${module_linux_dependencies}) + list (APPEND module_libs ${module_linux_libs}) + list (APPEND module_defines ${module_linux_defines}) + foreach (package ${module_linux_packages}) + _yup_get_package_config_libs ("${package}" package_libs) + list (APPEND module_libs ${package_libs}) + endforeach() + elseif ("${yup_platform}" MATCHES "^(emscripten)$") + list (APPEND module_dependencies ${module_wasm_dependencies}) + list (APPEND module_libs ${module_wasm_libs}) + list (APPEND module_defines ${module_wasm_defines}) + elseif ("${yup_platform}" MATCHES "^(android)$") + list (APPEND module_dependencies ${module_android_dependencies}) + list (APPEND module_libs ${module_android_libs}) + list (APPEND module_defines ${module_android_defines}) + list (APPEND module_include_paths "${ANDROID_NDK}/sources/android/native_app_glue") + elseif ("${yup_platform}" MATCHES "^(win32|uwp)$") + list (APPEND module_dependencies ${module_windows_dependencies}) + list (APPEND module_defines ${module_windows_defines}) + list (APPEND module_options ${module_windows_options}) + if (MINGW) + list (APPEND module_libs ${module_mingw_libs}) + else() + list (APPEND module_libs ${module_windows_libs}) + endif() + endif() + + #if (("${module_name}" STREQUAL "juce_audio_devices") AND ("${yup_platform}" MATCHES "^(android)$")) + # add_subdirectory("${module_path}/native/oboe") + # list (APPEND module_libs oboe) + #endif() + + # ==== Prepare include paths + get_filename_component (module_include_path ${module_path} DIRECTORY) + list (APPEND module_include_paths "${module_include_path}") + + foreach (searchpath ${module_searchpaths}) + if (EXISTS "${module_path}/${searchpath}") + list (APPEND module_include_paths "${module_path}/${searchpath}") + endif() + endforeach() + + # ==== Setup module sources and properties + _yup_module_setup_target (${module_name} + "${module_cpp_standard}" + "${module_include_paths}" + "${module_options}" + "${module_defines}" + "${module_sources}" + "${module_libs}" + "${module_frameworks}" + "${module_dependencies}" + "${module_arc_enabled}") + + #set (${module_name}_Configs "${module_user_configs}") + #set (${module_name}_Configs ${${module_name}_Configs} PARENT_SCOPE) + + _yup_glob_recurse ("${module_path}/*" all_module_files) + target_sources (${module_name} PRIVATE ${all_module_files}) + source_group (TREE ${module_path}/ FILES ${all_module_files}) + list (REMOVE_ITEM all_module_files ${module_sources}) + set_source_files_properties (${all_module_files} PROPERTIES HEADER_FILE_ONLY TRUE) + + # ==== Setup parent scope variables + set (${module_name}_Found ON PARENT_SCOPE) + set_target_properties (${module_name} PROPERTIES + YUP_MODULE_PATH "${module_path}" + YUP_MODULE_HEADER "${module_header}" + YUP_MODULE_CPP_STANDARD "${module_cpp_standard}" + YUP_MODULE_INCLUDE_PATHS "${module_include_paths}" + YUP_MODULE_OPTIONS "${module_options}" + YUP_MODULE_DEFINES "${module_defines}" + YUP_MODULE_SOURCES "${module_sources}" + YUP_MODULE_LIBS "${module_libs}" + YUP_MODULE_FRAMEWORK "${module_frameworks}" + YUP_MODULE_DEPENDENCIES "${module_dependencies}" + YUP_MODULE_ARC_ENABLED "${module_arc_enabled}") + +endfunction() + +#============================================================================== + +function (_yup_add_default_modules modules_path) + yup_add_module (${modules_path}/thirdparty/zlib) + yup_add_module (${modules_path}/thirdparty/glad) + yup_add_module (${modules_path}/thirdparty/harfbuzz) + yup_add_module (${modules_path}/thirdparty/sheenbidi) + yup_add_module (${modules_path}/thirdparty/yoga_library) + yup_add_module (${modules_path}/thirdparty/rive) + yup_add_module (${modules_path}/thirdparty/rive_renderer) + yup_add_module (${modules_path}/thirdparty/oboe_library) + + # Original juce modules + yup_add_module (${modules_path}/modules/juce_core) + yup_add_module (${modules_path}/modules/juce_events) + yup_add_module (${modules_path}/modules/juce_audio_basics) + yup_add_module (${modules_path}/modules/juce_audio_devices) + + # New yup modules + yup_add_module (${modules_path}/modules/yup_audio_processors) + yup_add_module (${modules_path}/modules/yup_audio_plugin_client) + yup_add_module (${modules_path}/modules/yup_graphics) + yup_add_module (${modules_path}/modules/yup_gui) +endfunction() diff --git a/cmake/yup_platforms.cmake b/cmake/yup_platforms.cmake new file mode 100644 index 000000000..28633cab3 --- /dev/null +++ b/cmake/yup_platforms.cmake @@ -0,0 +1,67 @@ +# ============================================================================== +# +# This file is part of the YUP library. +# Copyright (c) 2024 - kunitoki@gmail.com +# +# YUP is an open source library subject to open-source licensing. +# +# The code included in this file is provided under the terms of the ISC license +# http://www.isc.org/downloads/software-support-policy/isc-license. Permission +# To use, copy, modify, and/or distribute this software for any purpose with or +# without fee is hereby granted provided that the above copyright notice and +# this permission notice appear in all copies. +# +# YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER +# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE +# DISCLAIMED. +# +# ============================================================================== + +#============================================================================== + +function (_yup_prepare_gradle_android) + set (options "") + set (one_value_args + MIN_SDK_VERSION COMPILE_SDK_VERSION TARGET_SDK_VERSION + TARGET_NAME ABI TOOLCHAIN PLATFORM STL CPP_VERSION CMAKE_VERSION + APPLICATION_ID APPLICATION_NAMESPACE APPLICATION_CMAKELISTS_PATH APPLICATION_VERSION) + set (multi_value_args "") + + cmake_parse_arguments (YUP_ANDROID "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) + + # Prepare variables + _yup_set_default (YUP_ANDROID_MIN_SDK_VERSION "21") + _yup_set_default (YUP_ANDROID_COMPILE_SDK_VERSION "34") + _yup_set_default (YUP_ANDROID_TARGET_SDK_VERSION "${YUP_ANDROID_COMPILE_SDK_VERSION}") + _yup_set_default (YUP_ANDROID_TARGET_NAME "default_app") + _yup_set_default (YUP_ANDROID_TOOLCHAIN "clang") + _yup_set_default (YUP_ANDROID_PLATFORM "android-${YUP_ANDROID_MIN_SDK_VERSION}") + _yup_set_default (YUP_ANDROID_STL "c++_shared") + _yup_set_default (YUP_ANDROID_CPP_VERSION "17") + _yup_set_default (YUP_ANDROID_APPLICATION_ID "com.yup.default_app") + _yup_set_default (YUP_ANDROID_APPLICATION_NAMESPACE "${YUP_ANDROID_APPLICATION_ID}") + _yup_set_default (YUP_ANDROID_APPLICATION_VERSION "1.0") + _yup_set_default (YUP_ANDROID_APPLICATION_PATH "${CMAKE_CURRENT_SOURCE_DIR}") + _yup_set_default (YUP_ANDROID_ABI "arm64-v8a") + _yup_set_default (YUP_ANDROID_CMAKE_VERSION "${CMAKE_VERSION}") + + _yup_join_list_with_separator ("${YUP_ANDROID_ABI}" "\n " "abiFilters += \"" "\"" YUP_ANDROID_ABI) + _yup_version_string_to_version_code (${YUP_ANDROID_APPLICATION_VERSION} YUP_ANDROID_APPLICATION_VERSION_CODE) + file (RELATIVE_PATH YUP_ANDROID_APPLICATION_PATH "${CMAKE_CURRENT_BINARY_DIR}/app" "${YUP_ANDROID_APPLICATION_PATH}") + + # Prepare files + set (BASE_FILES_PATH "${CMAKE_SOURCE_DIR}/cmake/platforms/android") + configure_file (${BASE_FILES_PATH}/build.gradle.kts.in ${CMAKE_CURRENT_BINARY_DIR}/build.gradle.kts) + configure_file (${BASE_FILES_PATH}/settings.gradle.kts.in ${CMAKE_CURRENT_BINARY_DIR}/settings.gradle.kts) + configure_file (${BASE_FILES_PATH}/app/build.gradle.kts.in ${CMAKE_CURRENT_BINARY_DIR}/app/build.gradle.kts) + configure_file (${BASE_FILES_PATH}/app/proguard-rules.pro.in ${CMAKE_CURRENT_BINARY_DIR}/app/proguard-rules.pro) + configure_file (${BASE_FILES_PATH}/app/src/main/AndroidManifest.xml.in ${CMAKE_CURRENT_BINARY_DIR}/app/src/main/AndroidManifest.xml) + configure_file (${BASE_FILES_PATH}/gradle/libs.versions.toml.in ${CMAKE_CURRENT_BINARY_DIR}/gradle/libs.versions.toml COPYONLY) + configure_file (${BASE_FILES_PATH}/gradle/wrapper/gradle-wrapper.jar.in ${CMAKE_CURRENT_BINARY_DIR}/gradle/wrapper/gradle-wrapper.jar COPYONLY) + configure_file (${BASE_FILES_PATH}/gradle/wrapper/gradle-wrapper.properties.in ${CMAKE_CURRENT_BINARY_DIR}/gradle/wrapper/gradle-wrapper.properties COPYONLY) + configure_file (${BASE_FILES_PATH}/gradlew.in ${CMAKE_CURRENT_BINARY_DIR}/gradlew COPYONLY) + configure_file (${BASE_FILES_PATH}/gradlew.bat.in ${CMAKE_CURRENT_BINARY_DIR}/gradlew.bat COPYONLY) + configure_file (${BASE_FILES_PATH}/gradle.properties.in ${CMAKE_CURRENT_BINARY_DIR}/gradle.properties COPYONLY) +endfunction() + +#============================================================================== diff --git a/cmake/yup_standalone.cmake b/cmake/yup_standalone.cmake new file mode 100644 index 000000000..109297237 --- /dev/null +++ b/cmake/yup_standalone.cmake @@ -0,0 +1,190 @@ +# ============================================================================== +# +# This file is part of the YUP library. +# Copyright (c) 2024 - kunitoki@gmail.com +# +# YUP is an open source library subject to open-source licensing. +# +# The code included in this file is provided under the terms of the ISC license +# http://www.isc.org/downloads/software-support-policy/isc-license. Permission +# To use, copy, modify, and/or distribute this software for any purpose with or +# without fee is hereby granted provided that the above copyright notice and +# this permission notice appear in all copies. +# +# YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER +# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE +# DISCLAIMED. +# +# ============================================================================== + +#============================================================================== + +function (yup_standalone_app) + # ==== Fetch options + set (options "") + set (one_value_args + TARGET_NAME TARGET_VERSION TARGET_CONSOLE TARGET_IDE_GROUP TARGET_APP_ID TARGET_APP_NAMESPACE + CUSTOM_PLIST CUSTOM_SHELL) + set (multi_value_args + DEFINITIONS MODULES PRELOAD_FILES LINK_OPTIONS) + + cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) + + set (target_name "${YUP_ARG_TARGET_NAME}") + set (target_version "${YUP_ARG_TARGET_VERSION}") + set (target_console "${YUP_ARG_TARGET_CONSOLE}") + set (target_app_id "${YUP_ARG_TARGET_APP_ID}") + set (target_app_namespace "${YUP_ARG_TARGET_APP_NAMESPACE}") + set (additional_definitions "") + set (additional_options "") + set (additional_libraries "") + set (additional_link_options "") + + _yup_set_default (target_console OFF) + _yup_make_short_version ("${target_version}" target_version_short) + + # ==== Setup Android platform, build gradle stage + if (YUP_TARGET_ANDROID) + _yup_prepare_gradle_android( + TARGET_NAME ${target_name} + APPLICATION_ID ${target_app_id} + APPLICATION_NAMESPACE ${target_app_namespace} + APPLICATION_VERSION ${target_version}) + return() + endif() + + # ==== Find dependencies + if (NOT "${yup_platform}" MATCHES "^(emscripten|ios)$") + _yup_fetch_glfw3() + list (APPEND additional_libraries glfw) + endif() + + # ==== Enable profiling + if (YUP_ENABLE_PROFILING AND NOT "${target_name}" STREQUAL "yup_tests") + list (APPEND additional_definitions JUCE_ENABLE_PROFILING=1 YUP_ENABLE_PROFILING=1) + list (APPEND additional_libraries perfetto::perfetto) + endif() + + # ==== Prepare executable + set (executable_options "") + if (NOT "${target_console}") + if ("${yup_platform}" MATCHES "^(win32)$") + set (executable_options "WIN32") + elseif ("${yup_platform}" MATCHES "^(osx)$") + set (executable_options "MACOSX_BUNDLE") + endif() + endif() + + if ("${yup_platform}" MATCHES "^(android)$") + add_library (${target_name} SHARED) + else() + add_executable (${target_name} ${executable_options}) + endif() + + target_compile_features (${target_name} PRIVATE cxx_std_17) + + # ==== Per platform configuration + if ("${yup_platform}" MATCHES "^(osx|ios)$") + if (NOT "${target_console}") + _yup_set_default (YUP_ARG_CUSTOM_PLIST "${CMAKE_SOURCE_DIR}/cmake/platforms/${yup_platform}/Info.plist") + + set_target_properties (${target_name} PROPERTIES + BUNDLE ON + CXX_EXTENSIONS OFF + MACOSX_BUNDLE_EXECUTABLE_NAME "${target_name}" + MACOSX_BUNDLE_GUI_IDENTIFIER "org.kunitoki.yup.${target_name}" + MACOSX_BUNDLE_BUNDLE_NAME "${target_name}" + MACOSX_BUNDLE_BUNDLE_VERSION "${target_version}" + MACOSX_BUNDLE_LONG_VERSION_STRING "${target_version}" + MACOSX_BUNDLE_SHORT_VERSION_STRING "${target_version_short}" + #MACOSX_BUNDLE_ICON_FILE "Icon.icns" + MACOSX_BUNDLE_INFO_PLIST "${YUP_ARG_CUSTOM_PLIST}" + #RESOURCE "${RESOURCE_FILES}" + #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" + XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED OFF + XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf + XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN ON + XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF) + endif() + + set_target_properties (${target_name} PROPERTIES + XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC OFF) + + elseif ("${yup_platform}" MATCHES "^(emscripten)$") + if (NOT "${target_console}") + set_target_properties (${target_name} PROPERTIES SUFFIX ".html") + + list (APPEND additional_definitions RIVE_WEBGL=1) + list (APPEND additional_link_options -sUSE_GLFW=3 -sMAX_WEBGL_VERSION=2) + endif() + + if (NOT DEFINED YUP_ARG_CUSTOM_SHELL) + set (YUP_ARG_CUSTOM_SHELL "${CMAKE_SOURCE_DIR}/cmake/platforms/${yup_platform}/shell.html") + endif() + + list (APPEND additional_options + $<$:-O0 -g> + $<$:-O3> + -fexceptions + -pthread + -sDISABLE_EXCEPTION_CATCHING=0) + + list (APPEND additional_link_options + $<$:-gsource-map -g> + -fexceptions + -pthread + -sWASM=1 + -sWASM_WORKERS=1 + -sAUDIO_WORKLET=1 + -sSHARED_MEMORY=1 + -sALLOW_MEMORY_GROWTH=0 + -sASSERTIONS=1 + -sDISABLE_EXCEPTION_CATCHING=0 + -sERROR_ON_UNDEFINED_SYMBOLS=1 + -sDEMANGLE_SUPPORT=1 + -sSTACK_OVERFLOW_CHECK=2 + -sPTHREAD_POOL_SIZE=8 + -sFORCE_FILESYSTEM=1 + -sNODERAWFS=0 + -sFETCH=1 + -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$dynCall' + --shell-file "${YUP_ARG_CUSTOM_SHELL}") + + foreach (preload_file ${YUP_ARG_PRELOAD_FILES}) + list (APPEND additional_link_options --preload-file ${preload_file}) + endforeach() + + set (target_copy_dest "$") + add_custom_command( + TARGET ${target_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_SOURCE_DIR}/cmake/platforms/${yup_platform}/mini-coi.js" + "${target_copy_dest}/mini-coi.js") + + endif() + + if (YUP_ARG_TARGET_IDE_GROUP) + set_target_properties (${target_name} PROPERTIES FOLDER "${YUP_ARG_TARGET_IDE_GROUP}") + endif() + + # ==== Definitions and link libraries + target_compile_options (${target_name} PRIVATE + ${additional_options} + ${YUP_ARG_OPTIONS}) + + target_compile_definitions (${target_name} PRIVATE + $,DEBUG=1,NDEBUG=1> + JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 + JUCE_STANDALONE_APPLICATION=1 + ${additional_definitions} + ${YUP_ARG_DEFINITIONS}) + + target_link_options (${target_name} PRIVATE + ${additional_link_options} + ${YUP_ARG_LINK_OPTIONS}) + + target_link_libraries (${target_name} PRIVATE + ${additional_libraries} + ${YUP_ARG_MODULES}) + +endfunction() diff --git a/cmake/yup_utilities.cmake b/cmake/yup_utilities.cmake new file mode 100644 index 000000000..f71b3c9ed --- /dev/null +++ b/cmake/yup_utilities.cmake @@ -0,0 +1,173 @@ +# ============================================================================== +# +# This file is part of the YUP library. +# Copyright (c) 2024 - kunitoki@gmail.com +# +# YUP is an open source library subject to open-source licensing. +# +# The code included in this file is provided under the terms of the ISC license +# http://www.isc.org/downloads/software-support-policy/isc-license. Permission +# To use, copy, modify, and/or distribute this software for any purpose with or +# without fee is hereby granted provided that the above copyright notice and +# this permission notice appear in all copies. +# +# YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER +# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE +# DISCLAIMED. +# +# ============================================================================== + +#============================================================================== + +function (_yup_set_default VAR VALUE) + if (NOT DEFINED ${VAR}) + set (${VAR} "${VALUE}" PARENT_SCOPE) + endif() +endfunction() + +#============================================================================== + +function (_yup_strip_list input_list output_variable) + set (inner_list "" PARENT_SCOPE) + foreach (item ${input_list}) + string (STRIP ${item} stripped_item) + if (${stripped_item} STREQUAL "") + continue() + endif() + list (APPEND inner_list ${stripped_item}) + endforeach() + set (${output_variable} "${inner_list}" PARENT_SCOPE) +endfunction() + +function (_yup_comma_or_space_separated_list input_list output_variable) + string (REPLACE "," " " temp1_list ${input_list}) + string (REPLACE " " ";" temp2_list ${temp1_list}) + _yup_strip_list ("${temp2_list}" final_list) + set (${output_variable} "${final_list}" PARENT_SCOPE) +endfunction() + +function (_yup_join_list_with_separator input_list separator prefix suffix output_variable) + set (result_string "") + set (local_separator "") + + foreach (item ${input_list}) + string (APPEND result_string "${local_separator}${prefix}${item}${suffix}") + set (local_separator "${separator}") + endforeach() + + set (${output_variable} "${result_string}" PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_make_short_version version output_variable) + string (REPLACE "." ";" version_list ${version}) + list (LENGTH version_list version_list_length) + math (EXPR version_list_last_index "${version_list_length} - 1") + list (REMOVE_AT version_list ${version_list_last_index}) + string (JOIN "." version_short ${version_list}) + set (${output_variable} "${version_short}" PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_boolean_property input_bool output_variable) + string (STRIP "${input_bool}" ${input_bool}) + string (TOLOWER "${input_bool}" ${input_bool}) + if ("${input_bool}" STREQUAL "on" OR "${input_bool}" STREQUAL "true" OR "${input_bool}" STREQUAL "1") + set (${output_variable} ON PARENT_SCOPE) + else() + set (${output_variable} OFF PARENT_SCOPE) + endif() +endfunction() + +#============================================================================== + +function (_yup_version_string_to_version_code version_string output_variable) + string (REPLACE "." ";" version_parts ${version_string}) + list (LENGTH version_parts num_parts) + set (major_version 0) + set (minor_version 0) + set (patch_version 0) + + if (${num_parts} GREATER 0) + list (GET version_parts 0 major_version) + endif() + if (${num_parts} GREATER 1) + list (GET version_parts 1 minor_version) + endif() + if (${num_parts} GREATER 2) + list (GET version_parts 2 patch_version) + endif() + + math (EXPR major_version_number "${major_version}") + math (EXPR minor_version_number "${minor_version}") + math (EXPR patch_version_number "${patch_version}") + + math (EXPR version_code "${major_version_number} * 100000 + ${minor_version_number} * 1000 + ${patch_version}") + set (${output_variable} ${version_code} PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_file_to_byte_array file_path output_variable) + file (READ ${file_path} hex_contents HEX) + string (REGEX MATCHALL "([A-Fa-f0-9][A-Fa-f0-9])" separated_hex ${hex_contents}) + + list (JOIN separated_hex ", 0x" formatted_hex) + string (PREPEND formatted_hex "0x") + string (APPEND formatted_hex "") + + set (${output_variable} "${formatted_hex}" PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_get_package_config_libs package_name output_variable) + find_package (PkgConfig REQUIRED) + pkg_check_modules (${package_name} REQUIRED IMPORTED_TARGET ${package_name}) + set (${output_variable} "PkgConfig::${package_name}" PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_glob_recurse folder output_variable) + file (GLOB_RECURSE all_files "${folder}") + + set (non_hidden_files "") + foreach (item ${all_files}) + get_filename_component (file_name ${item} NAME) + if (NOT ${file_name} MATCHES "^\\..*$") + list (APPEND non_hidden_files ${item}) + endif() + endforeach() + + set (${output_variable} "${non_hidden_files}" PARENT_SCOPE) +endfunction() + +#============================================================================== + +function (_yup_convert_png_to_icns png_path icons_path output_variable) + set (temp_iconset_path "${icons_path}.iconset") + set (output_iconset_path "${icons_path}.icns") + + # TODO - check png_path has png extension + + add_custom_command( + OUTPUT "${output_iconset_path}" + COMMAND mkdir -p "${temp_iconset_name}" + COMMAND sips -z 16 16 -s format png "${png_path}" --out "${temp_iconset_path}/icon_16x16.png" + COMMAND sips -z 32 32 -s format png "${png_path}" --out "${temp_iconset_path}/icon_32x32.png" + COMMAND sips -z 32 32 -s format png "${png_path}" --out "${temp_iconset_path}/icon_16x16@2x.png" + COMMAND sips -z 64 64 -s format png "${png_path}" --out "${temp_iconset_path}/icon_32x32@2x.png" + COMMAND sips -z 128 128 -s format png "${png_path}" --out "${temp_iconset_path}/icon_128x128.png" + COMMAND sips -z 256 256 -s format png "${png_path}" --out "${temp_iconset_path}/icon_128x128@2x.png" + COMMAND sips -z 256 256 -s format png "${png_path}" --out "${temp_iconset_path}/icon_256x256.png" + COMMAND sips -z 512 512 -s format png "${png_path}" --out "${temp_iconset_path}/icon_256x256@2x.png" + COMMAND sips -z 512 512 -s format png "${png_path}" --out "${temp_iconset_path}/icon_512x512.png" + COMMAND sips -z 1024 1024 -s format png "${png_path}" --out "${temp_iconset_path}/icon_512x512@2x.png" + COMMAND iconutil -c icns "${temp_iconset_path}" + COMMAND rm -R "${temp_iconset_path}") + + set (${output_variable} "${output_iconset_path}" PARENT_SCOPE) +endfunction() diff --git a/examples/console/CMakeLists.txt b/examples/console/CMakeLists.txt index e7de695cc..7f56c4fae 100644 --- a/examples/console/CMakeLists.txt +++ b/examples/console/CMakeLists.txt @@ -38,7 +38,7 @@ yup_standalone_app ( TARGET_IDE_GROUP "Examples" TARGET_APP_ID "org.yup.${target_name}" TARGET_APP_NAMESPACE "org.yup.${target_name}" - CONSOLE + TARGET_CONSOLE ON MODULES juce_core juce_events diff --git a/modules/juce_audio_devices/juce_audio_devices.cpp b/modules/juce_audio_devices/juce_audio_devices.cpp index 121eaa96b..e01480c9d 100644 --- a/modules/juce_audio_devices/juce_audio_devices.cpp +++ b/modules/juce_audio_devices/juce_audio_devices.cpp @@ -248,7 +248,7 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wunused-parameter", "-Wshadow-field", "-Wsign-conversion", "-Wswitch-enum") -#include "oboe/oboe.h" +#include JUCE_END_IGNORE_WARNINGS_GCC_LIKE #include "native/juce_Oboe_android.cpp" diff --git a/modules/juce_audio_devices/juce_audio_devices.h b/modules/juce_audio_devices/juce_audio_devices.h index 47cd3becb..ebc352913 100644 --- a/modules/juce_audio_devices/juce_audio_devices.h +++ b/modules/juce_audio_devices/juce_audio_devices.h @@ -55,11 +55,11 @@ license: ISC minimumCppStandard: 17 - dependencies: juce_audio_basics, juce_events + dependencies: juce_audio_basics juce_events osxFrameworks: CoreAudio CoreMIDI AudioToolbox iosFrameworks: CoreAudio CoreMIDI AudioToolbox AVFoundation linuxPackages: alsa - androidDeps: oboe + androidDeps: oboe_library mingwLibs: winmm END_JUCE_MODULE_DECLARATION diff --git a/modules/yup_gui/native/yup_Windowing_glfw.cpp b/modules/yup_gui/native/yup_Windowing_glfw.cpp index bd25e62ef..fe8833821 100644 --- a/modules/yup_gui/native/yup_Windowing_glfw.cpp +++ b/modules/yup_gui/native/yup_Windowing_glfw.cpp @@ -913,7 +913,7 @@ void* GLFWComponentNative::getNativeHandle() const return reinterpret_cast (glfwGetX11Window (window)); #elif JUCE_ANDROID - return reinterpret_cast (glfwGetAndroidApp (window)->window); + return reinterpret_cast (glfwGetAndroidApp()->window); #else return nullptr; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 32d7d05a0..26fcc180d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -53,7 +53,7 @@ yup_standalone_app ( TARGET_NAME ${target_name} TARGET_VERSION ${target_version} TARGET_IDE_GROUP "Tests" - CONSOLE + TARGET_CONSOLE ON DEFINITIONS JUCE_USE_CURL=0 MODULES diff --git a/thirdparty/oboe/oboe.cpp b/thirdparty/oboe_library/oboe_library.cpp similarity index 99% rename from thirdparty/oboe/oboe.cpp rename to thirdparty/oboe_library/oboe_library.cpp index b778da446..49db76e13 100644 --- a/thirdparty/oboe/oboe.cpp +++ b/thirdparty/oboe_library/oboe_library.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -#include "oboe.h" +#include "oboe_library.h" #if defined(ANDROID) || defined(__ANDROID__) #include "upstream/src/common/Utilities.cpp" diff --git a/thirdparty/oboe/oboe.h b/thirdparty/oboe_library/oboe_library.h similarity index 96% rename from thirdparty/oboe/oboe.h rename to thirdparty/oboe_library/oboe_library.h index b35cda820..06506c10c 100644 --- a/thirdparty/oboe/oboe.h +++ b/thirdparty/oboe_library/oboe_library.h @@ -24,8 +24,8 @@ BEGIN_JUCE_MODULE_DECLARATION - ID: oboe - vendor: oboe + ID: oboe_library + vendor: google version: 1.8.0 name: Android low level audio library description: Oboe is an open-source C++ library designed to help build high-performance audio apps on Android. diff --git a/thirdparty/oboe/upstream/include/oboe/AudioStream.h b/thirdparty/oboe_library/upstream/include/oboe/AudioStream.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/AudioStream.h rename to thirdparty/oboe_library/upstream/include/oboe/AudioStream.h diff --git a/thirdparty/oboe/upstream/include/oboe/AudioStreamBase.h b/thirdparty/oboe_library/upstream/include/oboe/AudioStreamBase.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/AudioStreamBase.h rename to thirdparty/oboe_library/upstream/include/oboe/AudioStreamBase.h diff --git a/thirdparty/oboe/upstream/include/oboe/AudioStreamBuilder.h b/thirdparty/oboe_library/upstream/include/oboe/AudioStreamBuilder.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/AudioStreamBuilder.h rename to thirdparty/oboe_library/upstream/include/oboe/AudioStreamBuilder.h diff --git a/thirdparty/oboe/upstream/include/oboe/AudioStreamCallback.h b/thirdparty/oboe_library/upstream/include/oboe/AudioStreamCallback.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/AudioStreamCallback.h rename to thirdparty/oboe_library/upstream/include/oboe/AudioStreamCallback.h diff --git a/thirdparty/oboe/upstream/include/oboe/Definitions.h b/thirdparty/oboe_library/upstream/include/oboe/Definitions.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/Definitions.h rename to thirdparty/oboe_library/upstream/include/oboe/Definitions.h diff --git a/thirdparty/oboe/upstream/include/oboe/FifoBuffer.h b/thirdparty/oboe_library/upstream/include/oboe/FifoBuffer.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/FifoBuffer.h rename to thirdparty/oboe_library/upstream/include/oboe/FifoBuffer.h diff --git a/thirdparty/oboe/upstream/include/oboe/FifoControllerBase.h b/thirdparty/oboe_library/upstream/include/oboe/FifoControllerBase.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/FifoControllerBase.h rename to thirdparty/oboe_library/upstream/include/oboe/FifoControllerBase.h diff --git a/thirdparty/oboe/upstream/include/oboe/FullDuplexStream.h b/thirdparty/oboe_library/upstream/include/oboe/FullDuplexStream.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/FullDuplexStream.h rename to thirdparty/oboe_library/upstream/include/oboe/FullDuplexStream.h diff --git a/thirdparty/oboe/upstream/include/oboe/LatencyTuner.h b/thirdparty/oboe_library/upstream/include/oboe/LatencyTuner.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/LatencyTuner.h rename to thirdparty/oboe_library/upstream/include/oboe/LatencyTuner.h diff --git a/thirdparty/oboe/upstream/include/oboe/Oboe.h b/thirdparty/oboe_library/upstream/include/oboe/Oboe.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/Oboe.h rename to thirdparty/oboe_library/upstream/include/oboe/Oboe.h diff --git a/thirdparty/oboe/upstream/include/oboe/OboeExtensions.h b/thirdparty/oboe_library/upstream/include/oboe/OboeExtensions.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/OboeExtensions.h rename to thirdparty/oboe_library/upstream/include/oboe/OboeExtensions.h diff --git a/thirdparty/oboe/upstream/include/oboe/ResultWithValue.h b/thirdparty/oboe_library/upstream/include/oboe/ResultWithValue.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/ResultWithValue.h rename to thirdparty/oboe_library/upstream/include/oboe/ResultWithValue.h diff --git a/thirdparty/oboe/upstream/include/oboe/StabilizedCallback.h b/thirdparty/oboe_library/upstream/include/oboe/StabilizedCallback.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/StabilizedCallback.h rename to thirdparty/oboe_library/upstream/include/oboe/StabilizedCallback.h diff --git a/thirdparty/oboe/upstream/include/oboe/Utilities.h b/thirdparty/oboe_library/upstream/include/oboe/Utilities.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/Utilities.h rename to thirdparty/oboe_library/upstream/include/oboe/Utilities.h diff --git a/thirdparty/oboe/upstream/include/oboe/Version.h b/thirdparty/oboe_library/upstream/include/oboe/Version.h similarity index 100% rename from thirdparty/oboe/upstream/include/oboe/Version.h rename to thirdparty/oboe_library/upstream/include/oboe/Version.h diff --git a/thirdparty/oboe/upstream/src/aaudio/AAudioExtensions.h b/thirdparty/oboe_library/upstream/src/aaudio/AAudioExtensions.h similarity index 100% rename from thirdparty/oboe/upstream/src/aaudio/AAudioExtensions.h rename to thirdparty/oboe_library/upstream/src/aaudio/AAudioExtensions.h diff --git a/thirdparty/oboe/upstream/src/aaudio/AAudioLoader.cpp b/thirdparty/oboe_library/upstream/src/aaudio/AAudioLoader.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/aaudio/AAudioLoader.cpp rename to thirdparty/oboe_library/upstream/src/aaudio/AAudioLoader.cpp diff --git a/thirdparty/oboe/upstream/src/aaudio/AAudioLoader.h b/thirdparty/oboe_library/upstream/src/aaudio/AAudioLoader.h similarity index 100% rename from thirdparty/oboe/upstream/src/aaudio/AAudioLoader.h rename to thirdparty/oboe_library/upstream/src/aaudio/AAudioLoader.h diff --git a/thirdparty/oboe/upstream/src/aaudio/AudioStreamAAudio.cpp b/thirdparty/oboe_library/upstream/src/aaudio/AudioStreamAAudio.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/aaudio/AudioStreamAAudio.cpp rename to thirdparty/oboe_library/upstream/src/aaudio/AudioStreamAAudio.cpp diff --git a/thirdparty/oboe/upstream/src/aaudio/AudioStreamAAudio.h b/thirdparty/oboe_library/upstream/src/aaudio/AudioStreamAAudio.h similarity index 100% rename from thirdparty/oboe/upstream/src/aaudio/AudioStreamAAudio.h rename to thirdparty/oboe_library/upstream/src/aaudio/AudioStreamAAudio.h diff --git a/thirdparty/oboe/upstream/src/common/AdpfWrapper.cpp b/thirdparty/oboe_library/upstream/src/common/AdpfWrapper.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/AdpfWrapper.cpp rename to thirdparty/oboe_library/upstream/src/common/AdpfWrapper.cpp diff --git a/thirdparty/oboe/upstream/src/common/AdpfWrapper.h b/thirdparty/oboe_library/upstream/src/common/AdpfWrapper.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/AdpfWrapper.h rename to thirdparty/oboe_library/upstream/src/common/AdpfWrapper.h diff --git a/thirdparty/oboe/upstream/src/common/AudioClock.h b/thirdparty/oboe_library/upstream/src/common/AudioClock.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/AudioClock.h rename to thirdparty/oboe_library/upstream/src/common/AudioClock.h diff --git a/thirdparty/oboe/upstream/src/common/AudioSourceCaller.cpp b/thirdparty/oboe_library/upstream/src/common/AudioSourceCaller.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/AudioSourceCaller.cpp rename to thirdparty/oboe_library/upstream/src/common/AudioSourceCaller.cpp diff --git a/thirdparty/oboe/upstream/src/common/AudioSourceCaller.h b/thirdparty/oboe_library/upstream/src/common/AudioSourceCaller.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/AudioSourceCaller.h rename to thirdparty/oboe_library/upstream/src/common/AudioSourceCaller.h diff --git a/thirdparty/oboe/upstream/src/common/AudioStream.cpp b/thirdparty/oboe_library/upstream/src/common/AudioStream.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/AudioStream.cpp rename to thirdparty/oboe_library/upstream/src/common/AudioStream.cpp diff --git a/thirdparty/oboe/upstream/src/common/AudioStreamBuilder.cpp b/thirdparty/oboe_library/upstream/src/common/AudioStreamBuilder.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/AudioStreamBuilder.cpp rename to thirdparty/oboe_library/upstream/src/common/AudioStreamBuilder.cpp diff --git a/thirdparty/oboe/upstream/src/common/DataConversionFlowGraph.cpp b/thirdparty/oboe_library/upstream/src/common/DataConversionFlowGraph.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/DataConversionFlowGraph.cpp rename to thirdparty/oboe_library/upstream/src/common/DataConversionFlowGraph.cpp diff --git a/thirdparty/oboe/upstream/src/common/DataConversionFlowGraph.h b/thirdparty/oboe_library/upstream/src/common/DataConversionFlowGraph.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/DataConversionFlowGraph.h rename to thirdparty/oboe_library/upstream/src/common/DataConversionFlowGraph.h diff --git a/thirdparty/oboe/upstream/src/common/FilterAudioStream.cpp b/thirdparty/oboe_library/upstream/src/common/FilterAudioStream.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/FilterAudioStream.cpp rename to thirdparty/oboe_library/upstream/src/common/FilterAudioStream.cpp diff --git a/thirdparty/oboe/upstream/src/common/FilterAudioStream.h b/thirdparty/oboe_library/upstream/src/common/FilterAudioStream.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/FilterAudioStream.h rename to thirdparty/oboe_library/upstream/src/common/FilterAudioStream.h diff --git a/thirdparty/oboe/upstream/src/common/FixedBlockAdapter.cpp b/thirdparty/oboe_library/upstream/src/common/FixedBlockAdapter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/FixedBlockAdapter.cpp rename to thirdparty/oboe_library/upstream/src/common/FixedBlockAdapter.cpp diff --git a/thirdparty/oboe/upstream/src/common/FixedBlockAdapter.h b/thirdparty/oboe_library/upstream/src/common/FixedBlockAdapter.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/FixedBlockAdapter.h rename to thirdparty/oboe_library/upstream/src/common/FixedBlockAdapter.h diff --git a/thirdparty/oboe/upstream/src/common/FixedBlockReader.cpp b/thirdparty/oboe_library/upstream/src/common/FixedBlockReader.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/FixedBlockReader.cpp rename to thirdparty/oboe_library/upstream/src/common/FixedBlockReader.cpp diff --git a/thirdparty/oboe/upstream/src/common/FixedBlockReader.h b/thirdparty/oboe_library/upstream/src/common/FixedBlockReader.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/FixedBlockReader.h rename to thirdparty/oboe_library/upstream/src/common/FixedBlockReader.h diff --git a/thirdparty/oboe/upstream/src/common/FixedBlockWriter.cpp b/thirdparty/oboe_library/upstream/src/common/FixedBlockWriter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/FixedBlockWriter.cpp rename to thirdparty/oboe_library/upstream/src/common/FixedBlockWriter.cpp diff --git a/thirdparty/oboe/upstream/src/common/FixedBlockWriter.h b/thirdparty/oboe_library/upstream/src/common/FixedBlockWriter.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/FixedBlockWriter.h rename to thirdparty/oboe_library/upstream/src/common/FixedBlockWriter.h diff --git a/thirdparty/oboe/upstream/src/common/LatencyTuner.cpp b/thirdparty/oboe_library/upstream/src/common/LatencyTuner.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/LatencyTuner.cpp rename to thirdparty/oboe_library/upstream/src/common/LatencyTuner.cpp diff --git a/thirdparty/oboe/upstream/src/common/MonotonicCounter.h b/thirdparty/oboe_library/upstream/src/common/MonotonicCounter.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/MonotonicCounter.h rename to thirdparty/oboe_library/upstream/src/common/MonotonicCounter.h diff --git a/thirdparty/oboe/upstream/src/common/OboeDebug.h b/thirdparty/oboe_library/upstream/src/common/OboeDebug.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/OboeDebug.h rename to thirdparty/oboe_library/upstream/src/common/OboeDebug.h diff --git a/thirdparty/oboe/upstream/src/common/OboeExtensions.cpp b/thirdparty/oboe_library/upstream/src/common/OboeExtensions.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/OboeExtensions.cpp rename to thirdparty/oboe_library/upstream/src/common/OboeExtensions.cpp diff --git a/thirdparty/oboe/upstream/src/common/QuirksManager.cpp b/thirdparty/oboe_library/upstream/src/common/QuirksManager.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/QuirksManager.cpp rename to thirdparty/oboe_library/upstream/src/common/QuirksManager.cpp diff --git a/thirdparty/oboe/upstream/src/common/QuirksManager.h b/thirdparty/oboe_library/upstream/src/common/QuirksManager.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/QuirksManager.h rename to thirdparty/oboe_library/upstream/src/common/QuirksManager.h diff --git a/thirdparty/oboe/upstream/src/common/README.md b/thirdparty/oboe_library/upstream/src/common/README.md similarity index 100% rename from thirdparty/oboe/upstream/src/common/README.md rename to thirdparty/oboe_library/upstream/src/common/README.md diff --git a/thirdparty/oboe/upstream/src/common/SourceFloatCaller.cpp b/thirdparty/oboe_library/upstream/src/common/SourceFloatCaller.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/SourceFloatCaller.cpp rename to thirdparty/oboe_library/upstream/src/common/SourceFloatCaller.cpp diff --git a/thirdparty/oboe/upstream/src/common/SourceFloatCaller.h b/thirdparty/oboe_library/upstream/src/common/SourceFloatCaller.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/SourceFloatCaller.h rename to thirdparty/oboe_library/upstream/src/common/SourceFloatCaller.h diff --git a/thirdparty/oboe/upstream/src/common/SourceI16Caller.cpp b/thirdparty/oboe_library/upstream/src/common/SourceI16Caller.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/SourceI16Caller.cpp rename to thirdparty/oboe_library/upstream/src/common/SourceI16Caller.cpp diff --git a/thirdparty/oboe/upstream/src/common/SourceI16Caller.h b/thirdparty/oboe_library/upstream/src/common/SourceI16Caller.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/SourceI16Caller.h rename to thirdparty/oboe_library/upstream/src/common/SourceI16Caller.h diff --git a/thirdparty/oboe/upstream/src/common/SourceI24Caller.cpp b/thirdparty/oboe_library/upstream/src/common/SourceI24Caller.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/SourceI24Caller.cpp rename to thirdparty/oboe_library/upstream/src/common/SourceI24Caller.cpp diff --git a/thirdparty/oboe/upstream/src/common/SourceI24Caller.h b/thirdparty/oboe_library/upstream/src/common/SourceI24Caller.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/SourceI24Caller.h rename to thirdparty/oboe_library/upstream/src/common/SourceI24Caller.h diff --git a/thirdparty/oboe/upstream/src/common/SourceI32Caller.cpp b/thirdparty/oboe_library/upstream/src/common/SourceI32Caller.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/SourceI32Caller.cpp rename to thirdparty/oboe_library/upstream/src/common/SourceI32Caller.cpp diff --git a/thirdparty/oboe/upstream/src/common/SourceI32Caller.h b/thirdparty/oboe_library/upstream/src/common/SourceI32Caller.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/SourceI32Caller.h rename to thirdparty/oboe_library/upstream/src/common/SourceI32Caller.h diff --git a/thirdparty/oboe/upstream/src/common/StabilizedCallback.cpp b/thirdparty/oboe_library/upstream/src/common/StabilizedCallback.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/StabilizedCallback.cpp rename to thirdparty/oboe_library/upstream/src/common/StabilizedCallback.cpp diff --git a/thirdparty/oboe/upstream/src/common/Trace.cpp b/thirdparty/oboe_library/upstream/src/common/Trace.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/Trace.cpp rename to thirdparty/oboe_library/upstream/src/common/Trace.cpp diff --git a/thirdparty/oboe/upstream/src/common/Trace.h b/thirdparty/oboe_library/upstream/src/common/Trace.h similarity index 100% rename from thirdparty/oboe/upstream/src/common/Trace.h rename to thirdparty/oboe_library/upstream/src/common/Trace.h diff --git a/thirdparty/oboe/upstream/src/common/Utilities.cpp b/thirdparty/oboe_library/upstream/src/common/Utilities.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/Utilities.cpp rename to thirdparty/oboe_library/upstream/src/common/Utilities.cpp diff --git a/thirdparty/oboe/upstream/src/common/Version.cpp b/thirdparty/oboe_library/upstream/src/common/Version.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/common/Version.cpp rename to thirdparty/oboe_library/upstream/src/common/Version.cpp diff --git a/thirdparty/oboe/upstream/src/fifo/FifoBuffer.cpp b/thirdparty/oboe_library/upstream/src/fifo/FifoBuffer.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/fifo/FifoBuffer.cpp rename to thirdparty/oboe_library/upstream/src/fifo/FifoBuffer.cpp diff --git a/thirdparty/oboe/upstream/src/fifo/FifoController.cpp b/thirdparty/oboe_library/upstream/src/fifo/FifoController.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/fifo/FifoController.cpp rename to thirdparty/oboe_library/upstream/src/fifo/FifoController.cpp diff --git a/thirdparty/oboe/upstream/src/fifo/FifoController.h b/thirdparty/oboe_library/upstream/src/fifo/FifoController.h similarity index 100% rename from thirdparty/oboe/upstream/src/fifo/FifoController.h rename to thirdparty/oboe_library/upstream/src/fifo/FifoController.h diff --git a/thirdparty/oboe/upstream/src/fifo/FifoControllerBase.cpp b/thirdparty/oboe_library/upstream/src/fifo/FifoControllerBase.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/fifo/FifoControllerBase.cpp rename to thirdparty/oboe_library/upstream/src/fifo/FifoControllerBase.cpp diff --git a/thirdparty/oboe/upstream/src/fifo/FifoControllerIndirect.cpp b/thirdparty/oboe_library/upstream/src/fifo/FifoControllerIndirect.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/fifo/FifoControllerIndirect.cpp rename to thirdparty/oboe_library/upstream/src/fifo/FifoControllerIndirect.cpp diff --git a/thirdparty/oboe/upstream/src/fifo/FifoControllerIndirect.h b/thirdparty/oboe_library/upstream/src/fifo/FifoControllerIndirect.h similarity index 100% rename from thirdparty/oboe/upstream/src/fifo/FifoControllerIndirect.h rename to thirdparty/oboe_library/upstream/src/fifo/FifoControllerIndirect.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/ChannelCountConverter.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/ChannelCountConverter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/ChannelCountConverter.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/ChannelCountConverter.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/ChannelCountConverter.h b/thirdparty/oboe_library/upstream/src/flowgraph/ChannelCountConverter.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/ChannelCountConverter.h rename to thirdparty/oboe_library/upstream/src/flowgraph/ChannelCountConverter.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/ClipToRange.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/ClipToRange.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/ClipToRange.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/ClipToRange.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/ClipToRange.h b/thirdparty/oboe_library/upstream/src/flowgraph/ClipToRange.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/ClipToRange.h rename to thirdparty/oboe_library/upstream/src/flowgraph/ClipToRange.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/FlowGraphNode.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/FlowGraphNode.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/FlowGraphNode.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/FlowGraphNode.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/FlowGraphNode.h b/thirdparty/oboe_library/upstream/src/flowgraph/FlowGraphNode.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/FlowGraphNode.h rename to thirdparty/oboe_library/upstream/src/flowgraph/FlowGraphNode.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/FlowgraphUtilities.h b/thirdparty/oboe_library/upstream/src/flowgraph/FlowgraphUtilities.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/FlowgraphUtilities.h rename to thirdparty/oboe_library/upstream/src/flowgraph/FlowgraphUtilities.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/Limiter.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/Limiter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/Limiter.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/Limiter.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/Limiter.h b/thirdparty/oboe_library/upstream/src/flowgraph/Limiter.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/Limiter.h rename to thirdparty/oboe_library/upstream/src/flowgraph/Limiter.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/ManyToMultiConverter.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/ManyToMultiConverter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/ManyToMultiConverter.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/ManyToMultiConverter.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/ManyToMultiConverter.h b/thirdparty/oboe_library/upstream/src/flowgraph/ManyToMultiConverter.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/ManyToMultiConverter.h rename to thirdparty/oboe_library/upstream/src/flowgraph/ManyToMultiConverter.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/MonoBlend.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/MonoBlend.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/MonoBlend.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/MonoBlend.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/MonoBlend.h b/thirdparty/oboe_library/upstream/src/flowgraph/MonoBlend.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/MonoBlend.h rename to thirdparty/oboe_library/upstream/src/flowgraph/MonoBlend.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/MonoToMultiConverter.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/MonoToMultiConverter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/MonoToMultiConverter.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/MonoToMultiConverter.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/MonoToMultiConverter.h b/thirdparty/oboe_library/upstream/src/flowgraph/MonoToMultiConverter.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/MonoToMultiConverter.h rename to thirdparty/oboe_library/upstream/src/flowgraph/MonoToMultiConverter.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/MultiToManyConverter.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/MultiToManyConverter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/MultiToManyConverter.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/MultiToManyConverter.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/MultiToManyConverter.h b/thirdparty/oboe_library/upstream/src/flowgraph/MultiToManyConverter.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/MultiToManyConverter.h rename to thirdparty/oboe_library/upstream/src/flowgraph/MultiToManyConverter.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/MultiToMonoConverter.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/MultiToMonoConverter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/MultiToMonoConverter.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/MultiToMonoConverter.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/MultiToMonoConverter.h b/thirdparty/oboe_library/upstream/src/flowgraph/MultiToMonoConverter.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/MultiToMonoConverter.h rename to thirdparty/oboe_library/upstream/src/flowgraph/MultiToMonoConverter.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/RampLinear.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/RampLinear.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/RampLinear.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/RampLinear.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/RampLinear.h b/thirdparty/oboe_library/upstream/src/flowgraph/RampLinear.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/RampLinear.h rename to thirdparty/oboe_library/upstream/src/flowgraph/RampLinear.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SampleRateConverter.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SampleRateConverter.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SampleRateConverter.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SampleRateConverter.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SampleRateConverter.h b/thirdparty/oboe_library/upstream/src/flowgraph/SampleRateConverter.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SampleRateConverter.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SampleRateConverter.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SinkFloat.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SinkFloat.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SinkFloat.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SinkFloat.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SinkFloat.h b/thirdparty/oboe_library/upstream/src/flowgraph/SinkFloat.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SinkFloat.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SinkFloat.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SinkI16.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SinkI16.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SinkI16.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SinkI16.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SinkI16.h b/thirdparty/oboe_library/upstream/src/flowgraph/SinkI16.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SinkI16.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SinkI16.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SinkI24.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SinkI24.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SinkI24.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SinkI24.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SinkI24.h b/thirdparty/oboe_library/upstream/src/flowgraph/SinkI24.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SinkI24.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SinkI24.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SinkI32.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SinkI32.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SinkI32.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SinkI32.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SinkI32.h b/thirdparty/oboe_library/upstream/src/flowgraph/SinkI32.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SinkI32.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SinkI32.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SourceFloat.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SourceFloat.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SourceFloat.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SourceFloat.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SourceFloat.h b/thirdparty/oboe_library/upstream/src/flowgraph/SourceFloat.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SourceFloat.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SourceFloat.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SourceI16.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SourceI16.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SourceI16.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SourceI16.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SourceI16.h b/thirdparty/oboe_library/upstream/src/flowgraph/SourceI16.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SourceI16.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SourceI16.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SourceI24.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SourceI24.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SourceI24.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SourceI24.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SourceI24.h b/thirdparty/oboe_library/upstream/src/flowgraph/SourceI24.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SourceI24.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SourceI24.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/SourceI32.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/SourceI32.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SourceI32.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/SourceI32.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/SourceI32.h b/thirdparty/oboe_library/upstream/src/flowgraph/SourceI32.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/SourceI32.h rename to thirdparty/oboe_library/upstream/src/flowgraph/SourceI32.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/HyperbolicCosineWindow.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/HyperbolicCosineWindow.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/HyperbolicCosineWindow.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/HyperbolicCosineWindow.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/IntegerRatio.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/IntegerRatio.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/IntegerRatio.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/IntegerRatio.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/IntegerRatio.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/IntegerRatio.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/IntegerRatio.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/IntegerRatio.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/KaiserWindow.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/KaiserWindow.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/KaiserWindow.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/KaiserWindow.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/LinearResampler.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/LinearResampler.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/LinearResampler.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/LinearResampler.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/LinearResampler.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/LinearResampler.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/LinearResampler.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/LinearResampler.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/MultiChannelResampler.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/MultiChannelResampler.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/MultiChannelResampler.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/MultiChannelResampler.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/MultiChannelResampler.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/MultiChannelResampler.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/MultiChannelResampler.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/MultiChannelResampler.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResampler.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResampler.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResampler.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResampler.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResampler.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResampler.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResampler.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResampler.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResamplerMono.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResamplerMono.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResamplerMono.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResamplerMono.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResamplerMono.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResamplerMono.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResamplerMono.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResamplerMono.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResamplerStereo.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResamplerStereo.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResamplerStereo.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResamplerStereo.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResamplerStereo.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResamplerStereo.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/PolyphaseResamplerStereo.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/PolyphaseResamplerStereo.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/README.md b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/README.md similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/README.md rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/README.md diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/ResamplerDefinitions.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/ResamplerDefinitions.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/ResamplerDefinitions.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/ResamplerDefinitions.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/SincResampler.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/SincResampler.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/SincResampler.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/SincResampler.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/SincResampler.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/SincResampler.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/SincResampler.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/SincResampler.h diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/SincResamplerStereo.cpp b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/SincResamplerStereo.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/SincResamplerStereo.cpp rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/SincResamplerStereo.cpp diff --git a/thirdparty/oboe/upstream/src/flowgraph/resampler/SincResamplerStereo.h b/thirdparty/oboe_library/upstream/src/flowgraph/resampler/SincResamplerStereo.h similarity index 100% rename from thirdparty/oboe/upstream/src/flowgraph/resampler/SincResamplerStereo.h rename to thirdparty/oboe_library/upstream/src/flowgraph/resampler/SincResamplerStereo.h diff --git a/thirdparty/oboe/upstream/src/opensles/AudioInputStreamOpenSLES.cpp b/thirdparty/oboe_library/upstream/src/opensles/AudioInputStreamOpenSLES.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/AudioInputStreamOpenSLES.cpp rename to thirdparty/oboe_library/upstream/src/opensles/AudioInputStreamOpenSLES.cpp diff --git a/thirdparty/oboe/upstream/src/opensles/AudioInputStreamOpenSLES.h b/thirdparty/oboe_library/upstream/src/opensles/AudioInputStreamOpenSLES.h similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/AudioInputStreamOpenSLES.h rename to thirdparty/oboe_library/upstream/src/opensles/AudioInputStreamOpenSLES.h diff --git a/thirdparty/oboe/upstream/src/opensles/AudioOutputStreamOpenSLES.cpp b/thirdparty/oboe_library/upstream/src/opensles/AudioOutputStreamOpenSLES.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/AudioOutputStreamOpenSLES.cpp rename to thirdparty/oboe_library/upstream/src/opensles/AudioOutputStreamOpenSLES.cpp diff --git a/thirdparty/oboe/upstream/src/opensles/AudioOutputStreamOpenSLES.h b/thirdparty/oboe_library/upstream/src/opensles/AudioOutputStreamOpenSLES.h similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/AudioOutputStreamOpenSLES.h rename to thirdparty/oboe_library/upstream/src/opensles/AudioOutputStreamOpenSLES.h diff --git a/thirdparty/oboe/upstream/src/opensles/AudioStreamBuffered.cpp b/thirdparty/oboe_library/upstream/src/opensles/AudioStreamBuffered.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/AudioStreamBuffered.cpp rename to thirdparty/oboe_library/upstream/src/opensles/AudioStreamBuffered.cpp diff --git a/thirdparty/oboe/upstream/src/opensles/AudioStreamBuffered.h b/thirdparty/oboe_library/upstream/src/opensles/AudioStreamBuffered.h similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/AudioStreamBuffered.h rename to thirdparty/oboe_library/upstream/src/opensles/AudioStreamBuffered.h diff --git a/thirdparty/oboe/upstream/src/opensles/AudioStreamOpenSLES.cpp b/thirdparty/oboe_library/upstream/src/opensles/AudioStreamOpenSLES.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/AudioStreamOpenSLES.cpp rename to thirdparty/oboe_library/upstream/src/opensles/AudioStreamOpenSLES.cpp diff --git a/thirdparty/oboe/upstream/src/opensles/AudioStreamOpenSLES.h b/thirdparty/oboe_library/upstream/src/opensles/AudioStreamOpenSLES.h similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/AudioStreamOpenSLES.h rename to thirdparty/oboe_library/upstream/src/opensles/AudioStreamOpenSLES.h diff --git a/thirdparty/oboe/upstream/src/opensles/EngineOpenSLES.cpp b/thirdparty/oboe_library/upstream/src/opensles/EngineOpenSLES.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/EngineOpenSLES.cpp rename to thirdparty/oboe_library/upstream/src/opensles/EngineOpenSLES.cpp diff --git a/thirdparty/oboe/upstream/src/opensles/EngineOpenSLES.h b/thirdparty/oboe_library/upstream/src/opensles/EngineOpenSLES.h similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/EngineOpenSLES.h rename to thirdparty/oboe_library/upstream/src/opensles/EngineOpenSLES.h diff --git a/thirdparty/oboe/upstream/src/opensles/OpenSLESUtilities.cpp b/thirdparty/oboe_library/upstream/src/opensles/OpenSLESUtilities.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/OpenSLESUtilities.cpp rename to thirdparty/oboe_library/upstream/src/opensles/OpenSLESUtilities.cpp diff --git a/thirdparty/oboe/upstream/src/opensles/OpenSLESUtilities.h b/thirdparty/oboe_library/upstream/src/opensles/OpenSLESUtilities.h similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/OpenSLESUtilities.h rename to thirdparty/oboe_library/upstream/src/opensles/OpenSLESUtilities.h diff --git a/thirdparty/oboe/upstream/src/opensles/OutputMixerOpenSLES.cpp b/thirdparty/oboe_library/upstream/src/opensles/OutputMixerOpenSLES.cpp similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/OutputMixerOpenSLES.cpp rename to thirdparty/oboe_library/upstream/src/opensles/OutputMixerOpenSLES.cpp diff --git a/thirdparty/oboe/upstream/src/opensles/OutputMixerOpenSLES.h b/thirdparty/oboe_library/upstream/src/opensles/OutputMixerOpenSLES.h similarity index 100% rename from thirdparty/oboe/upstream/src/opensles/OutputMixerOpenSLES.h rename to thirdparty/oboe_library/upstream/src/opensles/OutputMixerOpenSLES.h