Fix build of OpenSSL on Android (#4427)

When passing on CMAKE_<LANG>_COMPILER_TARGET and
CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN it is important that the
selection of those via CMAKE_C_COMPILE_OPTIONS_TARGET/EXTERNAL_TOOLCHAIN
is done without a space inbetween. For example COMPILE_OPTIONS_TARGET is
with clang a simple --target= and so the selected target must follow
without a space, so that we get --target=foo-bar instead of --target=
foo bar, which the compiler does not parse as intended.
This commit is contained in:
Simon Hausmann 2018-10-09 09:36:42 +02:00 committed by Robert Schumacher
parent 8bb061a20c
commit 0e50a41922

View File

@ -36,10 +36,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CFLAGS "-Wno-error=unused-command-line-argument ${CMAKE_C_FLAGS}")
endif()
if(CMAKE_C_COMPILER_TARGET)
set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_TARGET} ${CMAKE_C_COMPILER_TARGET}")
set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}")
endif()
if(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN)
set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} ${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN}")
set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN}")
endif()
if(CMAKE_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT)
set(CFLAGS "${CFLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}")