From 79bf9b122529166d6cb1f72be561eca1463cb230 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 6 Jan 2023 21:52:26 -0800 Subject: [PATCH 1/2] Add CMakePresets.json "default" preset - build with Ninja - enables GCC color diagonstics under Ninja - uses /build dir - enables DEVELOP build - compiles with optimizations and debug symbols "debug" preset - compiles without optimizations - enables further debug info --- CMakePresets.json | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 CMakePresets.json diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..53b5a398a --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,31 @@ +{ + "version": 2, + "configurePresets": [ + { + "name": "default", + "description": "Build using Ninja", + "generator": "Ninja", + "binaryDir": "build", + "cacheVariables": { + "CMAKE_C_FLAGS": "-fdiagnostics-color", + "CMAKE_CXX_FLAGS": "-fdiagnostics-color", + "SRB2_CONFIG_DEV_BUILD": "ON", + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "debug", + "description": "Build for development (no optimizations)", + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "default" + } + ] +} From d6f8d18ece21d5d33bf116580f4864056ff3ffb4 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 6 Jan 2023 22:15:16 -0800 Subject: [PATCH 2/2] Add alias-bootstrap.sh Contains some useful aliases for Git. Adds: - git cmake - git build - git crossmake --- alias-bootstrap.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 alias-bootstrap.sh diff --git a/alias-bootstrap.sh b/alias-bootstrap.sh new file mode 100755 index 000000000..f1a6ac4ed --- /dev/null +++ b/alias-bootstrap.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env sh + +# All these commands can be run from anywhere in the git +# tree, not just the top level. + +# Usage: git cmake +# +# Same usage as standard CMake command. +# +git config 'alias.cmake' '!cmake' + +# Usage: git build [options] +# Usage: git build [options] +# +# In the second usage, when no preset is given, the +# "default" build preset is used. +# +# Available options can be found by running: +# +# git cmake --build +# +git config 'alias.build' '!p="${1##-*}"; [ "$p" ] && shift; git cmake --build --preset "${p:-default}"' + +# Usage: git crossmake +# +# Shortcut to i686-w64-mingw32-cmake (CMake cross +# compiler) +# +git config 'alias.crossmake' '!i686-w64-mingw32-cmake'