diff options
author | Brad King <brad.king@kitware.com> | 2020-04-07 12:00:35 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-04-07 12:00:45 (GMT) |
commit | c0438d272d21e47ec5f6ff255289000f77ce6c5d (patch) | |
tree | 4a64abc4cdc7c44c5156c0e44824d8fdf74bbef7 /Source | |
parent | a4c873fc5dc5eb503fa608450a4dc571a76df37d (diff) | |
parent | 35a29ec82790890df4872e60943e9127e4603e54 (diff) | |
download | CMake-c0438d272d21e47ec5f6ff255289000f77ce6c5d.zip CMake-c0438d272d21e47ec5f6ff255289000f77ce6c5d.tar.gz CMake-c0438d272d21e47ec5f6ff255289000f77ce6c5d.tar.bz2 |
Merge topic 'llvm-rc-include-path'
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4570
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmcmd.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 18a2108..c3bd160 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1714,23 +1714,33 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args) // The arguments are // args[0] == <cmake-executable> // args[1] == cmake_llvm_rc - // args[2] == intermediate_file - // args[3..n] == preprocess+args + // args[2] == source_file_path + // args[3] == intermediate_file + // args[4..n] == preprocess+args // args[n+1] == -- // args[n+2...] == llvm-rc+args if (args.size() < 3) { std::cerr << "Invalid cmake_llvm_rc arguments"; return 1; } - const std::string& intermediate_file = args[2]; + const std::string& intermediate_file = args[3]; + const std::string& source_file = args[2]; std::vector<std::string> preprocess; std::vector<std::string> resource_compile; std::vector<std::string>* pArgTgt = &preprocess; - for (std::string const& arg : cmMakeRange(args).advance(3)) { + for (std::string const& arg : cmMakeRange(args).advance(4)) { if (arg == "--") { pArgTgt = &resource_compile; } else { - pArgTgt->push_back(arg); + if (arg.find("SOURCE_DIR") != std::string::npos) { + std::string sourceDirArg = arg; + cmSystemTools::ReplaceString( + sourceDirArg, "SOURCE_DIR", + cmSystemTools::GetFilenamePath(source_file)); + pArgTgt->push_back(sourceDirArg); + } else { + pArgTgt->push_back(arg); + } } } if (preprocess.empty()) { |