Skip to content

Commit 6e27c40

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
Reduce and clean up compile-time dependencies. Fix lzo include path for xrGame Release build.
1 parent 884b4db commit 6e27c40

Some content is hidden

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

51 files changed

+3422
-1266
lines changed

res/gamedata/scripts/xr_logic.script

Lines changed: 1514 additions & 0 deletions
Large diffs are not rendered by default.

src/Common/Compiler.inl

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,13 @@
66
#include <intrin.h> // for __debugbreak
77
#endif
88

9-
#if defined(__GNUC__)
10-
#define XR_EXPORT __attribute__((visibility("default")))
11-
#define XR_IMPORT __attribute__((visibility("default")))
12-
#elif defined(_MSC_VER)
13-
#define XR_EXPORT __declspec(dllexport)
14-
#define XR_IMPORT __declspec(dllimport)
15-
#endif
9+
#include "xr_impexp_macros.h"
10+
#include "inlining_macros.h"
1611

1712
#if defined(__GNUC__)
1813
#define XR_ASSUME(expr) if (expr){} else __builtin_unreachable()
1914
#elif defined(_MSC_VER)
2015
#define XR_ASSUME(expr) __assume(expr)
2116
#endif
2217

23-
#if defined(__GNUC__)
24-
#define NO_INLINE __attribute__((noinline))
25-
#define FORCE_INLINE __attribute__((always_inline)) inline
26-
#define ALIGN(a) __attribute__((aligned(a)))
27-
#define DEBUG_BREAK asm("int $3")
28-
#elif defined(_MSC_VER)
29-
#define NO_INLINE __declspec(noinline)
30-
#define FORCE_INLINE __forceinline
31-
#define ALIGN(a) __declspec(align(a))
32-
#define DEBUG_BREAK __debugbreak()
33-
#define __thread __declspec(thread)
34-
#endif
35-
36-
// XXX: remove
37-
#define _inline inline
38-
#define __inline inline
39-
40-
// XXX: remove IC/ICF/ICN
41-
#define IC inline
42-
#define ICF FORCE_INLINE
43-
#define ICN NO_INLINE
44-
4518
#define UNUSED(...) (void)(__VA_ARGS__)

src/Common/inlining_macros.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#ifdef _MSC_VER
2+
#pragma once
3+
#endif
4+
#ifndef INLINING_MACROS_H
5+
#define INLINING_MACROS_H
6+
7+
#if defined(__GNUC__)
8+
#define NO_INLINE __attribute__((noinline))
9+
#define FORCE_INLINE __attribute__((always_inline)) inline
10+
#define ALIGN(a) __attribute__((aligned(a)))
11+
#define DEBUG_BREAK asm("int $3")
12+
#elif defined(_MSC_VER)
13+
#define NO_INLINE __declspec(noinline)
14+
#define FORCE_INLINE __forceinline
15+
#define ALIGN(a) __declspec(align(a))
16+
#define DEBUG_BREAK __debugbreak()
17+
#define __thread __declspec(thread)
18+
#endif
19+
20+
// XXX: remove
21+
#define _inline inline
22+
#define __inline inline
23+
24+
// XXX: remove IC/ICF/ICN
25+
#define IC inline
26+
#define ICF FORCE_INLINE
27+
#define ICN NO_INLINE
28+
29+
#endif

src/Common/xr_impexp_macros.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifdef _MSC_VER
2+
#pragma once
3+
#endif
4+
#ifndef XR_IMPEXP_MACROS_H
5+
#define XR_IMPEXP_MACROS_H
6+
7+
#if defined(__GNUC__)
8+
#define XR_EXPORT __attribute__ ((visibility("default")))
9+
#define XR_IMPORT __attribute__ ((visibility("default")))
10+
#elif defined(_MSC_VER)
11+
#define XR_EXPORT __declspec(dllexport)
12+
#define XR_IMPORT __declspec(dllimport)
13+
#endif
14+
15+
#endif

src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@
467467
<Project>{1daec516-e52c-4a3c-a4da-ae3553e6e0f8}</Project>
468468
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
469469
</ProjectReference>
470+
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
471+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
472+
</ProjectReference>
470473
<ProjectReference Include="..\..\xrScriptEngine\xrScriptEngine.vcxproj">
471474
<Project>{132c62de-de85-4978-9675-c78ed4da46f0}</Project>
472475
<Private>true</Private>

