diff options
| author | ruki <[email protected]> | 2020-11-10 22:38:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-10 11:33:28 +0800 |
| commit | c84a362b39d566dc21160b8171c5ec389dbc5e3b (patch) | |
| tree | 4b0884aabe79c67c2c7a93791a45495f10ac3c21 | |
| parent | a894334e3c80f9c13a0e64f5ce2f96b57726f186 (diff) | |
switch system includedirs for toolchains
| -rw-r--r-- | xmake/toolchains/llvm/xmake.lua | 13 | ||||
| -rw-r--r-- | xmake/toolchains/ndk/load.lua | 14 | ||||
| -rw-r--r-- | xmake/toolchains/sdcc/xmake.lua | 13 | ||||
| -rw-r--r-- | xmake/toolchains/tinyc/xmake.lua | 8 |
4 files changed, 11 insertions, 37 deletions
diff --git a/xmake/toolchains/llvm/xmake.lua b/xmake/toolchains/llvm/xmake.lua index 77010ff76..50a04fadf 100644 --- a/xmake/toolchains/llvm/xmake.lua +++ b/xmake/toolchains/llvm/xmake.lua @@ -61,19 +61,6 @@ toolchain("llvm") toolchain:add("shflags", march) end - -- init linkdirs and includedirs - local sdkdir = toolchain:sdkdir() - if sdkdir then - local includedir = path.join(sdkdir, "include") - if os.isdir(includedir) then - toolchain:add("includedirs", includedir) - end - local linkdir = path.join(sdkdir, "lib") - if os.isdir(linkdir) then - toolchain:add("linkdirs", linkdir) - end - end - -- add bin search library for loading some dependent .dll files windows local bindir = toolchain:bindir() if bindir and is_host("windows") then diff --git a/xmake/toolchains/ndk/load.lua b/xmake/toolchains/ndk/load.lua index 10ec78557..a3733d28f 100644 --- a/xmake/toolchains/ndk/load.lua +++ b/xmake/toolchains/ndk/load.lua @@ -254,25 +254,25 @@ function main(toolchain) toolchain:add("linkdirs", format("%s/libs/%s", cxxstl_sdkdir, toolchains_arch)) end if ndk_cxxstl:startswith("c++") or ndk_cxxstl:startswith("llvmstl") then - toolchain:add("includedirs", format("%s/include", cxxstl_sdkdir)) + toolchain:add("sysincludedirs", format("%s/include", cxxstl_sdkdir)) if toolchains_arch then - toolchain:add("includedirs", format("%s/libs/%s/include", cxxstl_sdkdir, toolchains_arch)) + toolchain:add("sysincludedirs", format("%s/libs/%s/include", cxxstl_sdkdir, toolchains_arch)) end local abi_path = path.join(ndk, "sources", "cxx-stl", "llvm-libc++abi") local before_r13 = path.join(abi_path, "libcxxabi") local after_r13 = path.join(abi_path, "include") if os.isdir(before_r13) then - toolchain:add("includedirs", before_r13) + toolchain:add("sysincludedirs", before_r13) elseif os.isdir(after_r13) then - toolchain:add("includedirs", after_r13) + toolchain:add("sysincludedirs", after_r13) end elseif ndk_cxxstl:startswith("gnustl") then - toolchain:add("includedirs", format("%s/include", cxxstl_sdkdir)) + toolchain:add("sysincludedirs", format("%s/include", cxxstl_sdkdir)) if toolchains_arch then - toolchain:add("includedirs", format("%s/libs/%s/include", cxxstl_sdkdir, toolchains_arch)) + toolchain:add("sysincludedirs", format("%s/libs/%s/include", cxxstl_sdkdir, toolchains_arch)) end elseif ndk_cxxstl:startswith("stlport") then - toolchain:add("includedirs", format("%s/stlport", cxxstl_sdkdir)) + toolchain:add("sysincludedirs", format("%s/stlport", cxxstl_sdkdir)) end -- add c++ stl links diff --git a/xmake/toolchains/sdcc/xmake.lua b/xmake/toolchains/sdcc/xmake.lua index 86d4bdd67..debd6ba08 100644 --- a/xmake/toolchains/sdcc/xmake.lua +++ b/xmake/toolchains/sdcc/xmake.lua @@ -53,19 +53,6 @@ toolchain("sdcc") -- on load on_load(function (toolchain) - -- init linkdirs and includedirs - local sdkdir = toolchain:sdkdir() - if sdkdir then - local includedir = path.join(sdkdir, "include") - if os.isdir(includedir) then - toolchain:add("includedirs", includedir) - end - local linkdir = path.join(sdkdir, "lib") - if os.isdir(linkdir) then - toolchain:add("linkdirs", linkdir) - end - end - -- add port flags for arch local arch = toolchain:arch() if arch then diff --git a/xmake/toolchains/tinyc/xmake.lua b/xmake/toolchains/tinyc/xmake.lua index 8eb6f79f4..b5921b08f 100644 --- a/xmake/toolchains/tinyc/xmake.lua +++ b/xmake/toolchains/tinyc/xmake.lua @@ -76,17 +76,17 @@ toolchain("tinyc") toolchain:add("shflags", march) end - -- init linkdirs and includedirs + -- init linkdirs and sysincludedirs local sdkdir = config.get("__tcc_sdkdir") or toolchain:sdkdir() if sdkdir then local includedir = path.join(sdkdir, "include") if os.isdir(includedir) then - toolchain:add("includedirs", includedir) + toolchain:add("sysincludedirs", includedir) end local winenv_tcc_winapi = path.join(os.programdir(), "winenv", "tcc", "winapi", "include") if is_host("windows") and os.isdir(winenv_tcc_winapi) then - toolchain:add("includedirs", winenv_tcc_winapi) - toolchain:add("includedirs", path.join(winenv_tcc_winapi, "winapi")) + toolchain:add("sysincludedirs", winenv_tcc_winapi) + toolchain:add("sysincludedirs", path.join(winenv_tcc_winapi, "winapi")) end local linkdir = path.join(sdkdir, "lib") if os.isdir(linkdir) then |
