BUILD: started to support windows builds

master
Martin Gerhardy 2019-01-29 18:34:11 +01:00
parent bc1402937b
commit 05e240c3f3
5 changed files with 29 additions and 5 deletions

View File

@ -55,6 +55,10 @@ option(TOOLS "Builds with tools" ON)
option(RCON "Builds with rcon tool - also needs TOOLS to be active" ON)
option(SERVER "Builds with server" ON)
option(CLIENT "Builds with client" ON)
option(VOXEDIT "Builds voxedit" ON)
option(MAPEDIT "Builds mapedit" ON)
option(NOISETOOL "Builds noisetool" ON)
option(VOXEDIT_ONLY "Builds voxedit only" OFF)
set(GDB_EXECUTABLE "gdb" CACHE STRING "The gnu debugger binary to use for the debug target")
set(LLDB_EXECUTABLE "lldb" CACHE STRING "The lldb binary to use for the debug target")
set(GIT_EXECUTABLE "git" CACHE STRING "The git binary to use for the update-libs target")
@ -74,6 +78,16 @@ set(SERVER_HOST "server-${FQDN}" CACHE STRING "Host where the server is running
set(SERVER_PORT "11337" CACHE STRING "Port where the server is listening on")
set(BASE_URL "http://localhost/" CACHE STRING "Base url of the http endpoints")
set(DOCKER_REGISTRY "" CACHE STRING "Docker registry")
if (VOXEDIT_ONLY)
set(MAPEDIT OFF)
set(NOISETOOL OFF)
set(RCON OFF)
set(SERVER OFF)
set(CLIENT OFF)
set(TOOLS ON)
endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(WINDOWS 1)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Android")

View File

@ -172,3 +172,7 @@ update-curl:
# TODO lua support
updatelibs: update-nuklear update-restclient-cpp update-libuv update-stb update-googletest update-benchmark update-backward update-dearimgui update-flatbuffers update-assimp update-enet update-glm update-sdl2 update-turbobadger update-curl update-glslang
$(MAKE) -C $(BUILDDIR) update-libs
windows:
$(Q)if [ ! -f $(BUILDDIR)-windows/CMakeCache.txt ]; then i686-w64-mingw32.static-cmake -H. -B$(BUILDDIR)-windows -DCURL_CA_PATH=none -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR)-windows; fi
$(Q)$(MAKE) --no-print-directory -C $(BUILDDIR)-windows install

View File

@ -4,7 +4,7 @@ After=network.target
[Service]
Type=forking
ExecStart=@CMAKE_PROJECT_NAME@-@_EXE_TARGET@
ExecStart=@CMAKE_PROJECT_NAME@-@NAME@
[Install]
WantedBy=multi-user.target

View File

@ -15,5 +15,5 @@ if (MOSQUITTO_FOUND)
engine_add_executable(TARGET ${PROJECT_NAME} SRCS ${SRCS} FILES ${FILES} WINDOWED NOINSTALL)
engine_target_link_libraries(TARGET ${PROJECT_NAME} DEPENDENCIES testcore voxelrender voxelfont util ${MOSQUITTO_LIBRARIES})
else()
message(WARNING "${PROJECT_NAME} is disabled - libmosquitto wasn't found")
message(WARNING "${CMAKE_PROJECT_NAME} is disabled - libmosquitto wasn't found")
endif()

View File

@ -5,9 +5,15 @@ add_subdirectory(uitool)
add_subdirectory(glslang)
if (TOOLS)
add_subdirectory(voxedit)
add_subdirectory(mapedit)
add_subdirectory(noisetool)
if (VOXEDIT)
add_subdirectory(voxedit)
endif()
if (MAPEDIT)
add_subdirectory(mapedit)
endif()
if (NOISETOOL)
add_subdirectory(noisetool)
endif()
if (RCON)
add_subdirectory(rcon)
endif()