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

Juceaide: Pass C and CXX flags during configure when not crosscompiling

Similar code was incorrectly removed in
070a6b35e9.

When using CLion to invoke CMake, using a Clang toolchain and Ninja, and
targeting x64, CLion will pass -m64 in CMAKE_C_FLAGS and
CMAKE_CXX_FLAGS. The compilers are passed through to the juceaide build,
but the target arch was not, which meant that the linker attempted to
link x86 libraries, which failed.
This commit is contained in:
reuk 2023-04-17 15:10:39 +01:00
parent 208be3dd5e
commit 5847e3d6a8
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -49,6 +49,8 @@ if(JUCE_BUILD_HELPER_TOOLS)
NAMESPACE juce_tools::
FILE "${JUCE_BINARY_DIR}/JUCEToolsExport.cmake")
else()
set(extra_compiler_flag_arguments)
# If we're building using the NDK, the gradle wrapper will try to inject its own compiler using
# environment variables, which is unfortunate because we really don't want to cross-compile
# juceaide.
@ -97,6 +99,10 @@ else()
if(DEFINED ENV{PATH_ORIG})
set(ENV{PATH} "$ENV{PATH_ORIG}")
endif()
else()
set(extra_compiler_flag_arguments
"-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}"
"-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}")
endif()
message(STATUS "Configuring juceaide")
@ -110,6 +116,7 @@ else()
"-DCMAKE_BUILD_TYPE=Debug"
"-DJUCE_BUILD_HELPER_TOOLS=ON"
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
${extra_compiler_flag_arguments}
WORKING_DIRECTORY "${JUCE_SOURCE_DIR}"
OUTPUT_VARIABLE command_output
ERROR_VARIABLE command_output