From d4b47775c6e31117b7aaa6032220c37105eed492 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Fri, 8 Jan 2021 10:55:23 +0100 Subject: [HICN-670] -Wno-c99-designator does not existing in order clang versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia56f828fe086be6b01e5366f601fcd0a3066ff2f Signed-off-by: Jordan Augé --- apps/http-proxy/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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} -- cgit 1.2.3-korg