Skip to content

Commit b17aa33

Browse files
committed
Revert "SCons: Add CPPEXTPATH for external includes"
1 parent d413181 commit b17aa33

File tree

55 files changed

+220
-147
lines changed

Some content is hidden

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

55 files changed

+220
-147
lines changed

SConstruct

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -469,16 +469,6 @@ for tool in custom_tools:
469469
# Add default include paths.
470470
env.Prepend(CPPPATH=["#"])
471471

472-
# Allow marking includes as external/system to avoid raising warnings.
473-
env["_CCCOMCOM"] += " $_CPPEXTINCFLAGS"
474-
env["CPPEXTPATH"] = []
475-
if env.scons_version < (4, 2):
476-
env["_CPPEXTINCFLAGS"] = "${_concat(EXTINCPREFIX, CPPEXTPATH, EXTINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}"
477-
else:
478-
env["_CPPEXTINCFLAGS"] = (
479-
"${_concat(EXTINCPREFIX, CPPEXTPATH, EXTINCSUFFIX, __env__, RDirs, TARGET, SOURCE, affect_signature=False)}"
480-
)
481-
482472
# configure ENV for platform
483473
env.platform_exporters = platform_exporters
484474
env.platform_apis = platform_apis
@@ -966,19 +956,6 @@ else: # GCC, Clang
966956
if env["werror"]:
967957
env.AppendUnique(CCFLAGS=["-Werror"])
968958

969-
# Configure external includes.
970-
if env.msvc:
971-
if not methods.using_clang(env):
972-
if cc_version_major < 16 or (cc_version_major == 16 and cc_version_minor < 10):
973-
env.AppendUnique(CCFLAGS=["/experimental:external"])
974-
env.AppendUnique(CCFLAGS=["/external:anglebrackets"])
975-
env.AppendUnique(CCFLAGS=["/external:W0"])
976-
env["EXTINCPREFIX"] = "/external:I"
977-
env["EXTINCSUFFIX"] = ""
978-
else:
979-
env["EXTINCPREFIX"] = "-isystem "
980-
env["EXTINCSUFFIX"] = ""
981-
982959
if hasattr(detect, "get_program_suffix"):
983960
suffix = "." + detect.get_program_suffix()
984961
else:

core/SCsub

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ if env["brotli"] and env["builtin_brotli"]:
5151
]
5252
thirdparty_brotli_sources = [thirdparty_brotli_dir + file for file in thirdparty_brotli_sources]
5353

54-
env_thirdparty.Prepend(CPPEXTPATH=[thirdparty_brotli_dir + "include"])
55-
env.Prepend(CPPEXTPATH=[thirdparty_brotli_dir + "include"])
54+
env_thirdparty.Prepend(CPPPATH=[thirdparty_brotli_dir + "include"])
55+
env.Prepend(CPPPATH=[thirdparty_brotli_dir + "include"])
5656

5757
if env.get("use_ubsan") or env.get("use_asan") or env.get("use_tsan") or env.get("use_lsan") or env.get("use_msan"):
5858
env_thirdparty.Append(CPPDEFINES=["BROTLI_BUILD_PORTABLE"])
@@ -69,8 +69,8 @@ if env["builtin_clipper2"]:
6969
]
7070
thirdparty_clipper_sources = [thirdparty_clipper_dir + file for file in thirdparty_clipper_sources]
7171

72-
env_thirdparty.Prepend(CPPEXTPATH=[thirdparty_clipper_dir + "include"])
73-
env.Prepend(CPPEXTPATH=[thirdparty_clipper_dir + "include"])
72+
env_thirdparty.Prepend(CPPPATH=[thirdparty_clipper_dir + "include"])
73+
env.Prepend(CPPPATH=[thirdparty_clipper_dir + "include"])
7474

7575
env_thirdparty.Append(CPPDEFINES=["CLIPPER2_ENABLED"])
7676
env.Append(CPPDEFINES=["CLIPPER2_ENABLED"])
@@ -94,9 +94,9 @@ if env["builtin_zlib"]:
9494
]
9595
thirdparty_zlib_sources = [thirdparty_zlib_dir + file for file in thirdparty_zlib_sources]
9696

97-
env_thirdparty.Prepend(CPPEXTPATH=[thirdparty_zlib_dir])
97+
env_thirdparty.Prepend(CPPPATH=[thirdparty_zlib_dir])
9898
# Needs to be available in main env too
99-
env.Prepend(CPPEXTPATH=[thirdparty_zlib_dir])
99+
env.Prepend(CPPPATH=[thirdparty_zlib_dir])
100100
if env.dev_build:
101101
env_thirdparty.Append(CPPDEFINES=["ZLIB_DEBUG"])
102102
# Affects headers so it should also be defined for Godot code
@@ -151,9 +151,9 @@ if env["builtin_zstd"]:
151151
thirdparty_zstd_sources.append("decompress/huf_decompress_amd64.S")
152152
thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]
153153

154-
env_thirdparty.Prepend(CPPEXTPATH=[thirdparty_zstd_dir, thirdparty_zstd_dir + "common"])
154+
env_thirdparty.Prepend(CPPPATH=[thirdparty_zstd_dir, thirdparty_zstd_dir + "common"])
155155
env_thirdparty.Append(CPPDEFINES=["ZSTD_STATIC_LINKING_ONLY"])
156-
env.Prepend(CPPEXTPATH=thirdparty_zstd_dir)
156+
env.Prepend(CPPPATH=thirdparty_zstd_dir)
157157
# Also needed in main env includes will trigger warnings
158158
env.Append(CPPDEFINES=["ZSTD_STATIC_LINKING_ONLY"])
159159

core/crypto/SCsub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if is_builtin or not has_module:
1313
# Use our headers for builtin or if the module is not going to be compiled.
1414
# We decided not to depend on system mbedtls just for these few files that can
1515
# be easily extracted.
16-
env_crypto.Prepend(CPPEXTPATH=["#thirdparty/mbedtls/include"])
16+
env_crypto.Prepend(CPPPATH=["#thirdparty/mbedtls/include"])
1717

1818
# MbedTLS core functions (for CryptoCore).
1919
# If the mbedtls module is compiled we don't need to add the .c files with our

drivers/backtrace/SCsub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ thirdparty_sources = [
2626
]
2727
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
2828

29-
env_backtrace.Prepend(CPPEXTPATH=[thirdparty_dir])
29+
env_backtrace.Prepend(CPPPATH=[thirdparty_dir])
3030

3131
env_thirdparty = env_backtrace.Clone()
3232
env_thirdparty.disable_warnings()

drivers/d3d12/SCsub

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ thirdparty_obj = []
1515

1616
# DirectX Headers (must take precedence over Windows SDK's).
1717

18-
env.Prepend(CPPEXTPATH=["#thirdparty/directx_headers/include/directx"])
19-
env_d3d12_rdd.Prepend(CPPEXTPATH=["#thirdparty/directx_headers/include/directx"])
20-
env_d3d12_rdd.Prepend(CPPEXTPATH=["#thirdparty/directx_headers/include/dxguids"])
18+
env.Prepend(CPPPATH=["#thirdparty/directx_headers/include/directx"])
19+
env_d3d12_rdd.Prepend(CPPPATH=["#thirdparty/directx_headers/include/directx"])
20+
env_d3d12_rdd.Prepend(CPPPATH=["#thirdparty/directx_headers/include/dxguids"])
2121

2222

2323
# Direct3D 12 Memory Allocator.
2424

25-
env.Append(CPPEXTPATH=["#thirdparty/d3d12ma"])
26-
env_d3d12_rdd.Append(CPPEXTPATH=["#thirdparty/d3d12ma"])
25+
env.Append(CPPPATH=["#thirdparty/d3d12ma"])
26+
env_d3d12_rdd.Append(CPPPATH=["#thirdparty/d3d12ma"])
2727

2828

2929
# Agility SDK.
@@ -38,7 +38,7 @@ if env["agility_sdk_path"] != "" and os.path.exists(env["agility_sdk_path"]):
3838

3939
if env["use_pix"]:
4040
env_d3d12_rdd.Append(CPPDEFINES=["PIX_ENABLED"])
41-
env_d3d12_rdd.Append(CPPEXTPATH=[env["pix_path"] + "/Include"])
41+
env_d3d12_rdd.Append(CPPPATH=[env["pix_path"] + "/Include"])
4242

4343

