Skip to content

Commit e74de2c

Browse files
committed
fix(build): Decouple WWMath from WWVegas to fix isolated tools CI
Extracted wwmath.h from tight coupling with the 3D engine's always.h macro definitions to establish WWMath as an independent Level 1 base library interface. Exposes Libraries/Source/WWVegas/WWMath and gamemath directly to corei_libraries_include targets, ensuring low-level utilities like Babylon and versionUpdate can compile BaseType.h without transitive rendering dependencies.
1 parent 1444641 commit e74de2c

19 files changed

Lines changed: 26 additions & 18 deletions

File tree

Core/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ add_library(corei_always INTERFACE)
88
add_library(corei_always_no_pch INTERFACE) # Use this for Shared Libs with MFC AFX
99

1010
target_include_directories(corei_gameengine_include INTERFACE "GameEngine/Include")
11-
target_include_directories(corei_libraries_include INTERFACE "Libraries/Include")
11+
target_include_directories(corei_libraries_include INTERFACE "Libraries/Include" "Libraries/Source/WWVegas/WWMath")
12+
if (NOT IS_VS6_BUILD)
13+
target_link_libraries(corei_libraries_include INTERFACE gamemath)
14+
endif()
1215
target_include_directories(corei_libraries_source_wwvegas INTERFACE "Libraries/Source/WWVegas")
1316
target_include_directories(corei_libraries_source_wwvegas_wwlib INTERFACE "Libraries/Source/WWVegas/WWLib")
1417
target_include_directories(corei_main INTERFACE "Main")

Core/GameEngine/Include/GameClient/View.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "Common/Snapshot.h"
3535
#include "Lib/BaseType.h"
3636
#include "WW3D2/coltype.h" ///< we don't generally do this, but we need the W3D collision types
37-
#include "WWMath/wwmath.h"
37+
#include "wwmath.h"
3838

3939
#define DEFAULT_VIEW_WIDTH 640
4040
#define DEFAULT_VIEW_HEIGHT 480

Core/GameEngine/Source/Common/Diagnostic/SimulationMathCrc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "Common/Diagnostic/SimulationMathCrc.h"
2222
#include "Common/XferCRC.h"
2323
#include "WWMath/matrix3d.h"
24-
#include "WWMath/wwmath.h"
24+
#include "wwmath.h"
2525
#include "GameLogic/FPUControl.h"
2626

2727
#include <math.h>

Core/Libraries/Include/Lib/BaseType.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#pragma once
3131

3232
#include "Lib/BaseTypeCore.h"
33-
#include "WWMath/wwmath.h"
33+
#include "wwmath.h"
3434

3535
//-----------------------------------------------------------------------------
3636
typedef wchar_t WideChar; ///< multi-byte character representations

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ target_link_libraries(core_wwmath PRIVATE
9292
)
9393

9494
if (NOT IS_VS6_BUILD)
95-
target_link_libraries(core_wwmath PRIVATE gamemath)
95+
target_link_libraries(core_wwmath PUBLIC gamemath)
9696
endif()
9797

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

Core/Libraries/Source/WWVegas/WWMath/wwmath.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3636

3737

38+
#include "always.h"
3839
#include "wwmath.h"
3940
#include "wwhack.h"
4041
#include "lookuptable.h"

Core/Libraries/Source/WWVegas/WWMath/wwmath.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@
3636

3737
#pragma once
3838

39-
#include "always.h"
39+
#if defined(_MSC_VER)
40+
#define WWINLINE __forceinline
41+
#else
42+
#define WWINLINE inline
43+
#endif
44+
4045
#include <math.h>
4146
#include <float.h>
4247
#include <assert.h>

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static void drawFramerateBar();
8080
#include "W3DDevice/GameClient/W3DDebugDisplay.h"
8181
#include "W3DDevice/GameClient/W3DProjectedShadow.h"
8282
#include "W3DDevice/GameClient/W3DShroud.h"
83-
#include "WWMath/wwmath.h"
83+
#include "wwmath.h"
8484
#include "WWLib/registry.h"
8585
#include "WW3D2/ww3d.h"
8686
#include "WW3D2/predlod.h"

GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// USER INCLUDES //////////////////////////////////////////////////////////////////////////////////
3232
#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
3333

34-
#include "WWMath/wwmath.h"
34+
#include "wwmath.h"
3535

3636
#include "Common/BuildAssistant.h"
3737
#include "Common/GlobalData.h"

GeneralsMD/Code/GameEngine/Source/Common/System/Geometry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define DEFINE_GEOMETRY_NAMES
3232

3333
// USER INCLUDES //////////////////////////////////////////////////////////////////////////////////
34-
#include "WWMath/wwmath.h"
34+
#include "wwmath.h"
3535
#include "Common/Geometry.h"
3636
#include "Common/INI.h"
3737
#include "Common/RandomValue.h"

0 commit comments

Comments
 (0)