Skip to content

Commit aa8b9da

Browse files
committed
Add a switch to not include git commit hash in the built artifacts
1 parent ee0955a commit aa8b9da

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ include(CheckSymbolExists)
5454
# This is primarily to support building smaller or faster project files.
5555
#
5656

57+
option(SWIFT_APPEND_VC_REV
58+
"Embed the version control system revision in Swift"
59+
TRUE)
60+
5761
option(SWIFT_INCLUDE_TOOLS
5862
"Generate build targets for swift tools"
5963
TRUE)

lib/Basic/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ else()
1212
endif()
1313

1414
function(generate_revision_inc revision_inc_var name dir)
15-
find_first_existing_vc_file("${dir}" ${name}_vc)
15+
if(SWIFT_APPEND_VC_REV)
16+
# generate_vcs_version_script generates header with only `undef`s
17+
# inside when source directory doesn't exist.
18+
find_first_existing_vc_file("${dir}" ${name}_vc)
19+
endif()
1620

1721
# Create custom target to generate the VC revision include.
1822
set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/${name}Revision.inc")

0 commit comments

Comments
 (0)