From 848d880eb3c9f120a2d8eb338c283449dd4fb514 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Wed, 26 Oct 2022 12:56:44 +0400 Subject: [PATCH] Fix Warning as error for Android ARM64 build (#13638) * Fix Warning as error for Android ARM64 build * Fixed preprocessing build * Fixed cmake options * Try to fix android build * Disable some warning --- cmake/developer_package/compile_flags/os_flags.cmake | 8 ++++---- src/common/preprocessing/CMakeLists.txt | 1 - src/core/tests/CMakeLists.txt | 1 + thirdparty/json/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index a92a8f9c371..642e5f83b9e 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -141,19 +141,19 @@ macro(ie_arm_neon_optimization_flags flags) # nothing elseif(ANDROID) if(ANDROID_ABI STREQUAL "arm64-v8a") - set(${flags} -mfpu=neon) + set(${flags} -mfpu=neon -Wno-unused-command-line-argument) elseif(ANDROID_ABI STREQUAL "armeabi-v7a-hard with NEON") - set(${flags} -march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon) + set(${flags} -march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon -Wno-unused-command-line-argument) elseif((ANDROID_ABI STREQUAL "armeabi-v7a with NEON") OR (ANDROID_ABI STREQUAL "armeabi-v7a" AND DEFINED CMAKE_ANDROID_ARM_NEON AND CMAKE_ANDROID_ARM_NEON)) - set(${flags} -march=armv7-a -mfloat-abi=softfp -mfpu=neon) + set(${flags} -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wno-unused-command-line-argument) endif() else() if(AARCH64) set(${flags} -O2 -ftree-vectorize) elseif(ARM) - set(${flags} -mfpu=neon) + set(${flags} -mfpu=neon -Wno-unused-command-line-argument) endif() endif() endmacro() diff --git a/src/common/preprocessing/CMakeLists.txt b/src/common/preprocessing/CMakeLists.txt index 45edb045203..09c708dd99d 100644 --- a/src/common/preprocessing/CMakeLists.txt +++ b/src/common/preprocessing/CMakeLists.txt @@ -97,7 +97,6 @@ if(ENABLE_GAPI_PREPROCESSING) add_library(${TARGET_NAME}_obj OBJECT ${LIBRARY_SRC} ${LIBRARY_HEADERS}) - ie_faster_build(${TARGET_NAME}_obj UNITY) target_compile_definitions(${TARGET_NAME}_obj PRIVATE diff --git a/src/core/tests/CMakeLists.txt b/src/core/tests/CMakeLists.txt index 8441840e9da..1aa64a26bd1 100644 --- a/src/core/tests/CMakeLists.txt +++ b/src/core/tests/CMakeLists.txt @@ -14,6 +14,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") ie_add_compiler_flags(/wd4305) ie_add_compiler_flags(/wd4244) ie_add_compiler_flags(/wd4267) + ie_add_compiler_flags(/wd4834) endif() add_definitions(-DSERIALIZED_ZOO=\"${TEST_MODEL_ZOO}/core/models\") diff --git a/thirdparty/json/CMakeLists.txt b/thirdparty/json/CMakeLists.txt index e3d3816eeba..7e86eaa2048 100644 --- a/thirdparty/json/CMakeLists.txt +++ b/thirdparty/json/CMakeLists.txt @@ -15,7 +15,7 @@ add_subdirectory(nlohmann_json_schema_validator EXCLUDE_FROM_ALL) set_target_properties(nlohmann_json_schema_validator PROPERTIES FOLDER thirdparty) if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) - target_compile_options(nlohmann_json_schema_validator PRIVATE -Wno-switch -Wno-deprecated-declarations) + target_compile_options(nlohmann_json_schema_validator PRIVATE -Wno-switch -Wno-deprecated-declarations -Wno-range-loop-construct) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_options(nlohmann_json_schema_validator PRIVATE /wd4996) endif()