Skip to content

Commit 25e3602

Browse files
authored
build(cmake): Move most CppMacros.h includes into precompiled headers and make them available in all build targets (TheSuperHackers#2090)
1 parent 8c560e6 commit 25e3602

File tree

48 files changed

+112
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+112
-66
lines changed

Core/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ add_library(corei_libraries_source_wwvegas INTERFACE)
55
add_library(corei_libraries_source_wwvegas_wwlib INTERFACE)
66
add_library(corei_main INTERFACE)
77
add_library(corei_always INTERFACE)
8+
add_library(corei_always_no_pch INTERFACE) # Use this for Shared Libs with MFC AFX
89

910
target_include_directories(corei_gameengine_include INTERFACE "GameEngine/Include")
1011
target_include_directories(corei_libraries_include INTERFACE "Libraries/Include")
@@ -17,6 +18,11 @@ target_link_libraries(corei_always INTERFACE
1718
corei_libraries_include
1819
resources
1920
)
21+
target_link_libraries(corei_always_no_pch INTERFACE
22+
core_utility_no_pch
23+
corei_libraries_include
24+
resources
25+
)
2026

2127
# Set where the build results will end up
2228
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

Core/GameEngine/Include/Common/Debug.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545

4646
#pragma once
4747

48-
#include <Utility/CppMacros.h>
49-
5048
class AsciiString;
5149

5250
#define NO_RELEASE_DEBUG_LOGGING

Core/Libraries/Include/Lib/BaseTypeCore.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <string.h>
3434
// TheSuperHackers @build feliwir 07/04/2025 Adds utility macros for cross-platform compatibility
3535
#include <Utility/compat.h>
36-
#include <Utility/CppMacros.h>
3736
#include <Utility/stdint_adapter.h>
3837

3938
/*

Core/Libraries/Source/Compression/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ target_include_directories(core_compression INTERFACE
3030

3131
target_link_libraries(core_compression PRIVATE
3232
core_config
33-
core_utility
3433
corei_libraries_include
34+
corei_always
3535
)
3636

3737

Core/Libraries/Source/WWVegas/WWLib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ target_include_directories(core_wwlib PUBLIC
176176
)
177177

178178
target_precompile_headers(core_wwlib PRIVATE
179+
[["Utility/CppMacros.h"]] # Must be first, to be removed when abandoning VC6
179180
always.h
180181
STLUtils.h
181182
win.h

Core/Libraries/Source/WWVegas/WWLib/STLUtils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <cstddef>
2323
#include <map>
2424
#include <utility>
25-
#include <Utility/CppMacros.h>
2625

2726
namespace stl
2827
{

Core/Libraries/Source/WWVegas/WWMath/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ target_sources(core_wwmath PRIVATE ${WWMATH_SRC})
8787

8888
target_link_libraries(core_wwmath PRIVATE
8989
core_wwcommon
90+
corei_always
9091
)
9192

9293
# @todo Test its impact and see what to do with the legacy functions.

Core/Libraries/Source/WWVegas/WWSaveLoad/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ target_sources(core_wwsaveload PRIVATE ${WWSAVELOAD_SRC})
4242

4343
target_link_libraries(core_wwsaveload PRIVATE
4444
core_wwcommon
45+
corei_always
4546
)

Core/Libraries/Source/debug/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ target_include_directories(core_debug INTERFACE
3030
)
3131

3232
target_precompile_headers(core_debug PRIVATE
33+
[["Utility/CppMacros.h"]] # Must be first, to be removed when abandoning VC6
3334
"debug.h"
3435
"internal.h"
3536
"internal_except.h"

Core/Libraries/Source/profile/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ target_include_directories(core_profile INTERFACE
2525
)
2626

2727
target_precompile_headers(core_profile PRIVATE
28+
[["Utility/CppMacros.h"]] # Must be first, to be removed when abandoning VC6
2829
"profile.h"
2930
"internal.h"
3031
<windows.h>

0 commit comments

Comments
 (0)