Skip to content

Commit 5320285

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 ec27f15 commit 5320285

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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)