From ebfe302398df1dbe74f214e06b0b45184e84bf2b Mon Sep 17 00:00:00 2001 From: Jonathan Poelen Date: Mon, 9 Nov 2020 01:44:36 +0100 Subject: toolchain: remove includedirs and linkdirs of system path /usr/{local/,}include and /usr/{local/,}lib are in the default configuration of the compilers and forcing them to be added (before any other includes) conflicts with the project files. --- xmake/toolchains/clang/xmake.lua | 14 -------------- xmake/toolchains/gcc/xmake.lua | 14 -------------- xmake/toolchains/icc/load.lua | 12 ------------ xmake/toolchains/xcode/load_macosx.lua | 5 ----- 4 files changed, 45 deletions(-) diff --git a/xmake/toolchains/clang/xmake.lua b/xmake/toolchains/clang/xmake.lua index b459139ac..c8e90d4e7 100644 --- a/xmake/toolchains/clang/xmake.lua +++ b/xmake/toolchains/clang/xmake.lua @@ -62,18 +62,4 @@ toolchain("clang") toolchain:add("ldflags", march) toolchain:add("shflags", march) end - - -- add includedirs and linkdirs - if not toolchain:is_plat("windows") and os.isdir("/usr") then - for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do - if os.isdir(includedir) then - toolchain:add("includedirs", includedir) - end - end - for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do - if os.isdir(linkdir) then - toolchain:add("linkdirs", linkdir) - end - end - end end) diff --git a/xmake/toolchains/gcc/xmake.lua b/xmake/toolchains/gcc/xmake.lua index 71887a374..9365fc38b 100644 --- a/xmake/toolchains/gcc/xmake.lua +++ b/xmake/toolchains/gcc/xmake.lua @@ -62,18 +62,4 @@ toolchain("gcc") toolchain:add("ldflags", march) toolchain:add("shflags", march) end - - -- add includedirs and linkdirs - if not toolchain:is_plat("windows") and os.isdir("/usr") then - for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do - if os.isdir(includedir) then - toolchain:add("includedirs", includedir) - end - end - for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do - if os.isdir(linkdir) then - toolchain:add("linkdirs", linkdir) - end - end - end end) diff --git a/xmake/toolchains/icc/load.lua b/xmake/toolchains/icc/load.lua index b3dbf589f..0792869e8 100644 --- a/xmake/toolchains/icc/load.lua +++ b/xmake/toolchains/icc/load.lua @@ -103,18 +103,6 @@ function _load_intel_on_linux(toolchain) toolchain:add("ldflags", march) toolchain:add("shflags", march) end - - -- add includedirs and linkdirs - for _, includedir in ipairs({"/usr/local/include", "/usr/include"}) do - if os.isdir(includedir) then - toolchain:add("includedirs", includedir) - end - end - for _, linkdir in ipairs({"/usr/local/lib", "/usr/lib"}) do - if os.isdir(linkdir) then - toolchain:add("linkdirs", linkdir) - end - end end -- main entry diff --git a/xmake/toolchains/xcode/load_macosx.lua b/xmake/toolchains/xcode/load_macosx.lua index 1357b8c08..8b5241b45 100644 --- a/xmake/toolchains/xcode/load_macosx.lua +++ b/xmake/toolchains/xcode/load_macosx.lua @@ -47,11 +47,6 @@ function main(toolchain) if xcode_sdkdir then toolchain:add("cxflags", "-isysroot " .. xcode_sdkdir) toolchain:add("ldflags", "-isysroot " .. xcode_sdkdir) - else - toolchain:add("includedirs", "/usr/local/include") - toolchain:add("includedirs", "/usr/include") - toolchain:add("linkdirs", "/usr/local/lib") - toolchain:add("linkdirs", "/usr/lib") end toolchain:add("ldflags", "-stdlib=libc++") toolchain:add("syslinks", "z") -- cgit v1.3.1