diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 2970c509b..52b192689 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -70,6 +70,7 @@ jobs: cmake --preset ${{ env.preset_name }} -DCMAKE_INSTALL_PREFIX=${{ env.install_dir }} + -DNEO_CI_BUILD=ON -DNEO_USE_CCACHE=OFF -DNEO_COPY_LIBRARIES=OFF -DNEO_USE_SEPARATE_BUILD_INFO=ON diff --git a/mp/src/CMakeLists.txt b/mp/src/CMakeLists.txt index a55f4eb1d..77dc12feb 100644 --- a/mp/src/CMakeLists.txt +++ b/mp/src/CMakeLists.txt @@ -7,18 +7,18 @@ set(CMAKE_VERBOSE_MAKEFILE TRUE) message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}") string(TIMESTAMP BUILD_DATETIME UTC) -message(STATUS "${BUILD_DATETIME}") +message(STATUS "TIMESTAMP: ${BUILD_DATETIME}") list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include(cmake/utils.cmake) include(cmake/build_info.cmake) -include(cmake/packaging.cmake) if(NOT OS_WINDOWS AND NOT OS_LINUX AND NOT OS_MACOS) message(FATAL_ERROR "Unknown OS") endif() +option(NEO_CI_BUILD "CI build mode" OFF) option(NEO_CHROOT_BUILD "chroot build mode" OFF) option(NEO_USE_CCACHE "Use ccache" ${OS_LINUX}) option(NEO_USE_VALVE_BINDIR "Use /valve bindir" OFF) # NOTE probably should be used with NEO_DEDICATED @@ -30,21 +30,17 @@ option(NEO_RAD_TELEMETRY_DISABLED "Telemetry disabled" ON) option(NEO_QUICKTIME_VIDEO "Use Quicktime video on Windows" OFF) option(NEO_BUILD_REPLAY "Build replay system" OFF) # NOTE not implemented for neo option(NEO_BUILD_WEAPON_PBK56S "Build PBK56S weapon" OFF) -if(OS_WINDOWS) - set(NEO_BUILD_TIER1 ON CACHE BOOL "" FORCE) - set(NEO_BUILD_MATHLIB ON CACHE BOOL "" FORCE) - set(NEO_BUILD_VGUI_CONTROLS ON CACHE BOOL "" FORCE) -else() - option(NEO_BUILD_TIER1 "Build tier1 library" ON) - option(NEO_BUILD_MATHLIB "Build mathlib library" ON) - option(NEO_BUILD_VGUI_CONTROLS "Build vgui_controls library" ON) -endif() +option(NEO_BUILD_TIER1 "Build tier1 library" ${OS_WINDOWS}) +option(NEO_BUILD_MATHLIB "Build mathlib library" ${OS_WINDOWS}) +option(NEO_BUILD_VGUI_CONTROLS "Build vgui_controls library" ${OS_WINDOWS}) option(NEO_COPY_LIBRARIES "Copy libraries to bin directory by default" ON) set(NEO_OUTPUT_LIBRARY_PATH "${CMAKE_SOURCE_DIR}/../game/neo/bin" CACHE PATH "Directory for output libraries") option(NEO_INSTALL_LIBRARIES "Install game libraries" OFF) option(NEO_INSTALL_RESOURCES "Install game resources" OFF) option(NEO_USE_SEPARATE_BUILD_INFO "Use separate build info on Linux" OFF) +option(NEO_ENABLE_CPACK "Enable CPack" OFF) +message(STATUS "CI build mode: ${NEO_CI_BUILD}") message(STATUS "chroot build mode: ${NEO_CHROOT_BUILD}") message(STATUS "Use ccache: ${NEO_USE_CCACHE}") message(STATUS "Use /valve bindir: ${NEO_USE_VALVE_BINDIR}") @@ -64,11 +60,17 @@ message(STATUS "Directory for output libraries: ${NEO_OUTPUT_LIBRARY_PATH}") message(STATUS "Install game libraries: ${NEO_INSTALL_LIBRARIES}") message(STATUS "Install game resources: ${NEO_INSTALL_RESOURCES}") message(STATUS "Use separate build info on Linux: ${NEO_USE_SEPARATE_BUILD_INFO}") +message(STATUS "Enable CPack: ${NEO_ENABLE_CPACK}") +message("") if(NEO_COPY_LIBRARIES) file(MAKE_DIRECTORY "${NEO_OUTPUT_LIBRARY_PATH}") endif() +if(NEO_ENABLE_CPACK) + include(cmake/packaging.cmake) +endif() + if(CMAKE_VERBOSE_MAKEFILE) set(CMAKE_EXECUTE_PROCESS_COMMAND_ECHO STDOUT) endif() @@ -410,7 +412,7 @@ add_custom_target( VERBATIM ) -if("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") +if(NEO_CI_BUILD AND "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") set(BUILD_TYPE_NAME "Release") else() set(BUILD_TYPE_NAME "${CMAKE_BUILD_TYPE}") diff --git a/mp/src/cmake/FindBitmap.cmake b/mp/src/cmake/FindBitmap.cmake index 62ee35308..ba40c23e7 100644 --- a/mp/src/cmake/FindBitmap.cmake +++ b/mp/src/cmake/FindBitmap.cmake @@ -7,6 +7,7 @@ endif() find_file(BITMAP_LIBRARY NAMES ${BITMAP_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindChoreoObjects.cmake b/mp/src/cmake/FindChoreoObjects.cmake index 8d6a2da8a..cd9804054 100644 --- a/mp/src/cmake/FindChoreoObjects.cmake +++ b/mp/src/cmake/FindChoreoObjects.cmake @@ -7,6 +7,7 @@ endif() find_file(CHOREO_OBJECTS_LIBRARY NAMES ${CHOREO_OBJECTS_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindDMXLoader.cmake b/mp/src/cmake/FindDMXLoader.cmake index 2e05945f9..9f695f8c9 100644 --- a/mp/src/cmake/FindDMXLoader.cmake +++ b/mp/src/cmake/FindDMXLoader.cmake @@ -7,6 +7,7 @@ endif() find_file(DMX_LOADER_LIBRARY NAMES ${DMX_LOADER_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindMatSysControls.cmake b/mp/src/cmake/FindMatSysControls.cmake index d814b1e9c..2bceb9472 100644 --- a/mp/src/cmake/FindMatSysControls.cmake +++ b/mp/src/cmake/FindMatSysControls.cmake @@ -7,6 +7,7 @@ endif() find_file(MATSYS_CONTROLS_LIBRARY NAMES ${MATSYS_CONTROLS_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindMathlib.cmake b/mp/src/cmake/FindMathlib.cmake index 70cdaf93e..c2793efa8 100644 --- a/mp/src/cmake/FindMathlib.cmake +++ b/mp/src/cmake/FindMathlib.cmake @@ -1,6 +1,7 @@ find_library(MATHLIB_LIBRARY NAMES mathlib.a PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindParticles.cmake b/mp/src/cmake/FindParticles.cmake index 3ad6de26d..4ff637716 100644 --- a/mp/src/cmake/FindParticles.cmake +++ b/mp/src/cmake/FindParticles.cmake @@ -7,6 +7,7 @@ endif() find_file(PARTICLES_LIBRARY NAMES ${PARTICLES_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindSteamAPI.cmake b/mp/src/cmake/FindSteamAPI.cmake index ba00c877f..e91b4090d 100644 --- a/mp/src/cmake/FindSteamAPI.cmake +++ b/mp/src/cmake/FindSteamAPI.cmake @@ -9,6 +9,7 @@ endif() find_file(STEAM_API_LIBRARY NAMES ${STEAM_API_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindTier0.cmake b/mp/src/cmake/FindTier0.cmake index 92d1aebb1..8f24ce0b2 100644 --- a/mp/src/cmake/FindTier0.cmake +++ b/mp/src/cmake/FindTier0.cmake @@ -9,6 +9,7 @@ endif() find_file(TIER0_LIBRARY NAMES ${TIER0_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindTier1.cmake b/mp/src/cmake/FindTier1.cmake index e115d8b43..15ea36b97 100644 --- a/mp/src/cmake/FindTier1.cmake +++ b/mp/src/cmake/FindTier1.cmake @@ -7,6 +7,7 @@ endif() find_library(TIER1_LIBRARY NAMES ${TIER1_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindTier2.cmake b/mp/src/cmake/FindTier2.cmake index 554eb3b49..36cca4b45 100644 --- a/mp/src/cmake/FindTier2.cmake +++ b/mp/src/cmake/FindTier2.cmake @@ -7,6 +7,7 @@ endif() find_library(TIER2_LIBRARY NAMES ${TIER2_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindTier3.cmake b/mp/src/cmake/FindTier3.cmake index 4a5c443b6..84b335423 100644 --- a/mp/src/cmake/FindTier3.cmake +++ b/mp/src/cmake/FindTier3.cmake @@ -7,6 +7,7 @@ endif() find_library(TIER3_LIBRARY NAMES ${TIER3_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindVGUIControls.cmake b/mp/src/cmake/FindVGUIControls.cmake index c3a18c309..f8a96665c 100644 --- a/mp/src/cmake/FindVGUIControls.cmake +++ b/mp/src/cmake/FindVGUIControls.cmake @@ -7,6 +7,7 @@ endif() find_file(VGUI_CONTROLS_LIBRARY NAMES ${VGUI_CONTROLS_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindVSTDLib.cmake b/mp/src/cmake/FindVSTDLib.cmake index 3d313bffd..378240328 100644 --- a/mp/src/cmake/FindVSTDLib.cmake +++ b/mp/src/cmake/FindVSTDLib.cmake @@ -9,6 +9,7 @@ endif() find_library(VSTDLIB_LIBRARY NAMES ${VSTDLIB_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/FindVTF.cmake b/mp/src/cmake/FindVTF.cmake index a7a1ab635..2b912eae8 100644 --- a/mp/src/cmake/FindVTF.cmake +++ b/mp/src/cmake/FindVTF.cmake @@ -7,6 +7,7 @@ endif() find_file(VTF_LIBRARY NAMES ${VTF_LIBRARY_NAME} PATHS "${LIBPUBLIC}" + NO_CACHE NO_DEFAULT_PATH REQUIRED ) diff --git a/mp/src/cmake/utils.cmake b/mp/src/cmake/utils.cmake index 01fc1ab7b..7671d8695 100644 --- a/mp/src/cmake/utils.cmake +++ b/mp/src/cmake/utils.cmake @@ -149,8 +149,9 @@ function(split_debug_information) SPLIT_DEBUG_INFO_FILE ${SPLITDEBUG_TARGET} ) - # Make sure the file is deleted on `make clean` - set_property(DIRECTORY APPEND - PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${SPLITDEBUG_TARGET} + # Make sure the file is deleted when cleaning + set_target_properties(${PARSED_ARGS_TARGET} + PROPERTIES + ADDITIONAL_CLEAN_FILES ${SPLITDEBUG_TARGET} ) endfunction()