multitoolchain drifting

This commit is contained in:
Alec Obradovich 2018-09-17 14:29:56 -05:00 committed by malloc
parent f722ee0cf6
commit 6c20ba38d9
3 changed files with 75 additions and 68 deletions

View file

@ -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")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} --preload-file ../resources/client")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} --shell-file ../src/client/shell.html")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"bmp\"]'")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_main\", \"_resize_context\"]'")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\"]'")
#endif()
set(CMAKE_EXECUTABLE_SUFFIX ".html") ##################
## CLIENT BUILD ##
##################
## CLIENT BUILD ## set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#find_package(OpenGL REQUIRED) set(CMAKE_CXX_FLAGS
#find_package(GLEW REQUIRED) "${CMAKE_CXX_FLAGS} -s USE_SDL=2 --preload-file ../resources/client")
#find_package(SDL2 REQUIRED) set(CMAKE_CXX_FLAGS
#find_package(SDL2_image REQUIRED) "${CMAKE_CXX_FLAGS} --shell-file ../src/client/shell.html")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"bmp\"]'")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_main\", \"_resize_context\"]'")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\"]'")
file(GLOB_RECURSE client_src set(CMAKE_EXECUTABLE_SUFFIX ".html")
#"src/common/*.hpp"
#"src/common/*.cpp"
"src/client/*.hpp"
"src/client/*.cpp"
)
add_executable(client ${client_src}) file(GLOB_RECURSE client_src
#"src/common/*.hpp"
#"src/common/*.cpp"
"src/client/*.hpp"
"src/client/*.cpp"
)
target_include_directories(client add_executable(client ${client_src})
#PRIVATE ${PROJECT_SOURCE_DIR}/src/common
PRIVATE ${PROJECT_SOURCE_DIR}/src/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 ## target_include_directories(client
#PRIVATE ${PROJECT_SOURCE_DIR}/src/common
PRIVATE ${PROJECT_SOURCE_DIR}/src/client
PRIVATE ${PROJECT_SOURCE_DIR}/include/client)
#file(GLOB_RECURSE server_src install(TARGETS client RUNTIME DESTINATION bin/client)
# "src/common/*.hpp" else()
# "src/common/*.cpp"
# "src/server/*.hpp"
# "src/server/*.cpp"
# "src/server/*.c"
# "src/server/*.h"
#)
#add_executable(server ${server_src}) ##################
#target_include_directories(server ## SERVER BUILD ##
# PRIVATE ${PROJECT_SOURCE_DIR}/src/common ##################
# PRIVATE ${PROJECT_SOURCE_DIR}/src/server)
#install(TARGETS server RUNTIME DESTINATION bin/server)
## COMMON LIBRARIES ## if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
#if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") file(GLOB_RECURSE server_src
# target_link_libraries(server wsock32 ws2_32) "src/common/*.hpp"
# target_link_libraries(client wsock32 ws2_32) "src/common/*.cpp"
#elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") "src/server/*.hpp"
# target_link_libraries(server dl pthread nsl resolv) "src/server/*.cpp"
# target_link_libraries(client dl pthread nsl resolv) "src/server/*.c"
#else() "src/server/*.h"
# target_link_libraries(server dl pthread socket nsl resolv) )
# target_link_libraries(client dl pthread socket nsl resolv)
#endif() add_executable(server ${server_src})
target_include_directories(server
PRIVATE ${PROJECT_SOURCE_DIR}/src/common
PRIVATE ${PROJECT_SOURCE_DIR}/src/server)
install(TARGETS server RUNTIME DESTINATION bin/server)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(server wsock32 ws2_32)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
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
View 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
View file