From d203ad2b7a6970bdb8e3a802da4259f52f4f0492 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 8 Jul 2024 14:59:43 +0100 Subject: [PATCH] problem: using `-errwarn` on non-Sun systems solution: only use `-errwarn` on SunPro systems For example, using Clang on Alpine, this just results in build spam, and the option is incorrectly passed through to ld, which trys to use use it (`-e`) as an entrypoint, i.e: ```bash [ 28%] Building CXX object CMakeFiles/local_lat.dir/perf/local_lat.cpp.o clang++: warning: -e rrwarn=%all: 'linker' input unused [-Wunused-command-line-argument] [ 29%] Linking CXX executable bin/local_lat /usr/bin/ld: warning: cannot find entry symbol rrwarn=%all; defaulting to 0000000000000cf0 [ 29%] Built target local_lat ``` --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18594938..b16bdb80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -705,7 +705,7 @@ if(LIBZMQ_WERROR) zmq_check_cxx_flag_prepend("/WX") else() zmq_check_cxx_flag_prepend("-Werror") - if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") zmq_check_cxx_flag_prepend("-errwarn=%all") endif() endif()