From 4979b7733ed53ede1cdb91a27ba74ead3625848e Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Sun, 2 Sep 2018 17:00:23 +0200 Subject: [PATCH] cpu_features: fix clang, set cast-align to warning Change -Wcast-align from error to warning for clang compiler by adding the -Wno-error=cast-align compiler flag. Fixes #881 --- external/cpu_features/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/external/cpu_features/CMakeLists.txt b/external/cpu_features/CMakeLists.txt index 9893e50..b978e97 100644 --- a/external/cpu_features/CMakeLists.txt +++ b/external/cpu_features/CMakeLists.txt @@ -5,6 +5,10 @@ project(CpuFeatures VERSION 0.1.0) # ANBOX allow to build in our more strict build environment set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=switch-default -Wno-error=unused-parameter -Wno-error=overflow") +if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=cast-align") +endif() + # Default Build Type to be Release if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING