summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-12-09 10:50:01 +0100
committerGitHub <noreply@github.com>2016-12-09 10:50:01 +0100
commit101168c7a41058436f592bd9cb0a1a70f0f1b0ad (patch)
treeb760bde8331b934ebfe7459556abb4ecd02b0192 /build.sh
parent685de9132d453e08bc4ddb0c66f30d59fb4603b3 (diff)
downloadcoreclr-101168c7a41058436f592bd9cb0a1a70f0f1b0ad.tar.gz
coreclr-101168c7a41058436f592bd9cb0a1a70f0f1b0ad.tar.bz2
coreclr-101168c7a41058436f592bd9cb0a1a70f0f1b0ad.zip
Fix incremental build when dummy version.cpp is generated (#8547)
This change fixes a problem with incremental build on Unix. When the version.cpp is generated by the build.sh as a dummy one with no real version stamp in it, it is recreated every time the build.sh is run. That means that build needs to rebuild that file and also re-link all the components that include it. This change tests the file presence and contents before actually regenerating it.
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/build.sh b/build.sh
index 1017d5caab..50cbc70ef3 100755
--- a/build.sh
+++ b/build.sh
@@ -167,16 +167,22 @@ build_coreclr()
if [ $__SkipConfigure == 0 ]; then
# if msbuild is not supported, then set __SkipGenerateVersion to 1
if [ $__isMSBuildOnNETCoreSupported == 0 ]; then __SkipGenerateVersion=1; fi
- # Drop version.c file
+ # Drop version.cpp file
__versionSourceFile=$__IntermediatesDir/version.cpp
if [ $__SkipGenerateVersion == 0 ]; then
"$__ProjectRoot/run.sh" build -Project=$__ProjectDir/build.proj -generateHeaderUnix -NativeVersionSourceFile=$__versionSourceFile $__RunArgs $__UnprocessedBuildArgs
else
+ # Generate the dummy version.cpp, but only if it didn't exist to make sure we don't trigger unnecessary rebuild
__versionSourceLine="static char sccsid[] __attribute__((used)) = \"@(#)No version information produced\";"
- echo $__versionSourceLine > $__versionSourceFile
+ if [ -e $__versionSourceFile ]; then
+ read existingVersionSourceLine < $__versionSourceFile
+ fi
+ if [ "$__versionSourceLine" != "$existingVersionSourceLine" ]; then
+ echo $__versionSourceLine > $__versionSourceFile
+ fi
fi
- pushd "$__IntermediatesDir"
+ pushd "$__IntermediatesDir"
# Regenerate the CMake solution
__ExtraCmakeArgs="-DCLR_CMAKE_TARGET_OS=$__BuildOS -DCLR_CMAKE_PACKAGES_DIR=$__PackagesDir -DCLR_CMAKE_PGO_INSTRUMENT=$__PgoInstrument"
echo "Invoking \"$__ProjectRoot/src/pal/tools/gen-buildsys-clang.sh\" \"$__ProjectRoot\" $__ClangMajorVersion $__ClangMinorVersion $__BuildArch $__BuildType $__CodeCoverage $__IncludeTests $generator $__ExtraCmakeArgs $__cmakeargs"