Skip to content

Commit 1fd11bd

Browse files
committed
build: give up on embedding the git commit identification
We've "always" wanted to embed the tag/commit info into the build, if only for proper troubleshooting. However, we never documented this, and someone hit that during their build (see the linked bug). Furthermore, this tag/commit info was not being used at all in the C++ code, and there also was no #define in any header. The version info which is in the pkg-config file comes from a hard-coded version (which is a good thing to do). The only use of that version-specific variable was in the Doxygen file, but there it was not working. Our CMake code tried to be smart and not trigger a hard rebuild *all the time( (which is a good thing), but that did not work at all. In CMake, the usual way of achieving this is to generate a temporary file, and only copy that always-generated-at-each-build temporary file to a file that's actually included in some C++ TU when these files are different. However, this also means that the code which was determining the tag/commit info was running in a separate CMake process, and as such its variables were never included in *our* CMake context, and therefore the XXX_VERSION variable was empty at the time main CMake run, and therefore the generated Doxyfile had no version info. Let's just remove that. I *tried* to make this work via `CMAKE_CONFIGURE_DEPENDS`, but it's a bit more complex, and one would probably have to use some extra custom target for generating the Doxyfile "properly". I'm not in the mood of doing allthat just for a version marker in the docs, but we should probably fix that later "properly". Bug: #31 Change-Id: I0c3ca600e2a57e4a54e98262154c75c7b54f6961
1 parent 9fe9c4b commit 1fd11bd

4 files changed

Lines changed: 0 additions & 47 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@ if(NOT MSVC)
1515
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Woverloaded-virtual -Wimplicit-fallthrough -Wsuggest-override ${CMAKE_CXX_FLAGS}")
1616
endif()
1717

18-
add_custom_target(libyang-cpp-version-cmake
19-
cmake/ProjectGitVersion.cmake
20-
cmake/ProjectGitVersionRunner.cmake
21-
)
22-
include(cmake/ProjectGitVersion.cmake)
2318
set(LIBYANG_CPP_PKG_VERSION "6")
24-
prepare_git_version(LIBYANG_CPP_VERSION ${LIBYANG_CPP_PKG_VERSION})
2519

2620
find_package(Doxygen)
2721
option(WITH_DOCS "Create and install internal documentation (needs Doxygen)" ${DOXYGEN_FOUND})

Doxyfile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
PROJECT_NAME = "@CMAKE_PROJECT_NAME@"
2-
PROJECT_NUMBER = "@LIBYANG_CPP_VERSION@"
32
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@
43
INPUT = @doxy_main_page@ @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@
54
FILE_PATTERNS = *.hpp *.cpp *.md *.cmake

cmake/ProjectGitVersion.cmake

Lines changed: 0 additions & 18 deletions
This file was deleted.

cmake/ProjectGitVersionRunner.cmake

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)