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:
124
124
contents : write
125
125
126
126
steps :
127
+ - name : Install Git
128
+ uses :
alandefreitas/cpp-actions/[email protected]
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
+
127
140
- name : Clone MrDocs
128
141
uses : actions/checkout@v4
129
142
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ option(MRDOCS_INSTALL "Configure install target" ON)
36
36
option (MRDOCS_PACKAGE "Build install package" ON )
37
37
option (MRDOCS_BUILD_SHARED "Link shared" ${BUILD_SHARED_LIBS} )
38
38
option (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 )
39
40
if (MRDOCS_BUILD_TESTS OR MRDOCS_INSTALL )
40
41
option (MRDOCS_BUILD_DOCS "Build documentation" ON )
41
42
else ()
@@ -151,8 +152,15 @@ if (GIT_FOUND)
151
152
OUTPUT_VARIABLE PROJECT_VERSION_BUILD
152
153
OUTPUT_STRIP_TRAILING_WHITESPACE
153
154
)
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 ()
154
159
set (PROJECT_VERSION_BUILD "${PROJECT_VERSION_BUILD} " )
155
160
else ()
161
+ if (MRDOCS_REQUIRE_GIT )
162
+ message (FATAL_ERROR "Git is required to extract the version build" )
163
+ endif ()
156
164
set (PROJECT_VERSION_BUILD "" )
157
165
endif ()
158
166
configure_file (
Original file line number Diff line number Diff line change @@ -279,9 +279,13 @@ call_impl(
279
279
}
280
280
os << ' \n ' ;
281
281
}
282
+
283
+ // Update counters
282
284
std::lock_guard<llvm::sys::Mutex> lock (mutex_);
283
- if (! s.empty())
285
+ if (!s.empty())
286
+ {
284
287
llvm::errs () << s;
288
+ }
285
289
switch (level)
286
290
{
287
291
case Level::debug:
You can’t perform that action at this time.
0 commit comments