mirror of
https://github.com/ziglang/zig.git
synced 2025-01-31 14:21:14 +00:00
improved CMake file for MinGW
This commit is contained in:
parent
9e11f67f0d
commit
5593c63e12
@ -209,7 +209,7 @@ else()
|
||||
else()
|
||||
set(ZIG_LLD_COMPILE_FLAGS "-std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Wno-comment")
|
||||
if(MINGW)
|
||||
set(ZIG_LLD_COMPILE_FLAGS "${ZIG_LLD_COMPILE_FLAGS} -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO -Wno-pedantic-ms-format")
|
||||
set(ZIG_LLD_COMPILE_FLAGS "${ZIG_LLD_COMPILE_FLAGS} -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO")
|
||||
endif()
|
||||
endif()
|
||||
set_target_properties(embedded_lld_lib PROPERTIES
|
||||
@ -511,19 +511,23 @@ set(OPTIMIZED_C_FLAGS "-std=c99 -O3")
|
||||
|
||||
set(EXE_LDFLAGS " ")
|
||||
if(MSVC)
|
||||
set(EXE_LDFLAGS "/STACK:16777216")
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} /STACK:16777216")
|
||||
elseif(MINGW)
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -Wl,--stack,16777216")
|
||||
endif()
|
||||
|
||||
if(ZIG_STATIC)
|
||||
if(APPLE)
|
||||
set(EXE_LDFLAGS "-static-libgcc -static-libstdc++")
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static-libgcc -static-libstdc++")
|
||||
elseif(MINGW)
|
||||
set(EXE_LDFLAGS "-static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -lwinpthread -lz3 -lz -lgomp -Wl,--no-whole-archive")
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static-libgcc -static-libstdc++ -Wl,-Bstatic, -lwinpthread -lz3 -lz -lgomp")
|
||||
else()
|
||||
set(EXE_LDFLAGS "-static")
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static")
|
||||
endif()
|
||||
else()
|
||||
if(MINGW)
|
||||
set(EXE_LDFLAGS "${EXE_LDFLAGS} -lz3")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ZIG_TEST_COVERAGE)
|
||||
@ -559,11 +563,6 @@ if(NOT MSVC)
|
||||
target_link_libraries(compiler LINK_PUBLIC ${LIBXML2})
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
find_library(Z3_LIBRARIES NAMES z3 z3.dll)
|
||||
target_link_libraries(compiler LINK_PUBLIC ${Z3_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(ZIG_DIA_GUIDS_LIB)
|
||||
target_link_libraries(compiler LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB})
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user