From 3b44c18576650775b116278219da286a8bbe30f1 Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 17 Jul 2018 00:58:49 -0400 Subject: [PATCH] Followups for #1325 - Fix git tag detection - Fix changelog entry position - Update/clean up docs some --- docs/Compile.rst | 35 +++++++++++++++++++++-------------- docs/changelog.txt | 4 +--- library/git-describe.cmake.in | 8 +++++++- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/docs/Compile.rst b/docs/Compile.rst index 9abcf7fb8..d1e7a5594 100644 --- a/docs/Compile.rst +++ b/docs/Compile.rst @@ -68,6 +68,24 @@ and more, please see `contributing-code`. Build settings ============== +Generator +--------- + +The ``Ninja`` CMake build generator is the prefered build method on Linux and +macOS, instead of ``Unix Makefiles``, which is the default. You can select Ninja +by passing ``-G Ninja`` to CMake. Incremental builds using Unix Makefiles can be +much slower than Ninja builds. + +:: + + cmake .. -G Ninja + +.. warning:: + + Most other CMake settings can be changed by running ``cmake`` again, but the + generator cannot be changed after ``cmake`` has been run without creating a + new build folder. Do not forget to specify this option. + Build type ---------- @@ -75,7 +93,7 @@ Build type cmake .. -DCMAKE_BUILD_TYPE:string=BUILD_TYPE -Valid and useful build types include 'Release' and 'RelWithDebInfo'. Default +Valid and useful build types include 'Release' and 'RelWithDebInfo'. The default build type is 'Release'. Target architecture (32-bit vs. 64-bit) @@ -97,17 +115,6 @@ change, so specifying it explicitly is a good idea. Note that the scripts in the "build" folder on Windows will set the architecture automatically. -Generator ---------- - -``Ninja`` cmake build generator is prefered build method instead of default -``Unix Makefiles``. You can select Ninja build using ``-G`` option. Incremental -builds using Unix Makefiles can be much slower than Ninja builds. - -:: - - cmake .. -G Ninja - Other settings -------------- There are a variety of other settings which you can find in CMakeCache.txt in @@ -182,7 +189,7 @@ empty folder in the DFHack directory to use instead) and start the build like th cd build cmake .. -G Ninja -DCMAKE_BUILD_TYPE:string=Release -DCMAKE_INSTALL_PREFIX= - ninja install + ninja install # or ninja -jX install to specify the number of cores (X) to use should be a path to a copy of Dwarf Fortress, of the appropriate version for the DFHack you are building. This will build the library along @@ -357,7 +364,7 @@ Building mkdir build-osx cd build-osx cmake .. -G Ninja -DCMAKE_BUILD_TYPE:string=Release -DCMAKE_INSTALL_PREFIX= - ninja install + ninja install # or ninja -jX install to specify the number of cores (X) to use should be a path to a copy of Dwarf Fortress, of the appropriate version for the DFHack you are building. diff --git a/docs/changelog.txt b/docs/changelog.txt index bb3f571c1..998a20a77 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -39,6 +39,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Internals - Core: various thread safety and memory management improvements +- Fixed cmake build dependencies for generated header files ================================================================================ # 0.44.12-r1 @@ -111,9 +112,6 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: -@ macOS: fixed ``renderer`` vtable address on x64 (fixes `rendermax`) - `stonesense`: fixed ``PLANT:DESERT_LIME:LEAF`` typo -## Internals -- Fixed cmake build dependencies for generated headers files - ## API - Added C++-style linked list interface for DF linked lists diff --git a/library/git-describe.cmake.in b/library/git-describe.cmake.in index e48212b8f..13fe4b208 100644 --- a/library/git-describe.cmake.in +++ b/library/git-describe.cmake.in @@ -11,7 +11,7 @@ execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=8 --exact-match WORKING_DIRECTORY "${dfhack_SOURCE_DIR}" - RESULT_VARIABLE DFHACK_GIT_TAGGED + RESULT_VARIABLE DFHACK_GIT_TAGGED_RESULT OUTPUT_QUIET ERROR_QUIET) # Check library/xml for matching commits @@ -24,6 +24,12 @@ execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD OUTPUT_VARIABLE DFHACK_GIT_XML_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE) +if(${DFHACK_GIT_TAGGED_RESULT} EQUAL 0) + set(DFHACK_GIT_TAGGED TRUE) +else() + set(DFHACK_GIT_TAGGED FALSE) +endif() + if(${DFHACK_GIT_XML_COMMIT} STREQUAL ${DFHACK_GIT_XML_EXPECTED_COMMIT}) set(DFHACK_GIT_XML_MATCH TRUE) else()