From c1eb744ff0a82cf6c8e3470ac10e2f417c7d9de2 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Mon, 18 May 2020 18:54:51 -0600 Subject: Build: Include headers from LibC, LibM, and LibPthread with -isystem Make sure that userspace is always referencing "system" headers in a way that would build on target :). This means removing the explicit include_directories of Libraries/LibC in favor of having it export its headers as SYSTEM. Also remove a redundant include_directories of Libraries in the 'serenity build' part of the build script. It's already set at the top. This causes issues for the Kernel, and for crt0.o. These special cases are handled individually. --- Libraries/LibC/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Libraries/LibC') diff --git a/Libraries/LibC/CMakeLists.txt b/Libraries/LibC/CMakeLists.txt index d5e94d1b96..feee96aa97 100644 --- a/Libraries/LibC/CMakeLists.txt +++ b/Libraries/LibC/CMakeLists.txt @@ -52,6 +52,8 @@ file(GLOB ELF_SOURCES "../LibELF/*.cpp") set(ELF_SOURCES ${ELF_SOURCES} ../LibELF/Arch/i386/plt_trampoline.S) add_library(crt0 STATIC crt0.cpp) +# We need include headers from LibC in crt0. namely, +target_include_directories(crt0 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) add_custom_command( TARGET crt0 COMMAND install -D $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crt0.o -- cgit v1.2.3