Skip to content

Commit 69a533a

Browse files
committed
Fix incorrect include when building against.
Wrong winsock header was included on targets linking to gamespy.
1 parent 112ee06 commit 69a533a

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.14...4.0)
22

33
# Use packagename_ROOT for FindPackage.
44
if(POLICY CMP0074)

src/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ if(BUILD_SHARED_LIBS)
7979
set_target_properties(gamespy PROPERTIES ARCHIVE_OUTPUT_NAME gamespy_import WINDOWS_EXPORT_ALL_SYMBOLS ON)
8080
endif()
8181

82+
# Handle including sockets library headers for consumers.
83+
if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
84+
if(GS_WINSOCK2)
85+
target_compile_definitions(gamespy INTERFACE GSI_WINSOCK2)
86+
endif()
87+
endif()
88+
8289
if(GS_BUILD_TESTS)
8390
add_executable(chattest chat/chatc/chatc.c)
8491
target_link_libraries(chattest gamespy)

0 commit comments

Comments
 (0)