Skip to content

Commit

Permalink
Update nanosockets/CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Jan 27, 2023
1 parent c41fc07 commit c74a65b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
27 changes: 6 additions & 21 deletions contrib/nanosockets/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.1)
project(nanosockets C)

set(NANOSOCKETS_STATIC "0" CACHE BOOL "Create a static library")
set(NANOSOCKETS_SHARED "0" CACHE BOOL "Create a shared library")

if (MSYS OR MINGW)
set(CMAKE_C_FLAGS "-static")
set(CMAKE_C_FLAGS "-static")

add_definitions(-DWINVER=0x0601)
add_definitions(-D_WIN32_WINNT=0x0601)
endif()

if (NANOSOCKETS_STATIC)
add_library(nanosockets_static STATIC nanosockets.c ${SOURCES})

if (NOT UNIX)
target_link_libraries(nanosockets_static ws2_32)
SET_TARGET_PROPERTIES(nanosockets_static PROPERTIES PREFIX "")
endif()
endif()

if (NANOSOCKETS_SHARED)
add_definitions(-DNANOSOCKETS_DLL)
add_library(nanosockets SHARED nanosockets.c ${SOURCES})
add_library(nanosockets STATIC nanosockets.c ${SOURCES})

if (NOT UNIX)
target_link_libraries(nanosockets ws2_32)
SET_TARGET_PROPERTIES(nanosockets PROPERTIES PREFIX "")
endif()
if (NOT UNIX)
target_link_libraries(nanosockets ws2_32)
SET_TARGET_PROPERTIES(nanosockets PROPERTIES PREFIX "")
endif()
2 changes: 1 addition & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ target_link_libraries(pioneer-core PUBLIC
profiler
lz4
fmt::fmt
nanosockets_static)
nanosockets)

0 comments on commit c74a65b

Please sign in to comment.