b2cd752
From a5185f2cdf509314970c1b332c5926283f6962e2 Mon Sep 17 00:00:00 2001
b2cd752
From: Mattias Ellert <mattias.ellert@physics.uu.se>
b2cd752
Date: Mon, 22 Jun 2020 09:21:23 +0200
b2cd752
Subject: [PATCH] Fix too aggressive -Werror replacements
b2cd752
b2cd752
The replacements removes the -Werror option for externals, which is
b2cd752
intended. However, it also replaces e.g. -Werror=format-security with
b2cd752
=format-security, which results in compilation failures due to the
b2cd752
unknown option =format-security.
b2cd752
---
b2cd752
 builtins/davix/CMakeLists.txt               | 2 +-
b2cd752
 cmake/modules/SearchInstalledSoftware.cmake | 2 +-
b2cd752
 interpreter/CMakeLists.txt                  | 2 +-
b2cd752
 3 files changed, 3 insertions(+), 3 deletions(-)
b2cd752
b2cd752
diff --git a/builtins/davix/CMakeLists.txt b/builtins/davix/CMakeLists.txt
b2cd752
index 52614ae2e0..c9b291ec45 100644
b2cd752
--- a/builtins/davix/CMakeLists.txt
b2cd752
+++ b/builtins/davix/CMakeLists.txt
b2cd752
@@ -21,7 +21,7 @@ foreach(lib davix neon)
b2cd752
   list(APPEND DAVIX_LIBRARIES ${DAVIX_PREFIX}/lib/${libname})
b2cd752
 endforeach()
b2cd752
 
b2cd752
-string(REPLACE "-Werror" "" DAVIX_CXX_FLAGS ${CMAKE_CXX_FLAGS})
b2cd752
+string(REPLACE "-Werror " "" DAVIX_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
b2cd752
 
b2cd752
 ExternalProject_Add(DAVIX
b2cd752
   URL ${DAVIX_URL}/davix-${DAVIX_VERSION}.tar.gz
b2cd752
diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
b2cd752
index ad63f08cd0..36aa88d8cf 100644
b2cd752
--- a/cmake/modules/SearchInstalledSoftware.cmake
b2cd752
+++ b/cmake/modules/SearchInstalledSoftware.cmake
b2cd752
@@ -9,7 +9,7 @@ include(ExternalProject)
b2cd752
 include(FindPackageHandleStandardArgs)
b2cd752
 
b2cd752
 set(lcgpackages http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources)
b2cd752
-string(REPLACE "-Werror" "" ROOT_EXTERNAL_CXX_FLAGS ${CMAKE_CXX_FLAGS})
b2cd752
+string(REPLACE "-Werror " "" ROOT_EXTERNAL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
b2cd752
 
b2cd752
 macro(find_package)
b2cd752
   if(NOT "${ARGV0}" IN_LIST ROOT_BUILTINS)
b2cd752
diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt
b2cd752
index 0f43893443..1274758410 100644
b2cd752
--- a/interpreter/CMakeLists.txt
b2cd752
+++ b/interpreter/CMakeLists.txt
b2cd752
@@ -140,7 +140,7 @@ if(gcctoolchain)
b2cd752
 endif()
b2cd752
 
b2cd752
 # We will not fix llvm or clang.
b2cd752
-string(REPLACE "-Werror" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
b2cd752
+string(REPLACE "-Werror " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
b2cd752
 
b2cd752
 if(LLVM_SHARED_LINKER_FLAGS)
b2cd752
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LLVM_SHARED_LINKER_FLAGS}")
b2cd752
-- 
b2cd752
2.26.2
b2cd752