|
|
|
@ -93,14 +93,12 @@ endif()
|
|
|
|
|
if (WOW64_CROSS_COMPILE OR WIN64_CROSS_COMPILE)
|
|
|
|
|
# dynamic linking does this all the time
|
|
|
|
|
if (USING_CLANG) # windows only, also set by toolchain file
|
|
|
|
|
option(NO_LIBGCC "use compiler-rt instead" OFF)
|
|
|
|
|
option(NO_LIBGCC "use libunwind+compiler-rt instead, must already be installed in mingw-w64 sysroot" OFF)
|
|
|
|
|
add_compile_options(-Wno-unused-command-line-argument -Wno-c++11-narrowing)
|
|
|
|
|
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-bad-function-cast>)
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-multiple-definition")
|
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition")
|
|
|
|
|
if (NO_LIBGCC)
|
|
|
|
|
set(CMAKE_CXX_STANDARD_LIBRARIES "-lgcc_eh ${CMAKE_CXX_STANDARD_LIBRARIES}")
|
|
|
|
|
set(CMAKE_C_STANDARD_LIBRARIES "-lgcc_eh ${CMAKE_C_STANDARD_LIBRARIES}")
|
|
|
|
|
set(CMAKE_CXX_STANDARD_LIBRARIES "-lunwind -lpsapi ${CMAKE_CXX_STANDARD_LIBRARIES}")
|
|
|
|
|
set(CMAKE_C_STANDARD_LIBRARIES "-lunwind -lpsapi ${CMAKE_C_STANDARD_LIBRARIES}")
|
|
|
|
|
endif(NO_LIBGCC)
|
|
|
|
|
else()
|
|
|
|
|
# found it. this is GNU only
|
|
|
|
@ -141,7 +139,7 @@ find_package(Threads REQUIRED)
|
|
|
|
|
if(STATIC_LINK_RUNTIME)
|
|
|
|
|
add_compile_options(-static)
|
|
|
|
|
if(USING_CLANG)
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libstdc++ -pthread" )
|
|
|
|
|
else()
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive" )
|
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
|