4444
# Direct composition.
@@ -162,8 +162,6 @@ else:
162162
env.Append(CCFLAGS=["-Wno-unknown-pragmas"])
163163

164164
# This is needed since rendering_device_d3d12.cpp needs to include some Mesa internals.
165-
# FIXME: Should be CPPEXTPATH, but doing so introduces an include-order bug when combined with
166-
# godot-nir-static; this necessitates warning macro wrappers. See #106376.
167165
env_d3d12_rdd.Prepend(CPPPATH=mesa_private_inc_paths)
168166
# For the same reason as above, the defines must be the same as in the 3rd-party code itself.
169167
env_d3d12_rdd.Append(CPPDEFINES=extra_defines)

drivers/d3d12/d3d12ma.cpp

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,35 @@
3434

3535
#include "rendering_device_driver_d3d12.h" // For __REQUIRED_RPCNDR_H_VERSION__.
3636

37-
GODOT_GCC_WARNING_PUSH_AND_IGNORE("-Wmaybe-uninitialized")
37+
GODOT_GCC_WARNING_PUSH
38+
GODOT_GCC_WARNING_IGNORE("-Wduplicated-branches")
39+
GODOT_GCC_WARNING_IGNORE("-Wimplicit-fallthrough")
40+
GODOT_GCC_WARNING_IGNORE("-Wmaybe-uninitialized")
41+
GODOT_GCC_WARNING_IGNORE("-Wmissing-field-initializers")
42+
GODOT_GCC_WARNING_IGNORE("-Wnon-virtual-dtor")
43+
GODOT_GCC_WARNING_IGNORE("-Wnonnull-compare")
44+
GODOT_GCC_WARNING_IGNORE("-Wshadow")
45+
GODOT_GCC_WARNING_IGNORE("-Wsign-compare")
46+
GODOT_GCC_WARNING_IGNORE("-Wswitch")
47+
GODOT_GCC_WARNING_IGNORE("-Wunused-function")
48+
GODOT_GCC_WARNING_IGNORE("-Wunused-variable")
49+
GODOT_CLANG_WARNING_PUSH
50+
GODOT_CLANG_WARNING_IGNORE("-Wimplicit-fallthrough")
51+
GODOT_CLANG_WARNING_IGNORE("-Wmissing-field-initializers")
52+
GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor")
53+
GODOT_CLANG_WARNING_IGNORE("-Wstring-plus-int")
54+
GODOT_CLANG_WARNING_IGNORE("-Wswitch")
55+
GODOT_CLANG_WARNING_IGNORE("-Wtautological-undefined-compare")
56+
GODOT_CLANG_WARNING_IGNORE("-Wunused-but-set-variable")
57+
GODOT_CLANG_WARNING_IGNORE("-Wunused-function")
58+
GODOT_CLANG_WARNING_IGNORE("-Wunused-private-field")
59+
GODOT_CLANG_WARNING_IGNORE("-Wunused-variable")
60+
GODOT_MSVC_WARNING_PUSH
61+
GODOT_MSVC_WARNING_IGNORE(4189) // "Local variable is initialized but not referenced".
62+
GODOT_MSVC_WARNING_IGNORE(4505) // "Unreferenced local function has been removed".
3863

3964
#include <D3D12MemAlloc.cpp>
4065

4166
GODOT_GCC_WARNING_POP
67+
GODOT_CLANG_WARNING_POP
68+
GODOT_MSVC_WARNING_POP

drivers/d3d12/rendering_context_driver_d3d12.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ GODOT_CLANG_WARNING_IGNORE("-Wmissing-field-initializers")
4949
GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor")
5050
GODOT_CLANG_WARNING_IGNORE("-Wstring-plus-int")
5151
GODOT_CLANG_WARNING_IGNORE("-Wswitch")
52-
GODOT_MSVC_WARNING_PUSH
5352

5453
#include <dxcapi.h>
5554

drivers/d3d12/rendering_context_driver_d3d12.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@
3737
#include "servers/display/display_server.h"
3838
#include "servers/rendering/rendering_context_driver.h"
3939