src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@
511511
<Project>{1daec516-e52c-4a3c-a4da-ae3553e6e0f8}</Project>
512512
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
513513
</ProjectReference>
514+
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
515+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
516+
</ProjectReference>
514517
<ProjectReference Include="..\..\xrScriptEngine\xrScriptEngine.vcxproj">
515518
<Project>{132c62de-de85-4978-9675-c78ed4da46f0}</Project>
516519
</ProjectReference>

src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@
559559
<Project>{1daec516-e52c-4a3c-a4da-ae3553e6e0f8}</Project>
560560
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
561561
</ProjectReference>
562+
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
563+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
564+
</ProjectReference>
562565
<ProjectReference Include="..\..\xrScriptEngine\xrScriptEngine.vcxproj">
563566
<Project>{132c62de-de85-4978-9675-c78ed4da46f0}</Project>
564567
</ProjectReference>

src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@
562562
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
563563
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
564564
</ProjectReference>
565+
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
566+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
567+
</ProjectReference>
565568
<ProjectReference Include="..\..\xrEngine\xrEngine.vcxproj">
566569
<Project>{2578c6d8-660d-48ae-9322-7422f8664f06}</Project>
567570
</ProjectReference>

src/engine.sln

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ EndProject
185185
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oalib", "Externals\OpenAutomate\oalib\oalib.vcxproj", "{61D4856F-FA82-4F02-BB88-909DDFB1FE74}"
186186
EndProject
187187
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "Externals\cryptlib.vcxproj", "{C39F4B46-6E89-4074-902E-CA57073044D2}"
188+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrMiscMath_lib", "utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj", "{CC912A26-E688-49F5-99F4-7A0F9AF4E438}"
188189
EndProject
189190
Global
190191
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -913,6 +914,42 @@ Global
913914
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release_Dedicated|Win32.Build.0 = Release|Win32
914915
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|Win32.ActiveCfg = Release|Win32
915916
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|Win32.Build.0 = Release|Win32
917+
{614AA57F-58D7-45A8-A5FF-93F04B05FAC6}.Release|x64.ActiveCfg = Release|x64
918+
{614AA57F-58D7-45A8-A5FF-93F04B05FAC6}.Release|x64.Build.0 = Release|x64
919+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|Mixed Platforms.ActiveCfg = Debug|Win32
920+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|Mixed Platforms.Build.0 = Debug|Win32
921+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|Win32.ActiveCfg = Debug|Win32
922+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|Win32.Build.0 = Debug|Win32
923+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|x64.ActiveCfg = Release|Win32
924+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|x64.Build.0 = Release|Win32
925+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
926+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|Mixed Platforms.Build.0 = Debug|Win32
927+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|Win32.ActiveCfg = Debug|Win32
928+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|Win32.Build.0 = Debug|Win32
929+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|x64.ActiveCfg = Debug|Win32
930+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|Mixed Platforms.ActiveCfg = Release|Win32
931+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|Mixed Platforms.Build.0 = Release|Win32
932+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|Win32.ActiveCfg = Release|Win32
933+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|Win32.Build.0 = Release|Win32
934+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|x64.ActiveCfg = Release|Win32
935+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|x64.Build.0 = Release|Win32
936+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|Mixed Platforms.ActiveCfg = Release|Win32
937+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|Mixed Platforms.Build.0 = Release|Win32
938+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|Win32.ActiveCfg = Release|Win32
939+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|Win32.Build.0 = Release|Win32
940+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|x64.ActiveCfg = Release|Win32
941+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|x64.Build.0 = Release|Win32
942+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|Mixed Platforms.ActiveCfg = Release|Win32
943+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|Mixed Platforms.Build.0 = Release|Win32
944+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|Win32.ActiveCfg = Release|Win32
945+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|Win32.Build.0 = Release|Win32
946+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|x64.ActiveCfg = Release|Win32
947+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|x64.Build.0 = Release|Win32
948+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|Mixed Platforms.ActiveCfg = Release|Win32
949+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|Mixed Platforms.Build.0 = Release|Win32
950+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|Win32.ActiveCfg = Release|Win32
951+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|Win32.Build.0 = Release|Win32
952+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|x64.ActiveCfg = Release|Win32
916953
EndGlobalSection
917954
GlobalSection(SolutionProperties) = preSolution
918955
HideSolutionNode = FALSE
@@ -976,6 +1013,7 @@ Global
9761013
{848E8AB3-9962-4C04-B813-5690399C8A3E} = {2BFC806B-CE92-4EA4-8FE8-5F2EA54BA348}
9771014
{61D4856F-FA82-4F02-BB88-909DDFB1FE74} = {2BFC806B-CE92-4EA4-8FE8-5F2EA54BA348}
9781015
{C39F4B46-6E89-4074-902E-CA57073044D2} = {2BFC806B-CE92-4EA4-8FE8-5F2EA54BA348}
1016+
{CC912A26-E688-49F5-99F4-7A0F9AF4E438} = {89F6A7EE-3BBE-45D3-A8A8-5D9366CD987B}
9791017
EndGlobalSection
9801018
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
9811019
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}

