Skip to content

Commit cbe119e

Browse files
committed
cmake: improve compiler support
1 parent 596020e commit cbe119e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmake/DaemonFlags.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,13 @@ elseif (NOT NACL)
438438

439439
if (ARCH STREQUAL "amd64")
440440
# K8 or EM64T minimum: AMD Athlon 64 ClawHammer, Intel Xeon Nocona, Intel Pentium 4 model F (Prescott revision EO), VIA Nano.
441-
set(GCC_GENERIC_ARCH "x86-64")
441+
if ("${DAEMON_CXX_COMPILER_NAME}" STREQUAL "ICC")
442+
set(GCC_GENERIC_ARCH "pentium4")
443+
elseif ("${DAEMON_CXX_COMPILER_NAME}" STREQUAL "Zig")
444+
set(GCC_GENERIC_ARCH "x86_64")
445+
else()
446+
set(GCC_GENERIC_ARCH "x86-64")
447+
endif()
442448
set(GCC_GENERIC_TUNE "generic")
443449
elseif (ARCH STREQUAL "i686")
444450
# P6 or K6 minimum: Intel Pentium Pro, AMD K6, Via Cyrix III, Via C3.
@@ -468,6 +474,10 @@ elseif (NOT NACL)
468474
message(WARNING "Unknown architecture ${ARCH}")
469475
endif()
470476

477+
if ("${DAEMON_CXX_COMPILER_NAME}" STREQUAL "Zig")
478+
unset(GCC_GENERIC_TUNE)
479+
endif()
480+
471481
option(USE_CPU_GENERIC_ARCHITECTURE "Enforce generic -march and -mtune compiler options" ON)
472482
if (USE_CPU_GENERIC_ARCHITECTURE)
473483
try_c_cxx_flag_werror(MARCH "-march=${GCC_GENERIC_ARCH}")

0 commit comments

Comments
 (0)