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)
pull/591/head
Rick V 5 years ago
parent d749ebeb39
commit 7788d6ec3c
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465

@ -1,10 +1,20 @@
enable_language(RC)
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lshlwapi")
if(NOT MSVC_VERSION)
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-bad-function-cast>)
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-cast-function-type>)
# unlike unix where you get a *single* compiler ID string in .comment
# GNU ld sees fit to merge *all* the .ident sections in object files
# to .r[o]data section one after the other!
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} ws2_32 iphlpapi)
set(EXE_LIBS ${STATIC_LIB} ${FS_LIB} ws2_32 iphlpapi)
if(RELEASE_MOTTO)
add_definitions(-DLLARP_RELEASE_MOTTO="${RELEASE_MOTTO}")
@ -14,14 +24,4 @@ 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>)
# unlike unix where you get a *single* compiler ID string in .comment
# GNU ld sees fit to merge *all* the .ident sections in object files
# to .r[o]data section one after the other!
add_compile_options(-fno-ident)
set(FS_LIB stdc++fs)
endif()
endif()

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

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

Loading…
Cancel
Save