mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Introduce DISABLE_GUI for headless build (Fixes OpenRCT2#8542) (#8566)
This commit is contained in:
committed by
Michał Janiszewski
parent
0328355f9e
commit
d4a3feca29
@@ -39,6 +39,8 @@ option(DISABLE_NETWORK "Disable multiplayer functionality. Mainly for testing.")
|
||||
option(DISABLE_TTF "Disable support for TTF provided by freetype2.")
|
||||
option(ENABLE_LIGHTFX "Enable lighting effects." ON)
|
||||
|
||||
option(DISABLE_GUI "Don't build GUI. (Headless only.)")
|
||||
|
||||
if (FORCE32)
|
||||
set(TARGET_M "-m32")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_M}")
|
||||
@@ -204,12 +206,14 @@ endif()
|
||||
# Include sub-projects
|
||||
include("${ROOT_DIR}/src/openrct2/CMakeLists.txt" NO_POLICY_SCOPE)
|
||||
include("${ROOT_DIR}/src/openrct2-cli/CMakeLists.txt" NO_POLICY_SCOPE)
|
||||
include("${ROOT_DIR}/src/openrct2-ui/CMakeLists.txt" NO_POLICY_SCOPE)
|
||||
if(NOT DISABLE_GUI)
|
||||
include("${ROOT_DIR}/src/openrct2-ui/CMakeLists.txt" NO_POLICY_SCOPE)
|
||||
endif()
|
||||
|
||||
# g2
|
||||
add_custom_command(
|
||||
OUTPUT g2.dat
|
||||
COMMAND ./openrct2 sprite build \"${CMAKE_BINARY_DIR}/g2.dat\" \"${ROOT_DIR}/resources/g2/sprites.json\"
|
||||
COMMAND ./openrct2-cli sprite build \"${CMAKE_BINARY_DIR}/g2.dat\" \"${ROOT_DIR}/resources/g2/sprites.json\"
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
add_custom_target(g2 DEPENDS ${PROJECT} g2.dat)
|
||||
@@ -256,7 +260,9 @@ if (DOWNLOAD_OBJECTS)
|
||||
endif ()
|
||||
install(TARGETS "libopenrct2" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(TARGETS "openrct2" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
if(NOT DISABLE_GUI)
|
||||
install(TARGETS "openrct2" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
install(TARGETS "openrct2-cli" OPTIONAL RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/g2.dat" DESTINATION "${CMAKE_INSTALL_DATADIR}/openrct2")
|
||||
install(DIRECTORY "data/" DESTINATION "${CMAKE_INSTALL_DATADIR}/openrct2")
|
||||
|
||||
Reference in New Issue
Block a user