use precompiled headers

This commit is contained in:
Akash Mozumdar 2020-04-18 19:04:07 -06:00
parent 386e09a81a
commit d1887db2a5
21 changed files with 24 additions and 19 deletions

View File

@ -24,6 +24,9 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
include_directories(include) include_directories(include)
add_library(pch text.cpp)
target_precompile_headers(pch PUBLIC include/common.h)
file(GLOB ASSETS assets/*) file(GLOB ASSETS assets/*)
file(COPY ${ASSETS} DESTINATION ${CMAKE_FINAL_OUTPUT_DIRECTORY}) file(COPY ${ASSETS} DESTINATION ${CMAKE_FINAL_OUTPUT_DIRECTORY})

View File

@ -13,6 +13,7 @@ add_executable(Textractor WIN32
Textractor.rc Textractor.rc
Textractor.ico Textractor.ico
) )
target_precompile_headers(Textractor REUSE_FROM pch)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets shell32 winhttp) target_link_libraries(${PROJECT_NAME} Qt5::Widgets shell32 winhttp)
if (NOT EXISTS ${CMAKE_FINAL_OUTPUT_DIRECTORY}/Qt5Core.dll) if (NOT EXISTS ${CMAKE_FINAL_OUTPUT_DIRECTORY}/Qt5Core.dll)

View File

@ -6,3 +6,4 @@ add_executable(TextractorCLI
textthread.cpp textthread.cpp
hookcode.cpp hookcode.cpp
) )
target_precompile_headers(TextractorCLI REUSE_FROM pch)

View File

@ -1,4 +1,3 @@
#include "common.h"
#include "module.h" #include "module.h"
#include <sstream> #include <sstream>

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "common.h"
#include "types.h" #include "types.h"
namespace HookCode namespace HookCode

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "common.h"
#include "textthread.h" #include "textthread.h"
namespace Host namespace Host

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "common.h"
#include "types.h" #include "types.h"
class TextThread class TextThread

View File

@ -19,6 +19,21 @@ add_library(Remove\ 30\ Repeated\ Sentences MODULE removerepeatsentence.cpp exte
add_library(Replacer MODULE replacer.cpp extensionimpl.cpp) add_library(Replacer MODULE replacer.cpp extensionimpl.cpp)
add_library(Thread\ Linker MODULE threadlinker.cpp extensionimpl.cpp) add_library(Thread\ Linker MODULE threadlinker.cpp extensionimpl.cpp)
target_precompile_headers(Bing\ Translate REUSE_FROM pch)
target_precompile_headers(Copy\ to\ Clipboard REUSE_FROM pch)
target_precompile_headers(DeepL\ Translate REUSE_FROM pch)
target_precompile_headers(Extra\ Newlines REUSE_FROM pch)
target_precompile_headers(Extra\ Window REUSE_FROM pch)
target_precompile_headers(Google\ Translate REUSE_FROM pch)
target_precompile_headers(Lua REUSE_FROM pch)
target_precompile_headers(Regex\ Filter REUSE_FROM pch)
target_precompile_headers(Remove\ Repeated\ Characters REUSE_FROM pch)
target_precompile_headers(Remove\ Repeated\ Phrases REUSE_FROM pch)
target_precompile_headers(Remove\ Repeated\ Phrases\ 2 REUSE_FROM pch)
target_precompile_headers(Remove\ 30\ Repeated\ Sentences REUSE_FROM pch)
target_precompile_headers(Replacer REUSE_FROM pch)
target_precompile_headers(Thread\ Linker REUSE_FROM pch)
target_link_libraries(Bing\ Translate winhttp Qt5::Widgets) target_link_libraries(Bing\ Translate winhttp Qt5::Widgets)
target_link_libraries(DeepL\ Translate winhttp Qt5::Widgets) target_link_libraries(DeepL\ Translate winhttp Qt5::Widgets)
target_link_libraries(Extra\ Window Qt5::Widgets) target_link_libraries(Extra\ Window Qt5::Widgets)

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "common.h"
#include <istream> #include <istream>
template <typename C, int delimiterCount, int blockSize = 0x1000 / sizeof(C)> // windows file block size template <typename C, int delimiterCount, int blockSize = 0x1000 / sizeof(C)> // windows file block size

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include "common.h"
struct InfoForExtension struct InfoForExtension
{ {
const char* name; const char* name;

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "common.h"
#include <winhttp.h> #include <winhttp.h>
using InternetHandle = AutoHandle<Functor<WinHttpCloseHandle>>; using InternetHandle = AutoHandle<Functor<WinHttpCloseHandle>>;

View File

@ -1,4 +1,3 @@
#include "common.h"
#include <Psapi.h> #include <Psapi.h>
inline std::optional<std::wstring> GetModuleFilename(DWORD processId, HMODULE module = NULL) inline std::optional<std::wstring> GetModuleFilename(DWORD processId, HMODULE module = NULL)

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "common.h"
#include <QString> #include <QString>
#include <QVector> #include <QVector>
#include <QHash> #include <QHash>

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "common.h"
#include "const.h" #include "const.h"
class WinMutex // Like CMutex but works with scoped_lock class WinMutex // Like CMutex but works with scoped_lock

View File

@ -4,4 +4,6 @@ find_qt5(Core Widgets)
add_executable(Test WIN32 main.cpp resource.rc) add_executable(Test WIN32 main.cpp resource.rc)
target_precompile_headers(Test REUSE_FROM pch)
target_link_libraries(Test Qt5::Widgets) target_link_libraries(Test Qt5::Widgets)

View File

@ -1,5 +1,4 @@
#include "common.h" #include "resource.h"
#include "resource.h"
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <QApplication> #include <QApplication>

View File

@ -28,5 +28,5 @@ set(texthook_src
endif() endif()
add_library(texthook MODULE ${texthook_src}) add_library(texthook MODULE ${texthook_src})
target_precompile_headers(texthook REUSE_FROM pch)
target_link_libraries(texthook minhook) target_link_libraries(texthook minhook)

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
#include "common.h"
#include "types.h" #include "types.h"
void SearchForText(wchar_t* text, UINT codepage); void SearchForText(wchar_t* text, UINT codepage);

View File

@ -4,7 +4,6 @@
// 8/23/2013 jichi // 8/23/2013 jichi
// Branch: ITH/IHF_DLL.h, rev 66 // Branch: ITH/IHF_DLL.h, rev 66
#include "common.h"
#include "types.h" #include "types.h"
void TextOutput(ThreadParam tp, BYTE (*buffer)[PIPE_BUFFER_SIZE], int len); void TextOutput(ThreadParam tp, BYTE (*buffer)[PIPE_BUFFER_SIZE], int len);

View File

@ -7,7 +7,6 @@
// 8/24/2013 TODO: // 8/24/2013 TODO:
// - Clean up this file // - Clean up this file
// - Reduce global variables. Use namespaces or singleton classes instead. // - Reduce global variables. Use namespaces or singleton classes instead.
#include "common.h"
#include "types.h" #include "types.h"
// Artikash 6/17/2019 TODO: These have the wrong values on x64 // Artikash 6/17/2019 TODO: These have the wrong values on x64

View File

@ -3,8 +3,6 @@
// util.h // util.h
// 8/23/2013 jichi // 8/23/2013 jichi
#include "common.h"
namespace Util { namespace Util {
bool unloadCurrentModule(); bool unloadCurrentModule();