From f3bd3ff651e579e306d8856171607c8277eed30b Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 13 Dec 2024 08:19:10 +0100 Subject: [PATCH] Fixup --- ports/juce/juceaide.diff | 102 +++++++++++++++++++++++---------------- versions/j-/juce.json | 2 +- 2 files changed, 61 insertions(+), 43 deletions(-) diff --git a/ports/juce/juceaide.diff b/ports/juce/juceaide.diff index 321556a20b8bf8..cf8ad9b13b99b3 100644 --- a/ports/juce/juceaide.diff +++ b/ports/juce/juceaide.diff @@ -1,59 +1,28 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 49d85c6..4045a7e 100644 +index 49d85c6..400b0e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -142,7 +142,11 @@ set(JUCE_INSTALL_DESTINATION "lib/cmake/JUCE-${JUCE_VERSION}" CACHE STRING - +@@ -1,3 +1,5 @@ ++# Save cmake input for nested juceaide build ++get_cmake_property(vcpkg_input_vars CACHE_VARIABLES) + # ============================================================================== + # + # This file is part of the JUCE framework. +@@ -143,6 +145,9 @@ set(JUCE_INSTALL_DESTINATION "lib/cmake/JUCE-${JUCE_VERSION}" CACHE STRING set(JUCE_MODULE_PATH "include/JUCE-${JUCE_VERSION}/modules") set(UTILS_INSTALL_DIR "${JUCE_INSTALL_DESTINATION}") --set(JUCEAIDE_PATH "${JUCE_TOOL_INSTALL_DIR}/${JUCE_JUCEAIDE_NAME}") + set(JUCEAIDE_PATH "${JUCE_TOOL_INSTALL_DIR}/${JUCE_JUCEAIDE_NAME}") +if(WITH_JUCEAIDE) + set(JUCEAIDE_PATH "${WITH_JUCEAIDE}") -+else() -+ set(JUCEAIDE_PATH "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/juce/juceaide${CMAKE_EXECUTABLE_SUFFIX}") +endif() configure_package_config_file("${JUCE_CMAKE_UTILS_DIR}/JUCEConfig.cmake.in" "${JUCE_BINARY_DIR}/JUCEConfig.cmake" PATH_VARS UTILS_INSTALL_DIR JUCEAIDE_PATH JUCE_MODULE_PATH -diff --git a/extras/Build/CMake/JUCEUtils.cmake b/extras/Build/CMake/JUCEUtils.cmake -index 757193f..5a948b8 100644 ---- a/extras/Build/CMake/JUCEUtils.cmake -+++ b/extras/Build/CMake/JUCEUtils.cmake -@@ -575,11 +575,7 @@ function(_juce_execute_juceaide) - message(FATAL_ERROR "The juceaide target does not exist") - endif() - -- get_target_property(juceaide_location juce::juceaide IMPORTED_LOCATION) -- -- if(NOT EXISTS "${juceaide_location}") -- message(FATAL_ERROR "juceaide was imported, but it doesn't exist!") -- endif() -+ set(juceaide_location juce::juceaide) - - execute_process(COMMAND "${juceaide_location}" ${ARGN} - RESULT_VARIABLE result_variable diff --git a/extras/Build/juceaide/CMakeLists.txt b/extras/Build/juceaide/CMakeLists.txt -index 651aa53..839c500 100644 +index 651aa53..07b30a9 100644 --- a/extras/Build/juceaide/CMakeLists.txt +++ b/extras/Build/juceaide/CMakeLists.txt -@@ -35,9 +35,15 @@ - # simulator if we're targeting iOS or Android, we reinvoke cmake here and build juceaide during the - # configuration stage of the outer project. - --if(JUCE_BUILD_HELPER_TOOLS) -+if(WITH_JUCEAIDE) -+ add_executable(juceaide IMPORTED GLOBAL) -+ set_target_properties(juceaide PROPERTIES IMPORTED_LOCATION "${WITH_JUCEAIDE}") -+ add_executable(juce::juceaide ALIAS juceaide) -+elseif(1) - # Build the tool for the current system - juce_add_console_app(juceaide _NO_RESOURCERC) -+ install(TARGETS juceaide DESTINATION "${JUCE_TOOL_INSTALL_DIR}") -+ add_executable(juce::juceaide ALIAS juceaide) - - target_sources(juceaide PRIVATE Main.cpp) - -@@ -55,8 +61,6 @@ if(JUCE_BUILD_HELPER_TOOLS) +@@ -55,13 +55,11 @@ if(JUCE_BUILD_HELPER_TOOLS) juce::juce_recommended_lto_flags juce::juce_recommended_warning_flags) @@ -62,3 +31,52 @@ index 651aa53..839c500 100644 export(TARGETS juceaide NAMESPACE juce_tools:: + FILE "${JUCE_BINARY_DIR}/JUCEToolsExport.cmake") +-else() ++elseif(0) + message(STATUS "Configuring juceaide") + + if(CMAKE_CROSSCOMPILING) +@@ -111,13 +109,23 @@ else() + set(ENV{CMAKE_GENERATOR_PLATFORM} "${CMAKE_HOST_SYSTEM_PROCESSOR}") + endif() + ++elseif(WITH_JUCEAIDE) ++ add_executable(juceaide IMPORTED GLOBAL) ++ set_target_properties(juceaide PROPERTIES IMPORTED_LOCATION "${WITH_JUCEAIDE}") ++ add_executable(juce::juceaide ALIAS juceaide) ++else() ++ set(options "") ++ list(REMOVE_ITEM vcpkg_input_vars "JUCE_BUILD_EXTRAS") ++ foreach(var IN LISTS vcpkg_input_vars) ++ list(APPEND options "-D${var}=$CACHE{${var}}") ++ endforeach() + # Looks like we're bootstrapping, reinvoke CMake + execute_process(COMMAND "${CMAKE_COMMAND}" + "." + "-B${JUCE_BINARY_DIR}/tools" + "-G${CMAKE_GENERATOR}" + "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}" +- "-DCMAKE_BUILD_TYPE=Debug" ++ ${options} + "-DJUCE_BUILD_HELPER_TOOLS=ON" + "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" + WORKING_DIRECTORY "${JUCE_SOURCE_DIR}" +@@ -133,7 +141,7 @@ else() + + execute_process(COMMAND "${CMAKE_COMMAND}" + --build "${JUCE_BINARY_DIR}/tools" +- --config Debug ++ --target juceaide + OUTPUT_VARIABLE command_output + ERROR_VARIABLE command_output + RESULT_VARIABLE result_variable) +@@ -148,7 +156,7 @@ else() + include("${JUCE_BINARY_DIR}/tools/JUCEToolsExport.cmake") + + add_executable(juceaide IMPORTED GLOBAL) +- get_target_property(imported_location juce_tools::juceaide IMPORTED_LOCATION_DEBUG) ++ get_target_property(imported_location juce_tools::juceaide IMPORTED_LOCATION_RELEASE) + set_target_properties(juceaide PROPERTIES IMPORTED_LOCATION "${imported_location}") + + add_executable(juce::juceaide ALIAS juceaide) diff --git a/versions/j-/juce.json b/versions/j-/juce.json index 333cfd188bd7ef..9a939e15a9fc89 100644 --- a/versions/j-/juce.json +++ b/versions/j-/juce.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "f4586d2002926eac4d884157bedf22ff5b479924", + "git-tree": "676bcdc85524dbd9227f873686e8e60409c8389e", "version": "8.0.4", "port-version": 1 },