From bcf500fdf97036c9d11ff252d9112bdde5ba9b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 3 May 2024 01:54:36 +0800 Subject: [PATCH] pch --- plugins/CMakeLists.txt | 8 +- plugins/exec/CMakeLists.txt | 5 +- plugins/exec/PyStand.cpp | 10 --- plugins/exec/PyStand.h | 7 -- plugins/hookmagpie/CMakeLists.txt | 2 +- plugins/hookmagpie/hookmagpie.cpp | 6 +- plugins/hookmagpie/veh_hook.cpp | 2 - plugins/hookmagpie/veh_hook.h | 4 - plugins/pch.cpp | 0 plugins/pch.h | 77 +++++++++++++++++++ plugins/shareddllproxy/CMakeLists.txt | 6 +- plugins/shareddllproxy/LR.cpp | 4 +- plugins/shareddllproxy/aspatch.cpp | 9 --- plugins/shareddllproxy/dllinject.cpp | 4 +- plugins/shareddllproxy/dreye.cpp | 3 - plugins/shareddllproxy/jbj7.cpp | 7 -- plugins/shareddllproxy/kingsoft.cpp | 5 -- plugins/shareddllproxy/le.cpp | 2 - plugins/shareddllproxy/lossless.cpp | 5 -- plugins/shareddllproxy/magpie.cpp | 7 +- plugins/shareddllproxy/neospeech.cpp | 12 --- plugins/shareddllproxy/ntleas.cpp | 4 +- plugins/shareddllproxy/shareddllproxy.cpp | 9 +-- .../shareddllproxy/voiceroid2/api_adapter.cc | 4 - .../shareddllproxy/voiceroid2/api_adapter.h | 2 - .../shareddllproxy/voiceroid2/api_settings.cc | 2 - .../shareddllproxy/voiceroid2/api_settings.h | 3 - plugins/shareddllproxy/voiceroid2/ebyroid.cc | 7 -- plugins/shareddllproxy/voiceroid2/ebyroid.h | 3 - plugins/shareddllproxy/voiceroid2/voice2.cpp | 4 - plugins/winrtutils/CMakeLists.txt | 4 +- plugins/winrtutils/cinterface.cpp | 2 - plugins/winrtutils/define.h | 3 - plugins/winrtutils/dllmain.cpp | 1 - plugins/winrtutils/framework.h | 5 -- plugins/winrtutils/pch.cpp | 5 -- plugins/winrtutils/pch.h | 13 ---- plugins/winrtutils/winrtocr.cpp | 5 -- plugins/winrtutils/winrtsnapshot.cpp | 7 +- plugins/winsharedutils/BMP.h | 4 - plugins/winsharedutils/CMakeLists.txt | 4 +- plugins/winsharedutils/MWebBrowser.cpp | 7 -- plugins/winsharedutils/MWebBrowser.hpp | 4 - plugins/winsharedutils/SimpleBrowser.cpp | 15 ---- plugins/winsharedutils/cinterface.cpp | 6 -- plugins/winsharedutils/cinterface.h | 2 - plugins/winsharedutils/clipboard.cpp | 1 - plugins/winsharedutils/darklistener.cpp | 4 +- plugins/winsharedutils/define.h | 1 - plugins/winsharedutils/hwnd.cpp | 1 - plugins/winsharedutils/levenshtein.cpp | 3 - plugins/winsharedutils/lnk.cpp | 7 -- plugins/winsharedutils/maglistener.cpp | 3 - plugins/winsharedutils/muteprocess.cpp | 9 --- plugins/winsharedutils/otsu.cpp | 6 -- plugins/winsharedutils/sapi_dll.cpp | 5 -- plugins/winsharedutils/simplemecab.cpp | 4 - plugins/winsharedutils/theme.cpp | 6 +- plugins/winsharedutils/version.cpp | 3 - 59 files changed, 105 insertions(+), 258 deletions(-) create mode 100644 plugins/pch.cpp create mode 100644 plugins/pch.h delete mode 100644 plugins/winrtutils/framework.h delete mode 100644 plugins/winrtutils/pch.cpp delete mode 100644 plugins/winrtutils/pch.h diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 72249c4b..7fa34a48 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -31,8 +31,12 @@ set(VERSION_MAJOR 2) set(VERSION_MINOR 48) set(VERSION_PATCH 0) +add_library(pch pch.cpp) +target_precompile_headers(pch PUBLIC pch.h) + + add_subdirectory(exec) -add_subdirectory(shareddllproxy) add_subdirectory(winrtutils) add_subdirectory(winsharedutils) -add_subdirectory(hookmagpie) \ No newline at end of file +add_subdirectory(hookmagpie) +add_subdirectory(shareddllproxy) \ No newline at end of file diff --git a/plugins/exec/CMakeLists.txt b/plugins/exec/CMakeLists.txt index 25e4de5e..368967d8 100644 --- a/plugins/exec/CMakeLists.txt +++ b/plugins/exec/CMakeLists.txt @@ -19,4 +19,7 @@ add_executable(LunaTranslator_debug ${sources}) target_compile_definitions(LunaTranslator_debug PRIVATE PYSTAND_CONSOLE) add_executable(LunaTranslator WIN32 ${sources}) add_executable(LunaTranslator_admin WIN32 ${sources}) -set_target_properties(LunaTranslator_admin PROPERTIES LINK_FLAGS " /MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" ") \ No newline at end of file +set_target_properties(LunaTranslator_admin PROPERTIES LINK_FLAGS " /MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" ") +target_precompile_headers(LunaTranslator_debug REUSE_FROM pch) +target_precompile_headers(LunaTranslator_admin REUSE_FROM pch) +target_precompile_headers(LunaTranslator REUSE_FROM pch) \ No newline at end of file diff --git a/plugins/exec/PyStand.cpp b/plugins/exec/PyStand.cpp index 4198f652..b425b74e 100644 --- a/plugins/exec/PyStand.cpp +++ b/plugins/exec/PyStand.cpp @@ -9,18 +9,8 @@ #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS 1 #endif - -#include -#include -#include -#include -#include - #include "PyStand.h" -#ifdef _MSC_VER -#pragma comment(lib, "shlwapi.lib") -#endif //--------------------------------------------------------------------- // dtor diff --git a/plugins/exec/PyStand.h b/plugins/exec/PyStand.h index 0f4131fa..738a1c52 100644 --- a/plugins/exec/PyStand.h +++ b/plugins/exec/PyStand.h @@ -9,13 +9,6 @@ #ifndef _PYSTAND_H_ #define _PYSTAND_H_ -#include -#include -#include -#include -#include - - //--------------------------------------------------------------------- // PyStand //--------------------------------------------------------------------- diff --git a/plugins/hookmagpie/CMakeLists.txt b/plugins/hookmagpie/CMakeLists.txt index 8c88f1c8..319fdc0b 100644 --- a/plugins/hookmagpie/CMakeLists.txt +++ b/plugins/hookmagpie/CMakeLists.txt @@ -2,7 +2,7 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) add_library(hookmagpie MODULE hookmagpie.cpp veh_hook.cpp) - target_link_libraries(hookmagpie) + target_precompile_headers(hookmagpie REUSE_FROM pch) endif() \ No newline at end of file diff --git a/plugins/hookmagpie/hookmagpie.cpp b/plugins/hookmagpie/hookmagpie.cpp index 2cfe85bd..7809864b 100644 --- a/plugins/hookmagpie/hookmagpie.cpp +++ b/plugins/hookmagpie/hookmagpie.cpp @@ -1,8 +1,4 @@ -#include -#include -#include -#include -#include + #include "veh_hook.h" namespace Win32Utils { diff --git a/plugins/hookmagpie/veh_hook.cpp b/plugins/hookmagpie/veh_hook.cpp index b0f4ad8b..4fd1835f 100644 --- a/plugins/hookmagpie/veh_hook.cpp +++ b/plugins/hookmagpie/veh_hook.cpp @@ -4,9 +4,7 @@ Version: 24-March-2008 **/ // #define WINVER 0x0501 // #define _WIN32_WINNT 0x0501 -#include #include "veh_hook.h" -#include static veh_list_t *list = NULL; char int3bp[] = "\xCC"; std::mutex vehlistlock; diff --git a/plugins/hookmagpie/veh_hook.h b/plugins/hookmagpie/veh_hook.h index 8231efc5..70a41175 100644 --- a/plugins/hookmagpie/veh_hook.h +++ b/plugins/hookmagpie/veh_hook.h @@ -5,10 +5,6 @@ Version: 24-March-2008 #ifndef LIST_T_H_INCLUDED #define LIST_T_H_INCLUDED -#include -#include -#include -#include // VEH Hooking types #define VEH_HK_INT3 0 #define VEH_HK_MEM 1 diff --git a/plugins/pch.cpp b/plugins/pch.cpp new file mode 100644 index 00000000..e69de29b diff --git a/plugins/pch.h b/plugins/pch.h new file mode 100644 index 00000000..aaa50162 --- /dev/null +++ b/plugins/pch.h @@ -0,0 +1,77 @@ +#pragma once +#define _CRT_SECURE_NO_WARNINGS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#pragma comment(lib, "shlwapi.lib") +#pragma comment(lib, "winmm.lib") +#pragma comment(lib, "dwmapi.lib") +#pragma comment(lib, "Psapi.lib") +#pragma comment(lib, "Version.lib") \ No newline at end of file diff --git a/plugins/shareddllproxy/CMakeLists.txt b/plugins/shareddllproxy/CMakeLists.txt index 403aed17..613aac8d 100644 --- a/plugins/shareddllproxy/CMakeLists.txt +++ b/plugins/shareddllproxy/CMakeLists.txt @@ -13,14 +13,18 @@ generate_product_version( add_executable(shareddllproxy shareddllproxy.cpp dllinject.cpp ntleas.cpp aspatch.cpp ${versioninfo}) +target_precompile_headers(shareddllproxy REUSE_FROM pch) if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) add_library(x64lib magpie.cpp lossless.cpp) + target_precompile_headers(x64lib REUSE_FROM pch) target_link_libraries(shareddllproxy x64lib ${Detours}) set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy64") else() add_subdirectory(voiceroid2) add_library(x86lib dreye.cpp jbj7.cpp kingsoft.cpp le.cpp neospeech.cpp LR.cpp) - target_link_libraries(shareddllproxy x86lib voiceroid2 ${Detours}) + target_precompile_headers(voiceroid2 REUSE_FROM pch) + target_precompile_headers(x86lib REUSE_FROM pch) + target_link_libraries(shareddllproxy x86lib voiceroid2 ${Detours}) set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy32") endif() diff --git a/plugins/shareddllproxy/LR.cpp b/plugins/shareddllproxy/LR.cpp index 1a39f0ad..8eacbeba 100644 --- a/plugins/shareddllproxy/LR.cpp +++ b/plugins/shareddllproxy/LR.cpp @@ -1,6 +1,4 @@ -#include -#include -#include + struct LRProfile { UINT CodePage; diff --git a/plugins/shareddllproxy/aspatch.cpp b/plugins/shareddllproxy/aspatch.cpp index 26f81b55..c57e4d40 100644 --- a/plugins/shareddllproxy/aspatch.cpp +++ b/plugins/shareddllproxy/aspatch.cpp @@ -1,12 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include static std::wstring StringToWideString(const std::string &text, UINT encoding = CP_UTF8) { std::vector buffer(text.size() + 1); diff --git a/plugins/shareddllproxy/dllinject.cpp b/plugins/shareddllproxy/dllinject.cpp index cd0267b9..ca81906f 100644 --- a/plugins/shareddllproxy/dllinject.cpp +++ b/plugins/shareddllproxy/dllinject.cpp @@ -1,6 +1,4 @@ -#include -#include -int dllinjectwmain(int argc, wchar_t *argv[]) +int dllinjectwmain(int argc, wchar_t *argv[]) { for (int i = 1; i < argc - 1; i += 1) diff --git a/plugins/shareddllproxy/dreye.cpp b/plugins/shareddllproxy/dreye.cpp index 9a8ce1c8..f38ae17e 100644 --- a/plugins/shareddllproxy/dreye.cpp +++ b/plugins/shareddllproxy/dreye.cpp @@ -1,6 +1,3 @@ -#include -#include -#include extern "C" { typedef int(__stdcall *MTInitCJ)(int); diff --git a/plugins/shareddllproxy/jbj7.cpp b/plugins/shareddllproxy/jbj7.cpp index e565526b..4fc1ff53 100644 --- a/plugins/shareddllproxy/jbj7.cpp +++ b/plugins/shareddllproxy/jbj7.cpp @@ -1,11 +1,4 @@ -#define _CRT_SECURE_NO_WARNINGS -#include -#include -#include -#include -#include - #define CODEPAGE_JA 932 #define CODEPAGE_GB 936 diff --git a/plugins/shareddllproxy/kingsoft.cpp b/plugins/shareddllproxy/kingsoft.cpp index 2524918b..25041373 100644 --- a/plugins/shareddllproxy/kingsoft.cpp +++ b/plugins/shareddllproxy/kingsoft.cpp @@ -1,9 +1,4 @@ -#include -#include -#include -#include -#include extern "C" { typedef DWORD(__stdcall *StartSession)(wchar_t *path, void *bufferStart, void *bufferStop, const wchar_t *app); diff --git a/plugins/shareddllproxy/le.cpp b/plugins/shareddllproxy/le.cpp index afbfce63..8c06c496 100644 --- a/plugins/shareddllproxy/le.cpp +++ b/plugins/shareddllproxy/le.cpp @@ -1,6 +1,4 @@ -#include -#include #define SHIFT_JIS 932 int lewmain(int argc, wchar_t *argv[]) diff --git a/plugins/shareddllproxy/lossless.cpp b/plugins/shareddllproxy/lossless.cpp index 854545ba..4c40b120 100644 --- a/plugins/shareddllproxy/lossless.cpp +++ b/plugins/shareddllproxy/lossless.cpp @@ -1,9 +1,4 @@  -#include -#include -#include -#include -#include typedef BSTR (*GetAdapterNames_t)(); typedef BSTR (*GetDisplayNames_t)(); diff --git a/plugins/shareddllproxy/magpie.cpp b/plugins/shareddllproxy/magpie.cpp index 4c1246c4..d6184ac5 100644 --- a/plugins/shareddllproxy/magpie.cpp +++ b/plugins/shareddllproxy/magpie.cpp @@ -1,9 +1,4 @@ -// magpiecmdrunner.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 -// - -#include -#include - + typedef BOOL (*Initialize)( UINT logLevel, const char *logFileName, diff --git a/plugins/shareddllproxy/neospeech.cpp b/plugins/shareddllproxy/neospeech.cpp index 9a8f3449..261fa1a0 100644 --- a/plugins/shareddllproxy/neospeech.cpp +++ b/plugins/shareddllproxy/neospeech.cpp @@ -1,16 +1,4 @@  -#define _CRT_SECURE_NO_WARNINGS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include bool _Speak(std::wstring &Content, const wchar_t *token, int voiceid, int rate, int volume, std::wstring &FileName) { ISpVoice *pVoice = NULL; diff --git a/plugins/shareddllproxy/ntleas.cpp b/plugins/shareddllproxy/ntleas.cpp index 30866439..3cf28489 100644 --- a/plugins/shareddllproxy/ntleas.cpp +++ b/plugins/shareddllproxy/ntleas.cpp @@ -1,6 +1,4 @@ -#include -#include -#include + #define NTLEA_PARAMETERS_LENGTH (LF_FACESIZE + 20) #define szRcpIntMtx "RcpInternalMutex" diff --git a/plugins/shareddllproxy/shareddllproxy.cpp b/plugins/shareddllproxy/shareddllproxy.cpp index c59af43f..648756ee 100644 --- a/plugins/shareddllproxy/shareddllproxy.cpp +++ b/plugins/shareddllproxy/shareddllproxy.cpp @@ -1,11 +1,4 @@ - -#include -#include -#include -#include -#include -#include -#pragma comment(linker, "/subsystem:windows /entry:wmainCRTStartup") +#pragma comment(linker, "/subsystem:windows /entry:wmainCRTStartup") int dllinjectwmain(int argc, wchar_t *argv[]); int ntleaswmain(int argc, wchar_t *wargv[]); diff --git a/plugins/shareddllproxy/voiceroid2/api_adapter.cc b/plugins/shareddllproxy/voiceroid2/api_adapter.cc index 5b2a29e6..70f611a2 100644 --- a/plugins/shareddllproxy/voiceroid2/api_adapter.cc +++ b/plugins/shareddllproxy/voiceroid2/api_adapter.cc @@ -1,9 +1,5 @@ #include "api_adapter.h" -#include - -#include - #include "ebyutil.h" namespace ebyroid diff --git a/plugins/shareddllproxy/voiceroid2/api_adapter.h b/plugins/shareddllproxy/voiceroid2/api_adapter.h index 5ff4fb1f..3f8be7c1 100644 --- a/plugins/shareddllproxy/voiceroid2/api_adapter.h +++ b/plugins/shareddllproxy/voiceroid2/api_adapter.h @@ -1,8 +1,6 @@ #ifndef API_ADAPTER_H #define API_ADAPTER_H -#include - // forward-declaration to avoid including Windows.h in header #ifndef _WINDEF_ struct HINSTANCE__; diff --git a/plugins/shareddllproxy/voiceroid2/api_settings.cc b/plugins/shareddllproxy/voiceroid2/api_settings.cc index 894261f4..d6f6c956 100644 --- a/plugins/shareddllproxy/voiceroid2/api_settings.cc +++ b/plugins/shareddllproxy/voiceroid2/api_settings.cc @@ -1,7 +1,5 @@ #include "api_settings.h" -#include - #include "ebyutil.h" namespace ebyroid { diff --git a/plugins/shareddllproxy/voiceroid2/api_settings.h b/plugins/shareddllproxy/voiceroid2/api_settings.h index 340c2c1e..429dc19b 100644 --- a/plugins/shareddllproxy/voiceroid2/api_settings.h +++ b/plugins/shareddllproxy/voiceroid2/api_settings.h @@ -1,9 +1,6 @@ #ifndef API_SETTINGS_H #define API_SETTINGS_H -#include - -#include namespace ebyroid { diff --git a/plugins/shareddllproxy/voiceroid2/ebyroid.cc b/plugins/shareddllproxy/voiceroid2/ebyroid.cc index f452bbaf..3f3c70b7 100644 --- a/plugins/shareddllproxy/voiceroid2/ebyroid.cc +++ b/plugins/shareddllproxy/voiceroid2/ebyroid.cc @@ -1,12 +1,5 @@ #include "ebyroid.h" -#include -#include -#include -#include - -#include - #include "api_adapter.h" #include "api_settings.h" #include "ebyutil.h" diff --git a/plugins/shareddllproxy/voiceroid2/ebyroid.h b/plugins/shareddllproxy/voiceroid2/ebyroid.h index 264e1aaf..14a5468c 100644 --- a/plugins/shareddllproxy/voiceroid2/ebyroid.h +++ b/plugins/shareddllproxy/voiceroid2/ebyroid.h @@ -1,9 +1,6 @@ #ifndef EBYROID_H #define EBYROID_H -#include -#include -#include namespace ebyroid { diff --git a/plugins/shareddllproxy/voiceroid2/voice2.cpp b/plugins/shareddllproxy/voiceroid2/voice2.cpp index c7ff1bb9..2ed14a05 100644 --- a/plugins/shareddllproxy/voiceroid2/voice2.cpp +++ b/plugins/shareddllproxy/voiceroid2/voice2.cpp @@ -1,13 +1,9 @@ #include "ebyroid.h" -#include #include "api_adapter.h" #include "ebyutil.h" -#include -#include using ebyroid::Ebyroid; #include "types.h" -#pragma comment(lib, "winmm.lib") int voiceroid2wmain(int argc, wchar_t *wargv[]) { diff --git a/plugins/winrtutils/CMakeLists.txt b/plugins/winrtutils/CMakeLists.txt index fda75c82..84d20185 100644 --- a/plugins/winrtutils/CMakeLists.txt +++ b/plugins/winrtutils/CMakeLists.txt @@ -10,7 +10,8 @@ generate_product_version( VERSION_PATCH ${VERSION_PATCH} ) -add_library(winrtutils MODULE winrtsnapshot.cpp cinterface.cpp dllmain.cpp pch.cpp winrtocr.cpp ${versioninfo}) +add_library(winrtutils MODULE winrtsnapshot.cpp cinterface.cpp dllmain.cpp winrtocr.cpp ${versioninfo}) +target_precompile_headers(winrtutils REUSE_FROM pch) if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) set_target_properties(winrtutils PROPERTIES OUTPUT_NAME "winrtutils64") @@ -18,4 +19,3 @@ else() set_target_properties(winrtutils PROPERTIES OUTPUT_NAME "winrtutils32") endif() - \ No newline at end of file diff --git a/plugins/winrtutils/cinterface.cpp b/plugins/winrtutils/cinterface.cpp index 78499754..b77db08d 100644 --- a/plugins/winrtutils/cinterface.cpp +++ b/plugins/winrtutils/cinterface.cpp @@ -1,6 +1,4 @@ -#include "pch.h" #include "define.h" -#include void free_all(void *str) { diff --git a/plugins/winrtutils/define.h b/plugins/winrtutils/define.h index 07c12979..33888eaf 100644 --- a/plugins/winrtutils/define.h +++ b/plugins/winrtutils/define.h @@ -1,7 +1,4 @@ #pragma once -#include -#include -#include struct ocrres { wchar_t **lines; diff --git a/plugins/winrtutils/dllmain.cpp b/plugins/winrtutils/dllmain.cpp index 0e00f1d6..fc7764c9 100644 --- a/plugins/winrtutils/dllmain.cpp +++ b/plugins/winrtutils/dllmain.cpp @@ -1,5 +1,4 @@ // dllmain.cpp : 定义 DLL 应用程序的入口点。 -#include "pch.h" #include "define.h" BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, diff --git a/plugins/winrtutils/framework.h b/plugins/winrtutils/framework.h deleted file mode 100644 index 80cbbc9b..00000000 --- a/plugins/winrtutils/framework.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 -// Windows 头文件 -#include diff --git a/plugins/winrtutils/pch.cpp b/plugins/winrtutils/pch.cpp deleted file mode 100644 index b6fb8f4a..00000000 --- a/plugins/winrtutils/pch.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// pch.cpp: 与预编译标头对应的源文件 - -#include "pch.h" - -// 当使用预编译的头时,需要使用此源文件,编译才能成功。 diff --git a/plugins/winrtutils/pch.h b/plugins/winrtutils/pch.h deleted file mode 100644 index 96609271..00000000 --- a/plugins/winrtutils/pch.h +++ /dev/null @@ -1,13 +0,0 @@ -// pch.h: 这是预编译标头文件。 -// 下方列出的文件仅编译一次,提高了将来生成的生成性能。 -// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 -// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 -// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 - -#ifndef PCH_H -#define PCH_H - -// 添加要在此处预编译的标头 -#include "framework.h" - -#endif //PCH_H diff --git a/plugins/winrtutils/winrtocr.cpp b/plugins/winrtutils/winrtocr.cpp index c25f3f82..9aef5523 100644 --- a/plugins/winrtutils/winrtocr.cpp +++ b/plugins/winrtutils/winrtocr.cpp @@ -1,6 +1,4 @@ -#include "pch.h" #include "define.h" -#include #include #include #include @@ -14,9 +12,6 @@ #include #include -#include -#include -#include using namespace winrt; using namespace Windows::Foundation; diff --git a/plugins/winrtutils/winrtsnapshot.cpp b/plugins/winrtutils/winrtsnapshot.cpp index f555e5ec..5553465a 100644 --- a/plugins/winrtutils/winrtsnapshot.cpp +++ b/plugins/winrtutils/winrtsnapshot.cpp @@ -1,5 +1,4 @@ -#include "pch.h" -#include "define.h" +#include "define.h" #include #include #include @@ -19,13 +18,9 @@ #include #include #include -#include -#include -#include #include // #include "ImageFormatConversion.hpp" -#pragma comment(lib, "Dwmapi.lib") #pragma comment(lib, "windowsapp.lib") #pragma comment(lib, "DXGI.lib") #pragma comment(lib, "gdiplus.lib") diff --git a/plugins/winsharedutils/BMP.h b/plugins/winsharedutils/BMP.h index 47119ecc..e566921d 100644 --- a/plugins/winsharedutils/BMP.h +++ b/plugins/winsharedutils/BMP.h @@ -1,8 +1,4 @@ #pragma once -#include -#include -#include -#include #pragma pack(push, 1) struct BMPFileHeader { diff --git a/plugins/winsharedutils/CMakeLists.txt b/plugins/winsharedutils/CMakeLists.txt index 12d569b2..b940c312 100644 --- a/plugins/winsharedutils/CMakeLists.txt +++ b/plugins/winsharedutils/CMakeLists.txt @@ -12,11 +12,9 @@ generate_product_version( ) add_library(winsharedutils MODULE hwnd.cpp darklistener.cpp theme.cpp version.cpp otsu.cpp cinterface.cpp clipboard.cpp lnk.cpp dllmain.cpp levenshtein.cpp muteprocess.cpp sapi_dll.cpp simplemecab.cpp SimpleBrowser.cpp MWebBrowser.cpp icon.cpp maglistener.cpp ${versioninfo}) -target_link_libraries(winsharedutils dwmapi) +target_precompile_headers(winsharedutils REUSE_FROM pch) if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) set_target_properties(winsharedutils PROPERTIES OUTPUT_NAME "winsharedutils64") else() set_target_properties(winsharedutils PROPERTIES OUTPUT_NAME "winsharedutils32") endif() - - \ No newline at end of file diff --git a/plugins/winsharedutils/MWebBrowser.cpp b/plugins/winsharedutils/MWebBrowser.cpp index 7b5be724..b27725c7 100644 --- a/plugins/winsharedutils/MWebBrowser.cpp +++ b/plugins/winsharedutils/MWebBrowser.cpp @@ -3,13 +3,6 @@ // This file is public domain software. #include "MWebBrowser.hpp" -#include -#include -#include -#include -#include -#include -#include /*static*/ MWebBrowser * MWebBrowser::Create(HWND hwndParent) diff --git a/plugins/winsharedutils/MWebBrowser.hpp b/plugins/winsharedutils/MWebBrowser.hpp index 1de4e403..6bb39849 100644 --- a/plugins/winsharedutils/MWebBrowser.hpp +++ b/plugins/winsharedutils/MWebBrowser.hpp @@ -6,10 +6,6 @@ #define MWEB_BROWSER_HPP_ 13 // Version 13 #define INITGUID -#include -#include -#include -#include class MWebBrowser : public IOleClientSite, diff --git a/plugins/winsharedutils/SimpleBrowser.cpp b/plugins/winsharedutils/SimpleBrowser.cpp index 7fd049e5..f7e1ba2c 100644 --- a/plugins/winsharedutils/SimpleBrowser.cpp +++ b/plugins/winsharedutils/SimpleBrowser.cpp @@ -8,21 +8,6 @@ // This file is public domain software. #define _CRT_SECURE_NO_WARNINGS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "MWebBrowser.hpp" BOOL GetIEVersion(LPWSTR pszVersion, DWORD cchVersionMax) diff --git a/plugins/winsharedutils/cinterface.cpp b/plugins/winsharedutils/cinterface.cpp index 10f865fb..20c3be3b 100644 --- a/plugins/winsharedutils/cinterface.cpp +++ b/plugins/winsharedutils/cinterface.cpp @@ -1,11 +1,5 @@ #include "define.h" -#include -#include "cinterface.h" -#include -#include -#include -#include void free_all(void *str) { delete str; diff --git a/plugins/winsharedutils/cinterface.h b/plugins/winsharedutils/cinterface.h index f2f7b95c..cf6952b2 100644 --- a/plugins/winsharedutils/cinterface.h +++ b/plugins/winsharedutils/cinterface.h @@ -1,5 +1,3 @@ -#include -#include char **vecstr2c(std::vector &vs); int *vecint2c(std::vector &vs); wchar_t **vecwstr2c(std::vector &vs); \ No newline at end of file diff --git a/plugins/winsharedutils/clipboard.cpp b/plugins/winsharedutils/clipboard.cpp index 2315fa34..b6250d82 100644 --- a/plugins/winsharedutils/clipboard.cpp +++ b/plugins/winsharedutils/clipboard.cpp @@ -1,6 +1,5 @@ #include "define.h" -#include bool tryopenclipboard(HWND hwnd = 0) { bool success = false; diff --git a/plugins/winsharedutils/darklistener.cpp b/plugins/winsharedutils/darklistener.cpp index 6d56ab58..910cac74 100644 --- a/plugins/winsharedutils/darklistener.cpp +++ b/plugins/winsharedutils/darklistener.cpp @@ -1,6 +1,4 @@ -#include -#include -#include + #include "define.h" HANDLE hsema; void IsColorSchemeChangeMessage(LPARAM lParam) diff --git a/plugins/winsharedutils/define.h b/plugins/winsharedutils/define.h index 21c90e6c..d873f61d 100644 --- a/plugins/winsharedutils/define.h +++ b/plugins/winsharedutils/define.h @@ -1,5 +1,4 @@ #pragma once -#include #define DECLARE extern "C" __declspec(dllexport) extern "C" { diff --git a/plugins/winsharedutils/hwnd.cpp b/plugins/winsharedutils/hwnd.cpp index d0fb5972..fae98b01 100644 --- a/plugins/winsharedutils/hwnd.cpp +++ b/plugins/winsharedutils/hwnd.cpp @@ -1,4 +1,3 @@ -#include #include "define.h" DECLARE void showintab(HWND hwnd, bool show) diff --git a/plugins/winsharedutils/levenshtein.cpp b/plugins/winsharedutils/levenshtein.cpp index cc17d014..f1a24f84 100644 --- a/plugins/winsharedutils/levenshtein.cpp +++ b/plugins/winsharedutils/levenshtein.cpp @@ -1,8 +1,5 @@ #include "define.h" -#include -#include -#include size_t lev_u_edit_distance(size_t len1, const wchar_t *string1, size_t len2, const wchar_t *string2, int xcost) diff --git a/plugins/winsharedutils/lnk.cpp b/plugins/winsharedutils/lnk.cpp index 6e27aa6c..eef0df9f 100644 --- a/plugins/winsharedutils/lnk.cpp +++ b/plugins/winsharedutils/lnk.cpp @@ -1,10 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include #include "define.h" void GetLnkTargetPath(wchar_t *lnkFilePath, wchar_t *path, wchar_t *tgtpath, wchar_t *iconpath, wchar_t *dirpath) { diff --git a/plugins/winsharedutils/maglistener.cpp b/plugins/winsharedutils/maglistener.cpp index 79834e31..60ce5610 100644 --- a/plugins/winsharedutils/maglistener.cpp +++ b/plugins/winsharedutils/maglistener.cpp @@ -1,6 +1,3 @@ -#include -#include -#include #include "define.h" static UINT WM_MAGPIE_SCALINGCHANGED = RegisterWindowMessage(L"MagpieScalingChanged"); diff --git a/plugins/winsharedutils/muteprocess.cpp b/plugins/winsharedutils/muteprocess.cpp index afad07b0..34c9c094 100644 --- a/plugins/winsharedutils/muteprocess.cpp +++ b/plugins/winsharedutils/muteprocess.cpp @@ -1,14 +1,5 @@ - -#include -#include -#include -#include -#include -#include -#include #include "define.h" -#pragma comment(lib, "Psapi.lib") class CAudioMgr { public: diff --git a/plugins/winsharedutils/otsu.cpp b/plugins/winsharedutils/otsu.cpp index ecc2c9e6..03dc22e6 100644 --- a/plugins/winsharedutils/otsu.cpp +++ b/plugins/winsharedutils/otsu.cpp @@ -1,10 +1,4 @@ #include "define.h" -#include - -#include -#include -#include - typedef struct { BYTE b; diff --git a/plugins/winsharedutils/sapi_dll.cpp b/plugins/winsharedutils/sapi_dll.cpp index 0c3c0d55..59044e21 100644 --- a/plugins/winsharedutils/sapi_dll.cpp +++ b/plugins/winsharedutils/sapi_dll.cpp @@ -1,9 +1,4 @@  -#include -#include -#include -#include -#include #include "define.h" #include "cinterface.h" bool _Speak(std::wstring &Content, const wchar_t *token, int voiceid, int rate, int volume, std::wstring &FileName) diff --git a/plugins/winsharedutils/simplemecab.cpp b/plugins/winsharedutils/simplemecab.cpp index 694dcbb0..b2aaa9dc 100644 --- a/plugins/winsharedutils/simplemecab.cpp +++ b/plugins/winsharedutils/simplemecab.cpp @@ -1,9 +1,5 @@ #pragma execution_character_set("utf-8") -#include -#include -#include -#include #include "define.h" #include "cinterface.h" struct mecab_node_t diff --git a/plugins/winsharedutils/theme.cpp b/plugins/winsharedutils/theme.cpp index bfa01254..6a24bb8a 100644 --- a/plugins/winsharedutils/theme.cpp +++ b/plugins/winsharedutils/theme.cpp @@ -1,8 +1,4 @@ -#include -#include -#include -#include -#include "define.h" +#include "define.h" // https://github.com/Blinue/Xaml-Islands-Cpp/blob/main/src/XamlIslandsCpp/XamlWindow.h enum WindowBackdrop : int32_t diff --git a/plugins/winsharedutils/version.cpp b/plugins/winsharedutils/version.cpp index 7519892c..1eaf83b6 100644 --- a/plugins/winsharedutils/version.cpp +++ b/plugins/winsharedutils/version.cpp @@ -1,8 +1,5 @@ -#include -#include #include "define.h" -#pragma comment(lib, "Version.lib") bool queryversion(const wchar_t *exe, WORD *_1, WORD *_2, WORD *_3, WORD *_4) {