Skip to content

Commit

Permalink
Use -isystem for port include paths (#21014)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sbc100 authored Jan 5, 2024
1 parent 249cf8c commit ba02e4f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ See docs/process.md for more on how version tagging works.

3.1.52 (in development)
-----------------------
- Include paths added by ports (e.g. `-sUSE_SDL=2`) now use `-isystem` rather
then `-I`. This means that files in user-specified include directories will
now take precedence over port includes. (#21014)
- Certain settings that only apply when generating JavaScript output will now
trigger a warning if used when generating only Wasm.
- Fix bug where `main` was mistakenly included in debug builds but not in
Expand Down
2 changes: 1 addition & 1 deletion tools/ports/bullet.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def clear(ports, settings, shared):


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


def show():
Expand Down
2 changes: 1 addition & 1 deletion tools/ports/cocos2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def process_dependencies(settings):
def process_args(ports):
args = []
for include in make_includes(ports.get_include_dir('cocos2d')):
args.append('-I' + include)
args += ['-isystem', include]
return args


Expand Down
2 changes: 1 addition & 1 deletion tools/ports/freetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def clear(ports, settings, shared):


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


def show():
Expand Down
2 changes: 1 addition & 1 deletion tools/ports/harfbuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def process_dependencies(settings):


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


def show():
Expand Down
2 changes: 1 addition & 1 deletion tools/ports/sdl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def linker_setup(ports, settings):


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


def show():
Expand Down

0 comments on commit ba02e4f

Please sign in to comment.