authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2018-09-30 01:34:38-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-30 09:27:53-04:00
loge6446dfc86e42ccea93760d99cf4b421265cfb0e
treed6b15feb293476da5f0ec0caa76e7ccc7b81288f
parent1428ef3b07eba5a414b30973b117f3c8328c727c

fixed native target detection


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

CMakeLists.txt+3
......@@ -211,6 +211,9 @@ else()
211211 set(ZIG_LLD_COMPILE_FLAGS "-std=c++11 -D_CRT_SECURE_NO_WARNINGS /w")
212212 else()
213213 set(ZIG_LLD_COMPILE_FLAGS "-std=c++11 -fno-exceptions -fno-rtti -Wno-comment")
214 if(MINGW)
215 set(ZIG_LLD_COMPILE_FLAGS "${ZIG_LLD_COMPILE_FLAGS} -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO -Wno-pedantic-ms-format")
216 endif()
214217 endif()
215218 set_target_properties(embedded_lld_lib PROPERTIES
216219 COMPILE_FLAGS ${ZIG_LLD_COMPILE_FLAGS}
src/zig_llvm.cpp+1-1
......@@ -712,7 +712,7 @@ void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *su
712712 ZigLLVM_ObjectFormatType *oformat)
713713{
714714 char *native_triple = LLVMGetDefaultTargetTriple();
715 Triple triple(native_triple);
715 Triple triple(Triple::normalize(native_triple));
716716
717717 *arch_type = (ZigLLVM_ArchType)triple.getArch();
718718 *sub_arch_type = (ZigLLVM_SubArchType)triple.getSubArch();