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)
This commit is contained in:
Rick V 2019-05-05 21:33:19 -05:00
parent d749ebeb39
commit 7788d6ec3c
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465
3 changed files with 17 additions and 17 deletions

View File

@ -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($<$<COMPILE_LANGUAGE:C>:-Wno-bad-function-cast>)
add_compile_options($<$<COMPILE_LANGUAGE:C>:-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()

View File

@ -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()

View File

@ -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)