From 7788d6ec3c14c70e88054efd79e564137569807a Mon Sep 17 00:00:00 2001 From: Rick V Date: Sun, 5 May 2019 21:33:19 -0500 Subject: [PATCH] fix windows lto stuff remains for now since native builds work (cherry picked from commit 37814472af5e7c35d514bae16d19b08050765d52) i'm not porting the UNIX-tier cppfs thing (cherry picked from commit d6edbd789534d4fd0bce6c8c2418347cd80bebdb) none of this had to be specified directly ffs (cherry picked from commit 5dbefa7131a6fe0b2006c90ecdba7e466fdd1ecc) stop breaking shit reee (cherry picked from commit 14be89902ccc75a7fc21863593da393ca976d0d4) --- cmake/win32.cmake | 30 +++++++++++++++--------------- llarp/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmake/win32.cmake b/cmake/win32.cmake index d47e178d2..b97f7859c 100644 --- a/cmake/win32.cmake +++ b/cmake/win32.cmake @@ -1,21 +1,6 @@ enable_language(RC) set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lshlwapi") -get_filename_component(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-windows.c ABSOLUTE) -get_filename_component(EV_SRC "llarp/ev/ev_win32.cpp" ABSOLUTE) -add_definitions(-DWIN32_LEAN_AND_MEAN -DWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500) -set(EXE_LIBS ${STATIC_LIB} ws2_32 iphlpapi) - -if(RELEASE_MOTTO) - add_definitions(-DLLARP_RELEASE_MOTTO="${RELEASE_MOTTO}") - add_definitions(-DRELEASE_MOTTO=${RELEASE_MOTTO}) -endif() - -if (NOT STATIC_LINK_RUNTIME 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_RUNTIME in cmake options") -endif() - if(NOT MSVC_VERSION) add_compile_options($<$:-Wno-bad-function-cast>) add_compile_options($<$:-Wno-cast-function-type>) @@ -25,3 +10,18 @@ if(NOT MSVC_VERSION) add_compile_options(-fno-ident) set(FS_LIB stdc++fs) endif() + +get_filename_component(LIBTUNTAP_IMPL ${TT_ROOT}/tuntap-windows.c ABSOLUTE) +get_filename_component(EV_SRC "llarp/ev/ev_win32.cpp" ABSOLUTE) +add_definitions(-DWIN32_LEAN_AND_MEAN -DWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500) +set(EXE_LIBS ${STATIC_LIB} ${FS_LIB} ws2_32 iphlpapi) + +if(RELEASE_MOTTO) + add_definitions(-DLLARP_RELEASE_MOTTO="${RELEASE_MOTTO}") + add_definitions(-DRELEASE_MOTTO=${RELEASE_MOTTO}) +endif() + +if (NOT STATIC_LINK_RUNTIME 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_RUNTIME in cmake options") +endif() \ No newline at end of file diff --git a/llarp/CMakeLists.txt b/llarp/CMakeLists.txt index 0a72936bd..9be04139a 100644 --- a/llarp/CMakeLists.txt +++ b/llarp/CMakeLists.txt @@ -251,7 +251,7 @@ if(WITH_SHARED) set(LIBS ${LIBS} Threads::Threads) target_link_libraries(${SHARED_LIB} PUBLIC ${ABYSS_LIB} ${CRYPTOGRAPHY_LIB} ${UTIL_LIB} ${PLATFORM_LIB} ${LIBS}) if (WIN32) - target_link_libraries(${SHARED_LIB} PUBLIC ws2_32 iphlpapi) + target_link_libraries(${SHARED_LIB} PUBLIC ${FS_LIB} ws2_32 iphlpapi) else() install(TARGETS ${SHARED_LIB} LIBRARY DESTINATION lib) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 23ab7d2ea..d22e68713 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -67,5 +67,5 @@ if(NOT WIN32) target_link_libraries(${TEST_EXE} PUBLIC absl::variant) else() target_sources(${TEST_EXE} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/win32/test.rc") - target_link_libraries(${TEST_EXE} PUBLIC ws2_32 iphlpapi shlwapi) + target_link_libraries(${TEST_EXE} PUBLIC ${FS_LIB} ws2_32 iphlpapi shlwapi) endif(NOT WIN32)