-
Notifications
You must be signed in to change notification settings - Fork 41
CheatSheet
James Robertson edited this page Feb 13, 2021
·
15 revisions
cmake . -B build -G Ninja -DFREECIV_ENABLE_TOOLS=NO -DFREECIV_ENABLE_SERVER=YES -DCMAKE_BUILD_TYPE=Release -DFREECIV_ENABLE_NLS=NO
cmake --build build
/usr/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/lib/llvm/10/bin/clang -DCMAKE_CXX_COMPILER:FILEPATH=/usr/lib/llvm/10/bin/clang++ -B build -G Ninja
cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DFREECIV_ENABLE_TOOLS=NO -DFREECIV_ENABLE_SERVER=YES -DCMAKE_BUILD_TYPE=Debug -DFREECIV_ENABLE_NLS=NO
clazy checks with make instead ninja, full list of checks is here: https://github.com/KDE/clazy
export CLAZY_CHECKS="level0,detaching-temporary" # Enables all from level0 and also detaching-temporary
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clazy -DCMAKE_CXX_FLAGS="-std=c++11 -O0 -ggdb -pipe
export CLAZY_EXPORT_FIXES
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clazy -DCMAKE_CXX_FLAGS="-Xclang -plugin-arg-clazy -Xclang export-fixes"
clang-apply-replacements
-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-mtune=native -O2 -pipe" -DCMAKE_CXX_FLAGS="-mtune=native -O2 -pipe -fgraphite -flto=8 -fuse-linker-plugin -fno-fat-lto-objects -fgraphite-identity -floop-interchange -floop-strip-mine -floop-block -fno-delete-null-pointer-checks" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,now -Wl,-z,relro"
export CMAKE_PREFIX_PATH=/home/you/git/qt/6.0.0/gcc_64
-DCMAKE_CXX_FLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address"
-DCMAKE_CXX_FLAGS="-fstack-protector-all" -DCMAKE_EXE_LINKER_FLAGS="-fstack-protector-all"
-DCMAKE_CXX_FLAGS="-fsanitize=undefined" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=undefined"
-DCMAKE_CXX_FLAGS="-fsanitize=alignment" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=alignment"
-DCMAKE_CXX_FLAGS="-fsanitize=thread" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread"
git fetch origin; git rebase origin/master
export QT_LOGGING_RULES="freeciv.stacktrace*=false"
QT_LOGGING_RULES="freeciv.graphics = true" build/freeciv-qt
-DCMAKE_PREFIX_PATH=***\vcpkg\installed\x86-mingw-static
Here's a command that will run clang-format
on all changed files:
find \( -name *.cpp -or -name *.h \) -not -exec git diff --exit-code --quiet '{}' \; -print -exec clang-format -i '{}' \;
[skip travis]