Skip to content

Commit a4ffd2d

Browse files
committed
fix build on linux (stop propagating unwanted flags from game networking sockets)
1 parent 23f7539 commit a4ffd2d

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

externals/gamenetworkingsockets/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@ set_source_files_properties(
3737
TARGET_DIRECTORY GameNetworkingSockets_s
3838
PROPERTIES COMPILE_DEFINITIONS "WIN32_LEAN_AND_MEAN;VC_EXTRALEAN;NOMINMAX"
3939
)
40+
41+
# avoid propagating unwanted flags
42+
add_library(GameNetworkingSockets STATIC dummy.cpp)
43+
target_link_libraries(GameNetworkingSockets PRIVATE GameNetworkingSockets_s)
44+
target_include_directories(GameNetworkingSockets INTERFACE $<TARGET_PROPERTY:GameNetworkingSockets_s,INTERFACE_INCLUDE_DIRECTORIES>)
45+
add_library(GameNetworkingSockets::GameNetworkingSockets ALIAS GameNetworkingSockets)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
void gamenetworkingsockets_dummy_unused_symbol_to_force_cpp_compilation()
2+
{
3+
// do nothing
4+
}

sources/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ target_compile_features(cage-core PUBLIC cxx_std_${CMAKE_CXX_STANDARD})
1212
target_include_directories(cage-core PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
1313
target_link_libraries(cage-core PRIVATE zlib libzstd_static simplefilewatcher fastnoise hsluv png_static cage-jpeg tiff tiffxx tinyexr stb xatlas pmp dualmc dr_libs ogg vorbis vorbisfile vorbisenc samplerate assimp bc7enc_rdo avir quickhull iwasm_static uni-algo cpr)
1414
if (cage_use_steam_sockets)
15-
target_link_libraries(cage-core PRIVATE GameNetworkingSockets_s)
15+
target_link_libraries(cage-core PRIVATE GameNetworkingSockets::GameNetworkingSockets)
1616
target_compile_definitions(cage-core PUBLIC "CAGE_USE_STEAM_SOCKETS")
1717
endif()
1818
target_link_libraries(cage-core PUBLIC unordered_dense plf)

0 commit comments

Comments
 (0)