diff options
author | Brad King <brad.king@kitware.com> | 2009-10-21 17:12:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-10-21 17:12:21 (GMT) |
commit | 9a88bc8c4bfd1c5ec0a4625750b1d513d32233c2 (patch) | |
tree | 633a97badb4505d0f1f2ff0a6f0df2add5bde9fe /Source | |
parent | 7a6db286c8bacb0e9c90e987f3b84381a9a24d28 (diff) | |
download | CMake-9a88bc8c4bfd1c5ec0a4625750b1d513d32233c2.zip CMake-9a88bc8c4bfd1c5ec0a4625750b1d513d32233c2.tar.gz CMake-9a88bc8c4bfd1c5ec0a4625750b1d513d32233c2.tar.bz2 |
Use copies for versioned names on Windows
Versioned UNIX libraries and executables produce multiple names for a
single target using one of
cmake -E cmake_symlink_library
cmake -E cmake_symlink_executable
to create symlinks to the real file for the extra names. However, when
cross-compiling from Windows to Linux we cannot create symlinks. This
commit teaches CMake to make copies instead of symbolic links when
running on windows. While this approach does not produce exactly what
Linux wants to see, at least the build will complete and the binary will
run on the target system. See issue #9171.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmake.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 24b6443..a40d89e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -3129,8 +3129,12 @@ bool cmake::SymlinkInternal(std::string const& file, std::string const& link) { cmSystemTools::RemoveFile(link.c_str()); } +#if defined(_WIN32) && !defined(__CYGWIN__) + return cmSystemTools::CopyFileAlways(file.c_str(), link.c_str()); +#else std::string linktext = cmSystemTools::GetFilenameName(file); return cmSystemTools::CreateSymlink(linktext.c_str(), link.c_str()); +#endif } //---------------------------------------------------------------------------- |