summaryrefslogtreecommitdiff
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-05 08:57:17 -0400
committerBrad King <brad.king@kitware.com>2014-06-05 08:58:29 -0400
commit8256ccb78c80bbe50c966ba15b109bfd0f573276 (patch)
tree16f9c25c9ffe60dfdb7d7c246f5b6fa7a224ba68 /Source/cmMakefileTargetGenerator.cxx
parent8ab2d7d462a0f812b4ce1c555c6a7cbcea7abfef (diff)
downloadcmake-8256ccb78c80bbe50c966ba15b109bfd0f573276.tar.gz
Add OBJECT_FILE_DIR rule placeholder for compilation lines
Some compilers do not offer an option to specify the path to the object file, but rather only to the directory in which to place the object file. See issue 14876 for some examples. Add a new OBJECT_FILE_DIR placeholder to specify the directory containing the object file for the current compilation. This may differ from the main target OBJECT_DIR when the object corresponds to a source in a subdirectory.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index a08d731b22..85017ad2ae 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -684,6 +684,11 @@ cmMakefileTargetGenerator
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL);
vars.ObjectDir = objectDir.c_str();
+ std::string objectFileDir = cmSystemTools::GetFilenamePath(obj);
+ objectFileDir = this->Convert(objectFileDir,
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::SHELL);
+ vars.ObjectFileDir = objectFileDir.c_str();
vars.Flags = flags.c_str();
std::string definesString = "$(";