logic: only use precompiled headers for compilation database commands that specify the "-include-pch" flag (issue #719)

This commit is contained in:
mlangkabel
2019-08-13 17:31:33 +02:00
parent 084bc3dc43
commit e89dc0ab0a
8 changed files with 121 additions and 9 deletions
@@ -13,6 +13,12 @@
* Validate "Header Files & Directories to Index" contains "src" entry
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Pick any file at "Precompiled Header File"
* Click "Next"
* Validate dialog appears that asks NOT to specify PCH input file
* Click "OK"
* Clear "Precompiled Header File"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
+1 -1
View File
@@ -21,7 +21,7 @@ cp -a $SRC_PATH/. $WORKING_COPY_PATH
echo "[" >> $CDB_PATH
echo " {" >> $CDB_PATH
echo " \"directory\": \"${WORKING_COPY_PATH}\"," >> $CDB_PATH
echo " \"command\": \"clang-tool -fms-extensions -fms-compatibility -fms-compatibility-version=19 -isystem \\\"${WORKING_COPY_SRC_PATH}/include\\\" -DCDB_FLAG -D _DEBUG -D _MT -D _DLL -D WIN32 -D _WINDOWS -D BUILD_TYPE=\\\"\\\" -D QT_WIDGETS_LIB -D QT_GUI_LIB -D QT_CORE_LIB -D QT_NETWORK_LIB -D QT_WINEXTRAS_LIB -D QT_SVG_LIB -D CMAKE_INTDIR=\\\"Debug\\\" -D _MBCS -std=c++14 \\\"${WORKING_COPY_SRC_PATH}/main.cpp\\\"\"," >> $CDB_PATH
echo " \"command\": \"clang-tool -fms-extensions -fms-compatibility -fms-compatibility-version=19 -isystem \\\"${WORKING_COPY_SRC_PATH}/include\\\" -DCDB_FLAG -D _DEBUG -D _MT -D _DLL -D WIN32 -D _WINDOWS -D BUILD_TYPE=\\\"\\\" -D QT_WIDGETS_LIB -D QT_GUI_LIB -D QT_CORE_LIB -D QT_NETWORK_LIB -D QT_WINEXTRAS_LIB -D QT_SVG_LIB -D CMAKE_INTDIR=\\\"Debug\\\" -D _MBCS -std=c++14 -include-pch some/file/path \\\"${WORKING_COPY_SRC_PATH}/main.cpp\\\"\"," >> $CDB_PATH
echo " \"file\": \"${WORKING_COPY_SRC_PATH}/main.cpp\"" >> $CDB_PATH
echo " }" >> $CDB_PATH
echo "]" >> $CDB_PATH
@@ -14,8 +14,11 @@
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Click "Next"
* Add "-DCOMPILER_FLAG" to "Additional Compiler Flags"
* Validate dialog appears that asks to specify PCH input file
* Click "OK"
* Add "./src/pch.h" to "Precompiled Header File"
* Click "Next"
* Add "-DCOMPILER_FLAG" to "Additional Compiler Flags"
* Add "-DPCH_FLAG" to "Precompiled Header Flags"
* Click "Create"
* Validate "All files" is the only option selectable