40+
GODOT_GCC_WARNING_PUSH
41+
GODOT_GCC_WARNING_IGNORE("-Wimplicit-fallthrough")
42+
GODOT_GCC_WARNING_IGNORE("-Wmissing-field-initializers")
43+
GODOT_GCC_WARNING_IGNORE("-Wnon-virtual-dtor")
44+
GODOT_GCC_WARNING_IGNORE("-Wshadow")
45+
GODOT_GCC_WARNING_IGNORE("-Wswitch")
46+
GODOT_CLANG_WARNING_PUSH
47+
GODOT_CLANG_WARNING_IGNORE("-Wimplicit-fallthrough")
48+
GODOT_CLANG_WARNING_IGNORE("-Wmissing-field-initializers")
49+
GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor")
50+
GODOT_CLANG_WARNING_IGNORE("-Wstring-plus-int")
51+
GODOT_CLANG_WARNING_IGNORE("-Wswitch")
52+
4053
#if defined(AS)
4154
#undef AS
4255
#endif
@@ -50,6 +63,9 @@
5063

5164
#include <wrl/client.h>
5265

66+
GODOT_GCC_WARNING_POP
67+
GODOT_CLANG_WARNING_POP
68+
5369
using Microsoft::WRL::ComPtr;
5470

5571
#define ARRAY_SIZE(a) std_size(a)

drivers/d3d12/rendering_device_driver_d3d12.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,29 @@
4242
#define __REQUIRED_RPCNDR_H_VERSION__ 475
4343
#endif
4444

45+
GODOT_GCC_WARNING_PUSH
46+
GODOT_GCC_WARNING_IGNORE("-Wimplicit-fallthrough")
47+
GODOT_GCC_WARNING_IGNORE("-Wmissing-field-initializers")
48+
GODOT_GCC_WARNING_IGNORE("-Wnon-virtual-dtor")
49+
GODOT_GCC_WARNING_IGNORE("-Wshadow")
50+
GODOT_GCC_WARNING_IGNORE("-Wswitch")
51+
GODOT_CLANG_WARNING_PUSH
52+
GODOT_CLANG_WARNING_IGNORE("-Wimplicit-fallthrough")
53+
GODOT_CLANG_WARNING_IGNORE("-Wmissing-field-initializers")
54+
GODOT_CLANG_WARNING_IGNORE("-Wnon-virtual-dtor")
55+
GODOT_CLANG_WARNING_IGNORE("-Wstring-plus-int")
56+
GODOT_CLANG_WARNING_IGNORE("-Wswitch")
57+
4558
#include <d3dx12.h>
4659
#include <dxgi1_6.h>
4760
#define D3D12MA_D3D12_HEADERS_ALREADY_INCLUDED
4861
#include <D3D12MemAlloc.h>
4962

5063
#include <wrl/client.h>
5164

65+
GODOT_GCC_WARNING_POP
66+
GODOT_CLANG_WARNING_POP
67+
5268
using Microsoft::WRL::ComPtr;
5369

5470
#ifdef DEV_ENABLED

drivers/d3d12/rendering_shader_container_d3d12.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@
4141
#define __REQUIRED_RPCNDR_H_VERSION__ 475
4242
#endif
4343

44-
#include <d3dx12.h>
45-
#include <dxgi1_6.h>
46-
#define D3D12MA_D3D12_HEADERS_ALREADY_INCLUDED
47-
#include <D3D12MemAlloc.h>
48-
49-
#include <wrl/client.h>
50-
5144
GODOT_GCC_WARNING_PUSH
5245
GODOT_GCC_WARNING_IGNORE("-Wimplicit-fallthrough")
5346
GODOT_GCC_WARNING_IGNORE("-Wlogical-not-parentheses")
@@ -66,6 +59,13 @@ GODOT_MSVC_WARNING_PUSH
6659
GODOT_MSVC_WARNING_IGNORE(4200) // "nonstandard extension used: zero-sized array in struct/union".
6760
GODOT_MSVC_WARNING_IGNORE(4806) // "'&': unsafe operation: no value of type 'bool' promoted to type 'uint32_t' can equal the given constant".
6861

62+
#include <d3dx12.h>
63+
#include <dxgi1_6.h>
64+
#define D3D12MA_D3D12_HEADERS_ALREADY_INCLUDED
65+
#include <D3D12MemAlloc.h>
66+
67+
#include <wrl/client.h>
68+
6969
#include <nir_spirv.h>
7070
#include <nir_to_dxil.h>
7171
#include <spirv_to_dxil.h>

0 commit comments

Comments
 (0)