Skip to content

Commit

Permalink
cmake/make: use -isystem for system libc headers
Browse files Browse the repository at this point in the history
using -isystem for the libc standard include directory is the only way
to make it the first candidate for #include <foo> path search, and to
suppress warnings when building 3rd party code including them.
  • Loading branch information
rofl0r committed Mar 29, 2024
1 parent 5ccc22c commit 7c10667
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/base/build.mak
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ FIXUP = psp-fixup-imports
ENC = PrxEncrypter

# Add PSPSDK includes and libraries.
INCDIR := $(INCDIR) . $(PSPDEV)/psp/include $(PSPSDK)/include
INCDIR := $(INCDIR) . $(PSPSDK)/include
LIBDIR := $(LIBDIR) . $(PSPDEV)/psp/lib $(PSPSDK)/lib

CFLAGS := $(addprefix -I,$(INCDIR)) $(CFLAGS)
CFLAGS := -isystem $(PSPDEV)/psp/include $(addprefix -I,$(INCDIR)) $(CFLAGS)
CXXFLAGS := $(CFLAGS) $(CXXFLAGS)
ASFLAGS := $(CFLAGS) $(ASFLAGS)

Expand Down
4 changes: 2 additions & 2 deletions src/base/pspdev.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_PROCESSOR mips)
SET(CMAKE_C_COMPILER psp-gcc)
SET(CMAKE_CXX_COMPILER psp-g++)
SET(CMAKE_C_FLAGS_INIT "-I${PSPDEV}/psp/include -I${PSPDEV}/psp/sdk/include -DPSP")
SET(CMAKE_CXX_FLAGS_INIT "-I${PSPDEV}/psp/include -I${PSPDEV}/psp/sdk/include -DPSP")
SET(CMAKE_C_FLAGS_INIT "-isystem ${PSPDEV}/psp/include -I${PSPDEV}/psp/sdk/include -DPSP")
SET(CMAKE_CXX_FLAGS_INIT "-isystem ${PSPDEV}/psp/include -I${PSPDEV}/psp/sdk/include -DPSP")
SET(CMAKE_EXE_LINKER_FLAGS_INIT "-L${PSPDEV}/lib -L${PSPDEV}/psp/lib -L${PSPDEV}/psp/sdk/lib -Wl,-zmax-page-size=128")
#SET(CMAKE_SHARED_LINKER_FLAGS_INIT "...")
#SET(CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT "...")
Expand Down

0 comments on commit 7c10667

Please sign in to comment.