Skip to content

Commit a863092

Browse files
committed
cmake: only set -march if the architecture is known
Do not set an empty -march= option when attempting to build on an unknown system. We only print a warning when attempting to build on an unknown system, so this should not expect it is never built for an unknown system.
1 parent 1c0d3bf commit a863092

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/DaemonFlags.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,9 @@ elseif (NOT NACL)
642642

643643
option(USE_CPU_GENERIC_ARCHITECTURE "Enforce generic -march and -mtune compiler options" ON)
644644
if (USE_CPU_GENERIC_ARCHITECTURE)
645-
try_c_cxx_flag_werror(MARCH "-march=${GCC_GENERIC_ARCH}")
645+
if (GCC_GENERIC_ARCH)
646+
try_c_cxx_flag_werror(MARCH "-march=${GCC_GENERIC_ARCH}")
647+
endif()
646648

647649
if (GCC_GENERIC_TUNE)
648650
try_c_cxx_flag_werror(MTUNE "-mtune=${GCC_GENERIC_TUNE}")

0 commit comments

Comments
 (0)