File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,19 @@ jobs:
124124 contents : write
125125
126126 steps :
127+ - name : Install Git
128+ uses : alandefreitas/cpp-actions/package-install@v1.8.8
129+ if : matrix.container != ''
130+ env :
131+ DEBIAN_FRONTEND : ' noninteractive'
132+ TZ : ' Etc/UTC'
133+ with :
134+ apt-get : git
135+
136+ - name : Configure Git Safe Directory
137+ if : matrix.container != ''
138+ run : git config --global --add safe.directory "$(pwd)"
139+
127140 - name : Clone MrDocs
128141 uses : actions/checkout@v4
129142
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ option(MRDOCS_INSTALL "Configure install target" ON)
3636option (MRDOCS_PACKAGE "Build install package" ON )
3737option (MRDOCS_BUILD_SHARED "Link shared" ${BUILD_SHARED_LIBS} )
3838option (MRDOCS_BUILD_TESTS "Build tests" ${BUILD_TESTING} )
39+ option (MRDOCS_REQUIRE_GIT "Git is required: not being able to extract version build is an error" ON )
3940if (MRDOCS_BUILD_TESTS OR MRDOCS_INSTALL)
4041 option (MRDOCS_BUILD_DOCS "Build documentation" ON )
4142else ()
@@ -151,8 +152,15 @@ if (GIT_FOUND)
151152 OUTPUT_VARIABLE PROJECT_VERSION_BUILD
152153 OUTPUT_STRIP_TRAILING_WHITESPACE
153154 )
155+ # Check if PROJECT_VERSION_BUILD is populated
156+ if (NOT PROJECT_VERSION_BUILD AND MRDOCS_REQUIRE_GIT)
157+ message (FATAL_ERROR "Git was found but could not extract the version build" )
158+ endif ()
154159 set (PROJECT_VERSION_BUILD "${PROJECT_VERSION_BUILD} " )
155160else ()
161+ if (MRDOCS_REQUIRE_GIT)
162+ message (FATAL_ERROR "Git is required to extract the version build" )
163+ endif ()
156164 set (PROJECT_VERSION_BUILD "" )
157165endif ()
158166configure_file (
Original file line number Diff line number Diff line change @@ -279,9 +279,13 @@ call_impl(
279279 }
280280 os << ' \n ' ;
281281 }
282+
283+ // Update counters
282284 std::lock_guard<llvm::sys::Mutex> lock (mutex_);
283- if (! s.empty())
285+ if (!s.empty())
286+ {
284287 llvm::errs () << s;
288+ }
285289 switch (level)
286290 {
287291 case Level::debug:
You can’t perform that action at this time.
0 commit comments