From fb304d5c95bcdfc3ab15913a600bcae1660e8967 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Mon, 19 Mar 2018 16:25:35 -0700 Subject: [PATCH] Restore platform arguments --- src/platform_posix.cc | 4 ++++ src/platform_win.cc | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/platform_posix.cc b/src/platform_posix.cc index 18a11074..12cb4a37 100644 --- a/src/platform_posix.cc +++ b/src/platform_posix.cc @@ -259,6 +259,10 @@ bool IsSymLink(const std::string& path) { return lstat(path.c_str(), &buf) == 0 && S_ISLNK(buf.st_mode); } +std::vector GetPlatformClangArguments() { + return {}; +} + void FreeUnusedMemory() { #if defined(__GLIBC__) malloc_trim(0); diff --git a/src/platform_win.cc b/src/platform_win.cc index 726f964a..027b6150 100644 --- a/src/platform_win.cc +++ b/src/platform_win.cc @@ -129,6 +129,25 @@ bool IsSymLink(const std::string& path) { return false; } +std::vector GetPlatformClangArguments() { + // + // Found by executing + // + // $ clang++ -E -x c++ - -v + // + // https://clang.llvm.org/docs/MSVCCompatibility.html + // + // + // These options are only needed if clang is targeting the msvc triple, + // which depends on how clang was build for windows. clang downloaded from + // releases.llvm.org defaults to msvc, so cquery does as well. + // + // https://github.com/cquery-project/cquery/issues/509 has more context. + // + return {"-fms-extensions", "-fms-compatibility", + "-fdelayed-template-parsing"}; +} + void FreeUnusedMemory() {} bool RunObjectiveCIndexTests() {