multitoolchain drifting
This commit is contained in:
parent
f722ee0cf6
commit
6c20ba38d9
3 changed files with 75 additions and 68 deletions
111
CMakeLists.txt
111
CMakeLists.txt
|
@ -7,82 +7,75 @@ if(_CMP)
|
||||||
add_definitions("-DSOSC_DEBUG")
|
add_definitions("-DSOSC_DEBUG")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
string(COMPARE EQUAL ${SOSC_BUILD_TARGET} CLIENT _CMP)
|
||||||
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
|
if(_CMP)
|
||||||
#if(CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
set(CMAKE_CXX_FLAGS
|
##################
|
||||||
"${CMAKE_CXX_FLAGS} -std=c++11 -s USE_SDL=2")
|
## CLIENT BUILD ##
|
||||||
set(CMAKE_CXX_FLAGS
|
##################
|
||||||
"${CMAKE_CXX_FLAGS} --preload-file ../resources/client")
|
|
||||||
set(CMAKE_CXX_FLAGS
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS
|
||||||
|
"${CMAKE_CXX_FLAGS} -s USE_SDL=2 --preload-file ../resources/client")
|
||||||
|
set(CMAKE_CXX_FLAGS
|
||||||
"${CMAKE_CXX_FLAGS} --shell-file ../src/client/shell.html")
|
"${CMAKE_CXX_FLAGS} --shell-file ../src/client/shell.html")
|
||||||
set(CMAKE_CXX_FLAGS
|
set(CMAKE_CXX_FLAGS
|
||||||
"${CMAKE_CXX_FLAGS} -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"bmp\"]'")
|
"${CMAKE_CXX_FLAGS} -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"bmp\"]'")
|
||||||
set(CMAKE_CXX_FLAGS
|
set(CMAKE_CXX_FLAGS
|
||||||
"${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_main\", \"_resize_context\"]'")
|
"${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_main\", \"_resize_context\"]'")
|
||||||
set(CMAKE_CXX_FLAGS
|
set(CMAKE_CXX_FLAGS
|
||||||
"${CMAKE_CXX_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\"]'")
|
"${CMAKE_CXX_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\"]'")
|
||||||
#endif()
|
|
||||||
|
|
||||||
set(CMAKE_EXECUTABLE_SUFFIX ".html")
|
set(CMAKE_EXECUTABLE_SUFFIX ".html")
|
||||||
|
|
||||||
## CLIENT BUILD ##
|
file(GLOB_RECURSE client_src
|
||||||
|
|
||||||
#find_package(OpenGL REQUIRED)
|
|
||||||
#find_package(GLEW REQUIRED)
|
|
||||||
#find_package(SDL2 REQUIRED)
|
|
||||||
#find_package(SDL2_image REQUIRED)
|
|
||||||
|
|
||||||
file(GLOB_RECURSE client_src
|
|
||||||
#"src/common/*.hpp"
|
#"src/common/*.hpp"
|
||||||
#"src/common/*.cpp"
|
#"src/common/*.cpp"
|
||||||
"src/client/*.hpp"
|
"src/client/*.hpp"
|
||||||
"src/client/*.cpp"
|
"src/client/*.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(client ${client_src})
|
add_executable(client ${client_src})
|
||||||
|
|
||||||
target_include_directories(client
|
target_include_directories(client
|
||||||
#PRIVATE ${PROJECT_SOURCE_DIR}/src/common
|
#PRIVATE ${PROJECT_SOURCE_DIR}/src/common
|
||||||
PRIVATE ${PROJECT_SOURCE_DIR}/src/client
|
PRIVATE ${PROJECT_SOURCE_DIR}/src/client
|
||||||
PRIVATE ${PROJECT_SOURCE_DIR}/include/client)
|
PRIVATE ${PROJECT_SOURCE_DIR}/include/client)
|
||||||
#PRIVATE ${OPENGL_INCLUDE_DIR}
|
|
||||||
#PRIVATE ${GLEW_INCLUDE_DIR}
|
|
||||||
#PRIVATE ${SDL2_INCLUDE_DIR}
|
|
||||||
#PRIVATE ${SDL2_IMAGE_INCLUDE_DIR})
|
|
||||||
#target_link_libraries(client
|
|
||||||
# ${OPENGL_LIBRARIES}
|
|
||||||
# ${GLEW_LIBRARY}
|
|
||||||
# ${SDL2_LIBRARY}
|
|
||||||
# ${SDL2_IMAGE_LIBRARIES})
|
|
||||||
install(TARGETS client RUNTIME DESTINATION bin/client)
|
|
||||||
|
|
||||||
## SERVER BUILD ##
|
install(TARGETS client RUNTIME DESTINATION bin/client)
|
||||||
|
else()
|
||||||
|
|
||||||
#file(GLOB_RECURSE server_src
|
##################
|
||||||
# "src/common/*.hpp"
|
## SERVER BUILD ##
|
||||||
# "src/common/*.cpp"
|
##################
|
||||||
# "src/server/*.hpp"
|
|
||||||
# "src/server/*.cpp"
|
|
||||||
# "src/server/*.c"
|
|
||||||
# "src/server/*.h"
|
|
||||||
#)
|
|
||||||
|
|
||||||
#add_executable(server ${server_src})
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
#target_include_directories(server
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
# PRIVATE ${PROJECT_SOURCE_DIR}/src/common
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
# PRIVATE ${PROJECT_SOURCE_DIR}/src/server)
|
endif()
|
||||||
#install(TARGETS server RUNTIME DESTINATION bin/server)
|
|
||||||
|
|
||||||
## COMMON LIBRARIES ##
|
file(GLOB_RECURSE server_src
|
||||||
|
"src/common/*.hpp"
|
||||||
|
"src/common/*.cpp"
|
||||||
|
"src/server/*.hpp"
|
||||||
|
"src/server/*.cpp"
|
||||||
|
"src/server/*.c"
|
||||||
|
"src/server/*.h"
|
||||||
|
)
|
||||||
|
|
||||||
#if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
add_executable(server ${server_src})
|
||||||
# target_link_libraries(server wsock32 ws2_32)
|
target_include_directories(server
|
||||||
# target_link_libraries(client wsock32 ws2_32)
|
PRIVATE ${PROJECT_SOURCE_DIR}/src/common
|
||||||
#elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
PRIVATE ${PROJECT_SOURCE_DIR}/src/server)
|
||||||
# target_link_libraries(server dl pthread nsl resolv)
|
install(TARGETS server RUNTIME DESTINATION bin/server)
|
||||||
# target_link_libraries(client dl pthread nsl resolv)
|
|
||||||
#else()
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||||
# target_link_libraries(server dl pthread socket nsl resolv)
|
target_link_libraries(server wsock32 ws2_32)
|
||||||
# target_link_libraries(client dl pthread socket nsl resolv)
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
#endif()
|
target_link_libraries(server dl pthread nsl resolv)
|
||||||
|
else()
|
||||||
|
target_link_libraries(server dl pthread socket nsl resolv)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
14
src/web/index.html
Normal file
14
src/web/index.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>client</title>
|
||||||
|
<style type="text/css">
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript" src="script.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
0
src/web/script.js
Normal file
0
src/web/script.js
Normal file
Loading…
Reference in a new issue