winsock
This commit is contained in:
parent
fa154b8662
commit
e9b4f88a5c
3 changed files with 19 additions and 9 deletions
|
|
@ -30,9 +30,9 @@ target_compile_definitions(GearSrc PRIVATE _GEARSRC)
|
|||
target_link_libraries(GearSrc PRIVATE ode lz4)
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
target_link_options(GearSrc PRIVATE -static-libgcc -static-libstdc++)
|
||||
target_link_libraries(GearSrc PRIVATE ws2_32)
|
||||
else()
|
||||
target_link_libraries(GearSrc PRIVATE stdc++)
|
||||
target_link_libraries(GearSrc PRIVATE m pthread)
|
||||
target_link_libraries(GearSrc PRIVATE stdc++ m pthread)
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
target_link_libraries(GearSrc PRIVATE dl)
|
||||
|
|
|
|||
|
|
@ -9,11 +9,27 @@
|
|||
#include <GearSrc/Net.h>
|
||||
#include <GearSrc/Physics.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
|
||||
#include <stb_ds.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
static void init_winsock(void){
|
||||
WSADATA wsa;
|
||||
|
||||
WSAStartup(MAKEWORD(1, 1), &wsa);
|
||||
}
|
||||
#endif
|
||||
|
||||
void GSInit(void) {
|
||||
GSVersion version;
|
||||
|
||||
#ifdef _WIN32
|
||||
init_winsock();
|
||||
#endif
|
||||
|
||||
GSVersionGet(&version);
|
||||
|
||||
GSLog(NULL, GSLogInfo, "GearSrc Engine %s", version.string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue