From d7da384f69799d6dc1eaf360185ed5c193a747be Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 14 Jul 2021 01:35:18 +0200 Subject: [PATCH] CMake and cross-compilation: restrict CFLAGS=--target to Android (probably to clang) --- client/CMakeLists.txt | 4 +++- client/experimental_lib/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index c7892ba7c..21ebf9efd 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -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) diff --git a/client/experimental_lib/CMakeLists.txt b/client/experimental_lib/CMakeLists.txt index 084259d34..dcf17a367 100644 --- a/client/experimental_lib/CMakeLists.txt +++ b/client/experimental_lib/CMakeLists.txt @@ -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)