From 4e179475e818b67acd2e9580eaadecbd7a337e75 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Thu, 1 Oct 2020 16:49:45 -0500 Subject: [PATCH] CMake Makefile targets --- .efrocachemap | 20 +++++------ Makefile | 64 +++++++++++++++++++++++++++++++++++- src/ballistica/ballistica.cc | 2 +- 3 files changed, 74 insertions(+), 12 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 0ff4b268..49d3120d 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -3934,14 +3934,14 @@ "assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f", "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ac/96/c3b9934061393fe09cc90ff24b8d", "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/38/2b/5641b3b40846f74f232771ac0457", - "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/d0/21/cb738075207c3dab9f2389455a69", - "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/cd/44/d59a1f7d6ee05b58e80ebc3469bf", - "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/b4/56/6d1f390d348ddf65937af3374d76", - "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/31/b9/176ba76e48c23d064b6583963a0e", - "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/37/18/56c6d3b8788362ceb97005b6b3b6", - "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/a6/bd/da7954fe559403d021b15df72967", - "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/97/10/138625f676793653620a84cd712b", - "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/ef/a8/4b532f37f74929b834ffd6c2ac5d", - "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/3f/6f/c49674367960a82b19a45641daa6", - "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/df/a3/90e19f2ef6b2edd17d0f936245f2" + "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/55/e7/7493c35661e347a164ccc9a6e150", + "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/f4/a8/5f874f2c8ee0de54649b3142c2c5", + "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/87/cd/e155776004a096cd1981e8c45539", + "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/44/90/8453cc086294eaf8bd15f4df8332", + "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/e8/98/2363d625af50c24c6ef3d2e9c58d", + "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/7a/fd/1b7ecd5d084ea0e52974e463b0be", + "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/1c/76/bb6e52f9bd7d50695d587419f0e4", + "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/74/61/d3c6283c0136cd3036da24ee7857", + "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/dc/56/9638fcadf876b2dc14ae42a4eb13", + "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/34/04/47dc06bfb943ef4c41b19394f45a" } \ No newline at end of file diff --git a/Makefile b/Makefile index a33ce896..7910e969 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ help: PREREQS = .cache/checkenv .dir-locals.el \ .mypy.ini .pycheckers .pylintrc .style.yapf .clang-format \ - .projectile .editorconfig + ballisticacore-cmake/.clang-format .projectile .editorconfig # Target that should be built before running most any other build. # This installs tool config files, runs environment checks, etc. @@ -635,6 +635,57 @@ preflight2-full: .PHONY: preflight preflight-full preflight2 preflight2-full +################################################################################ +# # +# CMake # +# # +################################################################################ + +# Set the following from the command line to influence the build: + +# This can be Debug or Release +CMAKE_BUILD_TYPE ?= Debug + +# Host to use when building via cloudshell +CMAKE_CLOUDSHELL_HOST ?= linbeast + +# Base names for assembled packages +CMAKE_CLOUDSHELL_PACKAGE_NAME ?= BallisticaCore +CMAKE_CLOUDSHELL_SERVER_PACKAGE_NAME ?= BallisticaCore_Server + +# Build and run the cmake build. +cmake: cmake-build + @cd ballisticacore-cmake/build/$(CM_BT_LC) && ./ballisticacore + +# Build but don't run it. +cmake-build: assets-cmake resources code + @tools/pcommand cmake_prep_dir ballisticacore-cmake/build/$(CM_BT_LC) + @${STAGE_ASSETS} -cmake ballisticacore-cmake/build/$(CM_BT_LC) + @cd ballisticacore-cmake/build/$(CM_BT_LC) && test -f Makefile \ + || cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) ../.. + @cd ballisticacore-cmake/build/$(CM_BT_LC) && ${MAKE} -j${CPUS} + +cmake-clean: + rm -rf ballisticacore-cmake/build/$(CM_BT_LC) + +cmake-server: cmake-server-build + @cd ballisticacore-cmake/build/server-$(CM_BT_LC) && ./ballisticacore + +cmake-server-build: assets-cmake resources code + @tools/pcommand cmake_prep_dir ballisticacore-cmake/build/server-$(CM_BT_LC) + @${STAGE_ASSETS} -cmakeserver ballisticacore-cmake/build/server-$(CM_BT_LC) + @cd ballisticacore-cmake/build/server-$(CM_BT_LC) && test -f Makefile \ + || cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -DHEADLESS=true ../.. + @cd ballisticacore-cmake/build/server-$(CM_BT_LC) && ${MAKE} -j${CPUS} + +cmake-server-clean: + rm -rf ballisticacore-cmake/build/server-$(CM_BT_LC) + +# Tell make which of these targets don't represent files. +.PHONY: cmake cmake-build cmake-clean cmake-server cmake-server-build \ + cmake-server-clean + + ################################################################################ # # # Auxiliary # @@ -699,3 +750,14 @@ ENV_SRC = tools/pcommand tools/batools/build.py # Tell make which of these targets don't represent files. .PHONY: + + +################################################################################ +# # +# Auxiliary # +# # +################################################################################ + +# When using CLion, our cmake dir is root. Expose .clang-format there too. +ballisticacore-cmake/.clang-format: .clang-format + @cd ballisticacore-cmake && ln -sf ../.clang-format . diff --git a/src/ballistica/ballistica.cc b/src/ballistica/ballistica.cc index 82fa265b..8c0228e7 100644 --- a/src/ballistica/ballistica.cc +++ b/src/ballistica/ballistica.cc @@ -29,7 +29,7 @@ namespace ballistica { // These are set automatically via script; don't change here. -const int kAppBuildNumber = 20192; +const int kAppBuildNumber = 20193; const char* kAppVersion = "1.5.26"; const char* kBlessingHash = nullptr;