Skip to content

Commit ba02e4f

Browse files
authored
Use -isystem for port include paths (#21014)
This means that they will get searched after any user include paths. Without this change, since the results of process_args are pre-pended to the compiler flags, it is not possible for the user to override these include paths with their own.
1 parent 249cf8c commit ba02e4f

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.52 (in development)
2222
-----------------------
23+
- Include paths added by ports (e.g. `-sUSE_SDL=2`) now use `-isystem` rather
24+
then `-I`. This means that files in user-specified include directories will
25+
now take precedence over port includes. (#21014)
2326
- Certain settings that only apply when generating JavaScript output will now
2427
trigger a warning if used when generating only Wasm.
2528
- Fix bug where `main` was mistakenly included in debug builds but not in

tools/ports/bullet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def clear(ports, settings, shared):
5252

5353

5454
def process_args(ports):
55-
return ['-I' + ports.get_include_dir('bullet')]
55+
return ['-isystem', ports.get_include_dir('bullet')]
5656

5757

5858
def show():

tools/ports/cocos2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def process_dependencies(settings):
6969
def process_args(ports):
7070
args = []
7171
for include in make_includes(ports.get_include_dir('cocos2d')):
72-
args.append('-I' + include)
72+
args += ['-isystem', include]
7373
return args
7474

7575

tools/ports/freetype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def clear(ports, settings, shared):
112112

113113

114114
def process_args(ports):
115-
return ['-I' + ports.get_include_dir('freetype2')]
115+
return ['-isystem', ports.get_include_dir('freetype2')]
116116

117117

118118
def show():

tools/ports/harfbuzz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def process_dependencies(settings):
148148

149149

150150
def process_args(ports):
151-
return ['-I' + ports.get_include_dir('harfbuzz')]
151+
return ['-isystem', ports.get_include_dir('harfbuzz')]
152152

153153

154154
def show():

tools/ports/sdl2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def linker_setup(ports, settings):
8787

8888

8989
def process_args(ports):
90-
return ['-I' + ports.get_include_dir('SDL2')]
90+
return ['-isystem', ports.get_include_dir('SDL2')]
9191

9292

9393
def show():

0 commit comments

Comments
 (0)