summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2021-01-08 10:55:23 +0100
committerJordan Augé <jordan.auge+fdio@cisco.com>2021-01-08 10:55:23 +0100
commitd4b47775c6e31117b7aaa6032220c37105eed492 (patch)
tree7b093f9be431bb49f5e9ceb6994f0a073e6a46fa
parentd80f1502caa07e77593f4e632a0028e450a6b0d8 (diff)
[HICN-670] -Wno-c99-designator does not existing in order clang versions
Change-Id: Ia56f828fe086be6b01e5366f601fcd0a3066ff2f Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
-rw-r--r--apps/http-proxy/CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/http-proxy/CMakeLists.txt b/apps/http-proxy/CMakeLists.txt
index 5901c31f7..e7bcb551a 100644
--- a/apps/http-proxy/CMakeLists.txt
+++ b/apps/http-proxy/CMakeLists.txt
@@ -14,7 +14,17 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c99-designator")
+# -Wno-c99-designator issue
+#
+# Unsure about version for which this was introduced
+# clang version 9.0.8 (no flag), 11.0.5 (ndk22, flag)
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE clang_full_version_string )
+ string (REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string})
+ if (CLANG_VERSION_STRING VERSION_GREATER 11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c99-designator")
+ endif()
+endif()
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}