[HIPIFY] Introduce '-D' option as hipify-clang's one

+ '-D' might be set as hipify-clang option (before separator '--' or without specifying separator at all);
+ '-D' as a clang option might be specified as well (after options separator '--');
+ All defines specified as hipify-clang defines (before options separator '--') will be set after clang's ones and will redefine the same clang's ones.
This commit is contained in:
Evgeny Mankov
2019-01-14 19:34:42 +03:00
parent 93aeb04cec
commit 13ffeb47ce
3 changed files with 15 additions and 1 deletions
+6
View File
@@ -199,6 +199,12 @@ int main(int argc, const char **argv) {
#if defined(HIPIFY_CLANG_RES)
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-resource-dir=" HIPIFY_CLANG_RES));
#endif
if (!D.empty()) {
for (std::string s : D) {
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-D", ct::ArgumentInsertPosition::END));
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster(s.c_str(), ct::ArgumentInsertPosition::END));
}
}
if (!I.empty()) {
for (std::string s : I) {
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-I", ct::ArgumentInsertPosition::END));