added some notes to gear up for the #371 putback by @michael-loki

moved platform-specifc stuff *to* platform specifc lib
removed -Wno-format on windows and *actually* turn on proper format checking
here using compiler-specifc extension for C99
pull/404/head
Rick V 5 years ago
parent aab8167408
commit 61fb9a9c82
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465

@ -29,7 +29,6 @@ endif()
if(WIN32)
set(CMAKE_CXX_STANDARD 17)
ENABLE_LANGUAGE(RC)
add_compile_options(-Wno-format)
else()
set(CMAKE_CXX_STANDARD 14)
endif(WIN32)
@ -41,8 +40,7 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND SHADOW)
message( FATAL_ERROR "shadow-framework is Linux only" )
endif(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND SHADOW)
# might be redundant. Waiting on new 2U blade to spin up new
# lunix box -rick
# might be redundant. -rick
if (STATIC_LINK_RUNTIME AND SHADOW)
message(FATAL_ERROR "the shadow-framework build cannot be linked statically!")
endif(STATIC_LINK_RUNTIME AND SHADOW)
@ -50,7 +48,6 @@ endif(STATIC_LINK_RUNTIME AND SHADOW)
if (WIN32 AND NOT STATIC_LINK_RUNTIME)
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")
#set(STATIC_LINK_RUNTIME ON)
endif(WIN32 AND NOT STATIC_LINK_RUNTIME)
add_subdirectory(vendor/nlohmann)
@ -159,8 +156,8 @@ if(ASAN)
endif(ASAN)
if(SHADOW)
set(WITH_STATIC OFF)
set(WITH_SHARED ON)
add_compile_options(-fPIC)
if("${SHADOW_ROOT}" STREQUAL "")
set(SHADOW_ROOT "$ENV{HOME}/.shadow")
endif("${SHADOW_ROOT}" STREQUAL "")

@ -40,6 +40,7 @@ target_link_libraries(${UTIL_LIB} PUBLIC nlohmann_json::nlohmann_json)
# cut back on fluff
if (NOT WIN32)
target_link_libraries(${UTIL_LIB} PUBLIC absl::optional absl::variant absl::strings absl::hash cppbackport)
# TODO #371: link against absl::synchronization on windows
endif(NOT WIN32)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@ -61,6 +62,15 @@ set(LIB_PLATFORM_SRC
${EV_SRC}
)
if (WIN32)
set(LIB_PLATFORM_SRC
${LIB_PLATFORM_SRC}
win32/win32_inet.c
win32/win32_intrnl.c
win32/win32_upoll.c
)
endif(WIN32)
add_library(${PLATFORM_LIB} STATIC ${LIB_PLATFORM_SRC})
target_link_libraries(${PLATFORM_LIB} PUBLIC ${CRYPTOGRAPHY_LIB} ${UTIL_LIB} libutp Threads::Threads)
@ -75,14 +85,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif()
if(WIN32)
# win32 inline code
get_filename_component(win32_inet win32/win32_inet.c ABSOLUTE)
get_filename_component(win32_intrnl win32/win32_intrnl.c ABSOLUTE)
get_filename_component(win32_upoll win32/win32_upoll.c ABSOLUTE)
target_sources(${PLATFORM_LIB} PUBLIC ${win32_inet} ${win32_intrnl} ${win32_upoll})
target_link_libraries(${PLATFORM_LIB} PUBLIC iphlpapi)
endif()
set(DNSLIB_SRC
dns/dotlokilookup.cpp
dns/dns.cpp

@ -1,3 +1,4 @@
#define __USE_MINGW_ANSI_STDIO 1
#include <dns/name.hpp>
#include <net/net.hpp>

Loading…
Cancel
Save