CMake and cross-compilation: restrict CFLAGS=--target to Android (probably to clang)

This commit is contained in:
Philippe Teuwen 2021-07-14 01:35:18 +02:00
parent 9845adfe77
commit d7da384f69
2 changed files with 6 additions and 2 deletions

View file

@ -76,7 +76,9 @@ endif (NOT SKIPPYTHON EQUAL 1)
# If cross-compiled, we need to init source and build.
if (CMAKE_TOOLCHAIN_FILE)
set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
if (ANDROID)
set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
endif (ANDROID)
set(EMBED_READLINE ON)
set(EMBED_BZIP2 ON)
endif (CMAKE_TOOLCHAIN_FILE)

View file

@ -76,7 +76,9 @@ endif (NOT SKIPPYTHON EQUAL 1)
# If cross-compiled, we need to init source and build.
if (CMAKE_TOOLCHAIN_FILE)
set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
if (ANDROID)
set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
endif (ANDROID)
set(EMBED_READLINE ON)
set(EMBED_BZIP2 ON)
endif (CMAKE_TOOLCHAIN_FILE)