mirror of
https://github.com/reactos/CMake.git
synced 2024-12-13 22:58:41 +00:00
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.
This commit is contained in:
parent
2fd44b082b
commit
f3e9eeedf4
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user