summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-10 15:21:55 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-10 15:28:41 (GMT)
commitf3e9eeedf43f783c02b2a2a10fc0e632eaf7cfd0 (patch)
tree05bb8ae4da41adbe710380639fcbbe034e12921b /Source/cmCoreTryCompile.cxx
parent2fd44b082b0a8e546c73d921f9d8264a668c3b78 (diff)
downloadCMake-f3e9eeedf43f783c02b2a2a10fc0e632eaf7cfd0.zip
CMake-f3e9eeedf43f783c02b2a2a10fc0e632eaf7cfd0.tar.gz
CMake-f3e9eeedf43f783c02b2a2a10fc0e632eaf7cfd0.tar.bz2
try_compile: Use shorter test executable name with consistent length
Since commit v2.8.8~176^2 (try_compile: Use random executable file name, 2012-02-13) the length of the test executable name in generated try_compile projects has been longer and unpredictable. With Visual Studio on windows, the tools try to create paths like: CMakeFiles/CMakeTmp/$tgt.dir/Debug/$tgt.tlog/$tgt.lastbuildstate With the target name repeated up to 3 times, we must make it short and of consistent length to avoid overrunning the 260 character limit imposed by VS tools.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index c414553..d9369e6 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -383,8 +383,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
/* Use a random file name to avoid rapid creation and deletion
of the same executable name (some filesystems fail on that). */
- sprintf(targetNameBuf, "cmTryCompileExec%u",
- cmSystemTools::RandomSeed());
+ sprintf(targetNameBuf, "cmTC_%05x",
+ cmSystemTools::RandomSeed() & 0xFFFFF);
targetName = targetNameBuf;
if (!targets.empty())