src/plugins/Max/MAX_Export60.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@
253253
<None Include="Export\Utility.def" />
254254
</ItemGroup>
255255
<ItemGroup>
256+
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
257+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
258+
</ProjectReference>
256259
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
257260
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
258261
</ProjectReference>

src/plugins/Maya/Maya_Export2008.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@
324324
<None Include="Export\xraySkinMotionExportOptions.mel" />
325325
</ItemGroup>
326326
<ItemGroup>
327+
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
328+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
329+
</ProjectReference>
327330
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
328331
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
329332
</ProjectReference>

src/plugins/Maya/Maya_Export2009.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@
322322
<None Include="..\..\editors\ECore\WildMagic\WmlVector4.inl" />
323323
</ItemGroup>
324324
<ItemGroup>
325+
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
326+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
327+
</ProjectReference>
325328
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
326329
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
327330
</ProjectReference>

src/plugins/lw/LW_Export80.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@
413413
<ClInclude Include="Export\stdafx.h" />
414414
</ItemGroup>
415415
<ItemGroup>
416+
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
417+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
418+
</ProjectReference>
416419
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
417420
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
418421
</ProjectReference>

src/utils/ETools/ETools.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@
270270
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
271271
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
272272
</ProjectReference>
273+
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
274+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
275+
</ProjectReference>
273276
<ProjectReference Include="..\xrQSlim\xrQSlim.vcxproj">
274277
<Project>{f1836ce2-59ef-4189-8b9c-d103a511cb27}</Project>
275278
</ProjectReference>

src/utils/xrAI/xrAI.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@
327327
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
328328
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
329329
</ProjectReference>
330+
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
331+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
332+
</ProjectReference>
330333
</ItemGroup>
331334
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
332335
<ImportGroup Label="ExtensionTargets">

src/utils/xrDXT/DXT.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@
241241
<ProjectReference Include="$(SolutionDir)xrCore\xrCore.vcxproj">
242242
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
243243
</ProjectReference>
244+
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
245+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
246+
</ProjectReference>
244247
</ItemGroup>
245248
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
246249
<ImportGroup Label="ExtensionTargets">

src/utils/xrLC/b_globals.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ const u32 c_PM_FaceLimit = 128; // face-limit
99
const float c_PM_MetricLimit_static = 0.10f; // vertex-count-simplification-limit
1010
const float c_PM_MetricLimit_mu = 0.05f; // vertex-count-simplification-limit
1111

12-
BOOL exact_normalize(Fvector3& a);
13-
BOOL exact_normalize(float* a);
12+
// XXX: The following two 'exact_normalize' are also declared in xrCore/_vector3d.h
13+
bool exact_normalize(Fvector3& a);
14+
bool exact_normalize(float* a);
1415

1516
struct SBuildOptions
1617
{

src/utils/xrLC/xrLC.vcxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@
315315
<ClCompile Include="xrSectors.cpp" />
316316
<ClCompile Include="xrT_Junction.cpp" />
317317
</ItemGroup>
318+
<ItemGroup>
319+
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
320+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
321+
</ProjectReference>
322+
</ItemGroup>
318323
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
319324
<ImportGroup Label="ExtensionTargets">
320325
</ImportGroup>

src/utils/xrLC_Light/xrLC_Light.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@
352352
</ProjectReference>
353353
<ProjectReference Include="..\..\Externals\zlib.vcxproj">
354354
<Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project>
355+
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
356+
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
355357
</ProjectReference>
356358
</ItemGroup>
357359
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

0 commit comments

Comments
 (0)