authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-20 16:20:30-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-21 20:16:08-07:00
log5ec9be0b03b17c849078c2a3f652a86e723fd1c2
tree621d6d2ec2fe932c77a03100f13c2de3d5fbd3f8
parent69d1ea769b9718d565097deb4ba9a870fc6d7636

CMake: choose native CPU instead of baseline by default


2 files changed, 4 insertions(+), 4 deletions(-)

CMakeLists.txt+3-3
......@@ -121,7 +121,7 @@ string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_INCLUDE_DIR_ESCAPED "${ZIG_LIBC_
121121option(ZIG_TEST_COVERAGE "Build Zig with test coverage instrumentation" OFF)
122122
123123set(ZIG_TARGET_TRIPLE "native" CACHE STRING "arch-os-abi to output binaries for")
124set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries for")
124set(ZIG_TARGET_MCPU "native" CACHE STRING "-mcpu parameter to output binaries for")
125125set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")
126126set(ZIG_SINGLE_THREADED off CACHE BOOL "limit the zig compiler to use only 1 thread")
127127set(ZIG_OMIT_STAGE2 off CACHE BOOL "omit the stage2 backend from stage1")
......@@ -1036,8 +1036,8 @@ set(BUILD_ZIG2_ARGS
10361036 "-femit-bin=${ZIG2_OBJECT}"
10371037 -fcompiler-rt
10381038 ${ZIG_SINGLE_THREADED_ARG}
1039 -target "${ZIG_TARGET_TRIPLE}"
1040 -mcpu "${ZIG_TARGET_MCPU}"
1039 -target native
1040 -mcpu native
10411041 -lc
10421042 --pkg-begin build_options "${ZIG_CONFIG_ZIG_OUT}"
10431043 --pkg-end
src/stage1/zig0.cpp+1-1
......@@ -186,7 +186,7 @@ static Error target_parse_triple(struct ZigTarget *target, const char *zig_tripl
186186 if (zig_triple == nullptr) {
187187 get_native_target(target);
188188
189 if (mcpu == nullptr) {
189 if (mcpu == nullptr || strcmp(mcpu, "native") == 0) {
190190 target->llvm_cpu_name = ZigLLVMGetHostCPUName();
191191 target->llvm_cpu_features = ZigLLVMGetNativeFeatures();
192192 } else if (strcmp(mcpu, "baseline") == 0) {