From 37a9bd768e2e8f9b58d0b7ab105ea8949955883b Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 8 Jun 2021 08:14:57 -0400 Subject: [PATCH] fix linking on win32 for lokinet.dll only apply static link flags for executables --- cmake/win32.cmake | 9 --------- daemon/CMakeLists.txt | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/cmake/win32.cmake b/cmake/win32.cmake index cf9488531..5ba95cf17 100644 --- a/cmake/win32.cmake +++ b/cmake/win32.cmake @@ -29,12 +29,3 @@ if (NOT STATIC_LINK AND NOT MSVC) message("must ship compiler runtime libraries with this build: libwinpthread-1.dll, libgcc_s_dw2-1.dll, and libstdc++-6.dll") message("for release builds, turn on STATIC_LINK in cmake options") endif() - -if (STATIC_LINK) - set(LIBUV_USE_STATIC ON) - if (WOW64_CROSS_COMPILE) - link_libraries( -static-libstdc++ -static-libgcc -static -Wl,--image-base=0x10000,--large-address-aware,--dynamicbase,--pic-executable,-e,_mainCRTStartup,--subsystem,console:5.00 ) - else() - link_libraries( -static-libstdc++ -static-libgcc -static -Wl,--image-base=0x10000,--dynamicbase,--pic-executable,-e,mainCRTStartup ) - endif() -endif() diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index dfd85b7ca..7c6e8a45b 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -33,6 +33,7 @@ endif() foreach(exe lokinet lokinet-vpn lokinet-bootstrap) if(WIN32 AND NOT MSVC_VERSION) target_sources(${exe} PRIVATE ../llarp/win32/version.rc) + target_link_libraries(${exe} PRIVATE -static-libstdc++ -static-libgcc --static -Wl,--pic-executable,-e,mainCRTStartup,--subsystem,console:5.00) target_link_libraries(${exe} PRIVATE ws2_32 iphlpapi) elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") target_link_directories(${exe} PRIVATE /usr/local/lib)