Skip to content

Commit 4fcf123

Browse files
authored
[juce] Fix cross builds, cleanup (microsoft#42615)
1 parent 8476a6d commit 4fcf123

19 files changed

+490
-195
lines changed

ports/juce/0002-build-linux-find_packages.patch

Lines changed: 0 additions & 37 deletions
This file was deleted.

ports/juce/0003-build-forward-vcpkg-toolchain.patch

Lines changed: 0 additions & 32 deletions
This file was deleted.

ports/juce/0004-install-paths.patch

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,5 @@ index 4262a9852..a46b51f1a 100644
1919
install(EXPORT VST3_HELPER NAMESPACE juce:: DESTINATION "${JUCE_INSTALL_DESTINATION}")
2020
endif()
2121
endif()
22-
diff --git a/extras/Build/juceaide/CMakeLists.txt b/extras/Build/juceaide/CMakeLists.txt
23-
index f4cdba7f7..fab57fdb4 100644
24-
--- a/extras/Build/juceaide/CMakeLists.txt
25-
+++ b/extras/Build/juceaide/CMakeLists.txt
26-
@@ -164,7 +164,7 @@ else()
27-
28-
add_executable(juce::juceaide ALIAS juceaide)
29-
30-
- set(JUCE_TOOL_INSTALL_DIR "bin/JUCE-${JUCE_VERSION}" CACHE STRING
31-
+ set(JUCE_TOOL_INSTALL_DIR "tools/juce" CACHE STRING
32-
"The location, relative to the install prefix, where juceaide will be installed")
33-
34-
install(PROGRAMS "${imported_location}" DESTINATION "${JUCE_TOOL_INSTALL_DIR}")
35-
diff --git a/CMakeLists.txt b/CMakeLists.txt
36-
index a46b51f1a..38f863a3e 100644
37-
--- a/CMakeLists.txt
38-
+++ b/CMakeLists.txt
39-
@@ -137,7 +137,7 @@
40-
VERSION ${JUCE_VERSION}
41-
COMPATIBILITY ExactVersion)
42-
43-
-set(JUCE_INSTALL_DESTINATION "lib/cmake/JUCE-${JUCE_VERSION}" CACHE STRING
44-
+set(JUCE_INSTALL_DESTINATION "share/juce" CACHE STRING
45-
"The location, relative to the install prefix, where the JUCE config file will be installed")
46-
47-
set(JUCE_MODULE_PATH "include/JUCE-${JUCE_VERSION}/modules")
4822
--
4923
2.34.1

ports/juce/devendor-oboe.diff

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/extras/Build/CMake/JUCEModuleSupport.cmake b/extras/Build/CMake/JUCEModuleSupport.cmake
2+
index afefe2d..2dd2ecf 100644
3+
--- a/extras/Build/CMake/JUCEModuleSupport.cmake
4+
+++ b/extras/Build/CMake/JUCEModuleSupport.cmake
5+
@@ -603,8 +603,10 @@ function(juce_add_module module_path)
6+
endif()
7+
8+
if((${module_name} STREQUAL "juce_audio_devices") AND (CMAKE_SYSTEM_NAME STREQUAL "Android"))
9+
- add_subdirectory("${module_path}/native/oboe")
10+
- target_link_libraries(${module_name} INTERFACE oboe)
11+
+ find_path(JUCE_OBOE_INCLUDE_DIR NAMES oboe/Oboe.h REQUIRED)
12+
+ target_include_directories(${module_name} INTERFACE "${JUCE_OBOE_INCLUDE_DIR}")
13+
+ find_library(JUCE_OBOE_LIBRARY NAMES oboe REQUIRED)
14+
+ target_link_libraries(${module_name} INTERFACE "${JUCE_OBOE_LIBRARY}" log OpenSLES)
15+
endif()
16+
17+
if((${module_name} STREQUAL "juce_opengl") AND (CMAKE_SYSTEM_NAME STREQUAL "Android"))

ports/juce/gcc-has-builtin.diff

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/modules/juce_graphics/juce_graphics_Harfbuzz.cpp b/modules/juce_graphics/juce_graphics_Harfbuzz.cpp
2+
index a491af9..44e934a 100644
3+
--- a/modules/juce_graphics/juce_graphics_Harfbuzz.cpp
4+
+++ b/modules/juce_graphics/juce_graphics_Harfbuzz.cpp
5+
@@ -84,7 +84,6 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations",
6+
// -Wexpansion-to-defined on gcc 7. There's no way to turn that warning off
7+
// locally, so we sidestep it.
8+
#if ! defined(__has_builtin) && defined(__GNUC__) && __GNUC__ >= 5
9+
- #define __has_builtin(x) 1
10+
#endif
11+
12+
#include <utility>

ports/juce/install-extras.diff

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/extras/CMakeLists.txt b/extras/CMakeLists.txt
2+
index 7f5555e..539f1cb 100644
3+
--- a/extras/CMakeLists.txt
4+
+++ b/extras/CMakeLists.txt
5+
@@ -35,5 +35,14 @@ add_subdirectory(AudioPerformanceTest)
6+
add_subdirectory(AudioPluginHost)
7+
add_subdirectory(BinaryBuilder)
8+
add_subdirectory(NetworkGraphicsDemo)
9+
+if(NOT ANDROID AND NOT IOS)
10+
add_subdirectory(Projucer)
11+
+endif()
12+
add_subdirectory(UnitTestRunner)
13+
+
14+
+file(GLOB tools RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
15+
+foreach(tool IN LISTS tools)
16+
+ if(TARGET "${tool}")
17+
+ install(TARGETS "${tool}" DESTINATION "${JUCE_TOOL_INSTALL_DIR}")
18+
+ endif()
19+
+endforeach()

ports/juce/juceaide.diff

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 49d85c6..76209f5 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -1,3 +1,5 @@
6+
+# Save cmake input for nested juceaide build
7+
+get_cmake_property(vcpkg_input_vars CACHE_VARIABLES)
8+
# ==============================================================================
9+
#
10+
# This file is part of the JUCE framework.
11+
@@ -142,7 +144,10 @@ set(JUCE_INSTALL_DESTINATION "lib/cmake/JUCE-${JUCE_VERSION}" CACHE STRING
12+
13+
set(JUCE_MODULE_PATH "include/JUCE-${JUCE_VERSION}/modules")
14+
set(UTILS_INSTALL_DIR "${JUCE_INSTALL_DESTINATION}")
15+
-set(JUCEAIDE_PATH "${JUCE_TOOL_INSTALL_DIR}/${JUCE_JUCEAIDE_NAME}")
16+
+set(JUCEAIDE_PATH "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/juce/${JUCE_JUCEAIDE_NAME}")
17+
+if(WITH_JUCEAIDE)
18+
+ set(JUCEAIDE_PATH "${WITH_JUCEAIDE}")
19+
+endif()
20+
configure_package_config_file("${JUCE_CMAKE_UTILS_DIR}/JUCEConfig.cmake.in"
21+
"${JUCE_BINARY_DIR}/JUCEConfig.cmake"
22+
PATH_VARS UTILS_INSTALL_DIR JUCEAIDE_PATH JUCE_MODULE_PATH
23+
diff --git a/extras/Build/juceaide/CMakeLists.txt b/extras/Build/juceaide/CMakeLists.txt
24+
index 651aa53..9ff0fba 100644
25+
--- a/extras/Build/juceaide/CMakeLists.txt
26+
+++ b/extras/Build/juceaide/CMakeLists.txt
27+
@@ -55,12 +55,16 @@ if(JUCE_BUILD_HELPER_TOOLS)
28+
juce::juce_recommended_lto_flags
29+
juce::juce_recommended_warning_flags)
30+
31+
- set_target_properties(juceaide PROPERTIES
32+
- MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
33+
34+
export(TARGETS juceaide
35+
NAMESPACE juce_tools::
36+
FILE "${JUCE_BINARY_DIR}/JUCEToolsExport.cmake")
37+
+
38+
+elseif(WITH_JUCEAIDE)
39+
+ add_executable(juceaide IMPORTED GLOBAL)
40+
+ set_target_properties(juceaide PROPERTIES IMPORTED_LOCATION "${WITH_JUCEAIDE}")
41+
+ add_executable(juce::juceaide ALIAS juceaide)
42+
+
43+
else()
44+
message(STATUS "Configuring juceaide")
45+
46+
@@ -111,13 +115,18 @@ else()
47+
set(ENV{CMAKE_GENERATOR_PLATFORM} "${CMAKE_HOST_SYSTEM_PROCESSOR}")
48+
endif()
49+
50+
+ set(options "")
51+
+ list(REMOVE_ITEM vcpkg_input_vars "JUCE_BUILD_EXTRAS")
52+
+ foreach(var IN LISTS vcpkg_input_vars)
53+
+ list(APPEND options "-D${var}=$CACHE{${var}}")
54+
+ endforeach()
55+
# Looks like we're bootstrapping, reinvoke CMake
56+
execute_process(COMMAND "${CMAKE_COMMAND}"
57+
"."
58+
"-B${JUCE_BINARY_DIR}/tools"
59+
"-G${CMAKE_GENERATOR}"
60+
"-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}"
61+
- "-DCMAKE_BUILD_TYPE=Debug"
62+
+ ${options}
63+
"-DJUCE_BUILD_HELPER_TOOLS=ON"
64+
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
65+
WORKING_DIRECTORY "${JUCE_SOURCE_DIR}"
66+
@@ -133,7 +142,7 @@ else()
67+
68+
execute_process(COMMAND "${CMAKE_COMMAND}"
69+
--build "${JUCE_BINARY_DIR}/tools"
70+
- --config Debug
71+
+ --target juceaide
72+
OUTPUT_VARIABLE command_output
73+
ERROR_VARIABLE command_output
74+
RESULT_VARIABLE result_variable)
75+
@@ -148,7 +157,7 @@ else()
76+
include("${JUCE_BINARY_DIR}/tools/JUCEToolsExport.cmake")
77+
78+
add_executable(juceaide IMPORTED GLOBAL)
79+
- get_target_property(imported_location juce_tools::juceaide IMPORTED_LOCATION_DEBUG)
80+
+ get_target_property(imported_location juce_tools::juceaide IMPORTED_LOCATION_RELEASE)
81+
set_target_properties(juceaide PROPERTIES IMPORTED_LOCATION "${imported_location}")
82+
83+
add_executable(juce::juceaide ALIAS juceaide)

ports/juce/missing-modules.diff

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/extras/Build/CMake/JUCEConfig.cmake.in b/extras/Build/CMake/JUCEConfig.cmake.in
2+
index c0c1eef..03a09ef 100644
3+
--- a/extras/Build/CMake/JUCEConfig.cmake.in
4+
+++ b/extras/Build/CMake/JUCEConfig.cmake.in
5+
@@ -39,6 +39,7 @@ include("@PACKAGE_UTILS_INSTALL_DIR@/JUCEUtils.cmake")
6+
7+
set(_juce_modules
8+
juce_analytics
9+
+ juce_animation
10+
juce_audio_basics
11+
juce_audio_devices
12+
juce_audio_formats
13+
@@ -55,6 +56,7 @@ set(_juce_modules
14+
juce_gui_basics
15+
juce_gui_extra
16+
juce_javascript
17+
+ juce_midi_ci
18+
juce_opengl
19+
juce_osc
20+
juce_product_unlocking

0 commit comments

Comments
 (0)