mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-02 07:45:26 +00:00
Add temporary cmake mods to make project compile on macOS, add ifdefs in 'Compat.h' for target darwin
This commit is contained in:
parent
a7db41ebaa
commit
08a62261e7
@ -16,7 +16,13 @@ include_directories("${PROJECT_SOURCE_DIR}/deps/sol2/include")
|
|||||||
include_directories("${PROJECT_SOURCE_DIR}/deps/cpp-httplib")
|
include_directories("${PROJECT_SOURCE_DIR}/deps/cpp-httplib")
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/deps")
|
include_directories("${PROJECT_SOURCE_DIR}/deps")
|
||||||
|
|
||||||
add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT)
|
add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT __linux)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
set(LUA_INCLUDE_DIR /usr/local/Cellar/lua@5.3/5.3.6/include/lua5.3)
|
||||||
|
set(LUA_LIBRARIES lua)
|
||||||
|
link_directories(/usr/local/Cellar/lua@5.3/5.3.6/lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# this has to happen before sentry, so that crashpad on windows links with these settings.
|
# this has to happen before sentry, so that crashpad on windows links with these settings.
|
||||||
@ -99,7 +105,7 @@ target_include_directories(BeamMP-Server PUBLIC
|
|||||||
"${CMAKE_CURRENT_SOURCE_DIR}/commandline")
|
"${CMAKE_CURRENT_SOURCE_DIR}/commandline")
|
||||||
|
|
||||||
message(STATUS "Looking for Lua")
|
message(STATUS "Looking for Lua")
|
||||||
find_package(Lua REQUIRED VERSION 5.3)
|
# find_package(Lua REQUIRED VERSION 5.3)
|
||||||
target_include_directories(BeamMP-Server PUBLIC
|
target_include_directories(BeamMP-Server PUBLIC
|
||||||
${LUA_INCLUDE_DIR}
|
${LUA_INCLUDE_DIR}
|
||||||
${CURL_INCLUDE_DIRS}
|
${CURL_INCLUDE_DIRS}
|
||||||
@ -109,7 +115,7 @@ target_include_directories(BeamMP-Server PUBLIC
|
|||||||
|
|
||||||
message(STATUS "Looking for SSL")
|
message(STATUS "Looking for SSL")
|
||||||
|
|
||||||
find_package(OpenSSL REQUIRED)
|
# find_package(OpenSSL REQUIRED)
|
||||||
|
|
||||||
target_link_libraries(BeamMP-Server sol2::sol2 ${LUA_LIBRARIES})
|
target_link_libraries(BeamMP-Server sol2::sol2 ${LUA_LIBRARIES})
|
||||||
message(STATUS "CURL IS ${CURL_LIBRARIES}")
|
message(STATUS "CURL IS ${CURL_LIBRARIES}")
|
||||||
|
@ -19,6 +19,23 @@ inline void CloseSocketProper(int TheSocket) {
|
|||||||
}
|
}
|
||||||
#endif // unix
|
#endif // unix
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <termios.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
using SOCKET = int;
|
||||||
|
using DWORD = unsigned long;
|
||||||
|
using PDWORD = unsigned long*;
|
||||||
|
using LPDWORD = unsigned long*;
|
||||||
|
char _getch();
|
||||||
|
inline void CloseSocketProper(int TheSocket) {
|
||||||
|
shutdown(TheSocket, SHUT_RDWR);
|
||||||
|
close(TheSocket);
|
||||||
|
}
|
||||||
|
#endif // unix
|
||||||
|
|
||||||
// ======================= WIN32 =======================
|
// ======================= WIN32 =======================
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -33,6 +50,6 @@ inline void CloseSocketProper(SOCKET TheSocket) {
|
|||||||
|
|
||||||
// ======================= OTHER =======================
|
// ======================= OTHER =======================
|
||||||
|
|
||||||
#if !defined(WIN32) && !defined(__unix)
|
#if !defined(WIN32) && !defined(__unix) && !defined(__APPLE__)
|
||||||
#error "OS not supported"
|
#error "OS not supported"
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user