diff --git a/win/CMakeLists.txt b/win/CMakeLists.txt index 57dc61bfd..efcdbe38d 100644 --- a/win/CMakeLists.txt +++ b/win/CMakeLists.txt @@ -96,6 +96,7 @@ list(SORT INSPIRCD_SOURCES) add_executable("inspircd" ${INSPIRCD_HEADERS} ${INSPIRCD_SOURCES} "${INSPIRCD_BASE}/win/inspircd.rc") add_dependencies("inspircd" "win32memory") target_compile_definitions("inspircd" PRIVATE "FMT_LIB_EXPORT" "INSPIRCD_CORE") +target_precompile_headers("inspircd" PUBLIC "${INSPIRCD_BASE}/include/inspircd.h") set_target_properties("inspircd" PROPERTIES "ENABLE_EXPORTS" ON) target_link_libraries("inspircd" "win32memory") install(TARGETS "inspircd" RUNTIME DESTINATION ".") diff --git a/win/modules/CMakeLists.txt b/win/modules/CMakeLists.txt index 8fc4c3a81..ff10437a3 100644 --- a/win/modules/CMakeLists.txt +++ b/win/modules/CMakeLists.txt @@ -78,6 +78,15 @@ foreach(MODULE_NAME ${INSPIRCD_MODULES}) add_library(${BASE_NAME} MODULE ${MODULE_NAME}) endif() + set(PCH_TARGET "") + if(${PCH_TARGET}) + target_precompile_headers(${BASE_NAME} REUSE_FROM ${PCH_TARGET}) + else() + target_precompile_headers(${BASE_NAME} PUBLIC "${INSPIRCD_BASE}/include/inspircd.h") + set(PCH_TARGET ${BASE_NAME}) + endif() + + # Link against the core and memory library add_dependencies(${BASE_NAME} "inspircd" "win32memory") target_link_libraries(${BASE_NAME} "inspircd" "win32memory")