diff options
| author | ruki <[email protected]> | 2026-02-11 09:51:35 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-11 09:51:35 +0800 |
| commit | 55648bbba1a1d822cc3130d5ac638ddc276dbf71 (patch) | |
| tree | 98452a2614431ffb8735819f4e4eb49fc27942d6 /xmake/toolchains/xcode | |
| parent | de97caa61ab95c3a422dc9c494370f513e4ef535 (diff) | |
| parent | 2e9e484793bc705d2f0c2911040ca87e753eb205 (diff) | |
Merge pull request #7311 from xmake-io/xcode
Improve Xcode toolchain
Diffstat (limited to 'xmake/toolchains/xcode')
| -rw-r--r-- | xmake/toolchains/xcode/check.lua | 6 | ||||
| -rw-r--r-- | xmake/toolchains/xcode/load.lua | 140 | ||||
| -rw-r--r-- | xmake/toolchains/xcode/load_appletvos.lua | 26 | ||||
| -rw-r--r-- | xmake/toolchains/xcode/load_applexros.lua | 26 | ||||
| -rw-r--r-- | xmake/toolchains/xcode/load_iphoneos.lua | 25 | ||||
| -rw-r--r-- | xmake/toolchains/xcode/load_macosx.lua | 88 | ||||
| -rw-r--r-- | xmake/toolchains/xcode/load_platform.lua | 59 | ||||
| -rw-r--r-- | xmake/toolchains/xcode/load_watchos.lua | 26 | ||||
| -rw-r--r-- | xmake/toolchains/xcode/xmake.lua | 42 |
9 files changed, 145 insertions, 293 deletions
diff --git a/xmake/toolchains/xcode/check.lua b/xmake/toolchains/xcode/check.lua index 5797170f5..b73ea426a 100644 --- a/xmake/toolchains/xcode/check.lua +++ b/xmake/toolchains/xcode/check.lua @@ -22,6 +22,7 @@ import("core.base.option") import("core.project.config") import("detect.sdks.find_xcode") +import("private.utils.toolchain", {alias = "toolchain_utils"}) import("private.utils.executable_path") import("private.tools.codesign") @@ -32,8 +33,9 @@ function _show_checkinfo(toolchain, xcode, xcode_sdkver, target_minver) if xcode_sdkver then table.insert(extras, "sdk: " .. xcode_sdkver) end - if target_minver then - table.insert(extras, "target: " .. target_minver) + local target_triple = toolchain_utils.get_xcode_target_triple(toolchain) + if target_triple then + table.insert(extras, target_triple) end local extra = "" if #extras > 0 then diff --git a/xmake/toolchains/xcode/load.lua b/xmake/toolchains/xcode/load.lua new file mode 100644 index 000000000..4dd0241db --- /dev/null +++ b/xmake/toolchains/xcode/load.lua @@ -0,0 +1,140 @@ +--!A cross-toolchain build utility based on Lua +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +-- Copyright (C) 2015-present, Xmake Open Source Community. +-- +-- @author ruki +-- @file load.lua +-- +-- imports +import("private.utils.toolchain", {alias = "toolchain_utils"}) + +-- set toolset programs from xcode toolchain bindir/arch/appledev +function _set_toolset(toolchain, appledev) + + local bindir = toolchain:bindir() + local arch = toolchain:arch() + local xc_clang = bindir and path.join(bindir, "clang") or "clang" + local xc_clangxx = bindir and path.join(bindir, "clang++") or "clang++" + local xc_ar = bindir and path.join(bindir, "ar") or "ar" + local xc_strip = bindir and path.join(bindir, "strip") or "strip" + local xc_swift_frontend = bindir and path.join(bindir, "swift-frontend") or "swift-frontend" + local xc_swiftc = bindir and path.join(bindir, "swiftc") or "swiftc" + local xc_dsymutil = bindir and path.join(bindir, "dsymutil") or "dsymutil" + + toolchain:set("toolset", "cc", xc_clang) + toolchain:set("toolset", "cxx", xc_clangxx, xc_clang) + toolchain:set("toolset", "ld", xc_clangxx, xc_clang) + toolchain:set("toolset", "sh", xc_clangxx, xc_clang) + toolchain:set("toolset", "ar", xc_ar) + toolchain:set("toolset", "strip", xc_strip) + toolchain:set("toolset", "dsymutil", xc_dsymutil, "dsymutil") + toolchain:set("toolset", "mm", xc_clang) + toolchain:set("toolset", "mxx", xc_clangxx, xc_clang) + toolchain:set("toolset", "sc", xc_swift_frontend, "swift_frontend", xc_swiftc, "swiftc") + toolchain:set("toolset", "scld", xc_swiftc, "swiftc") + toolchain:set("toolset", "scsh", xc_swiftc, "swiftc") + toolchain:set("toolset", "scar", xc_swiftc, "swiftc") + if arch then + toolchain:set("toolset", "cpp", xc_clang .. " -arch " .. arch .. " -E") + end + if toolchain:is_plat("macosx") then + toolchain:set("toolset", "as", xc_clang) + elseif appledev == "simulator" or appledev == "catalyst" then + toolchain:set("toolset", "as", xc_clang) + else + toolchain:set("toolset", "as", path.join(os.programdir(), "scripts", "gas-preprocessor.pl " .. xc_clang)) + end +end + +-- add platform-independent flags for xcode toolchain +function _add_common_flags(toolchain, xcode_sysroot) + + -- init target triple flags + local targetflag = {"-target", toolchain_utils.get_xcode_target_triple(toolchain)} + + -- init flags for c/c++ + toolchain:add("cxflags", targetflag, "-isysroot", xcode_sysroot) + if toolchain:is_plat("macosx") then + toolchain:add("ldflags", targetflag, "-isysroot", xcode_sysroot, "-lz") + toolchain:add("shflags", targetflag, "-isysroot", xcode_sysroot, "-lz") + else + toolchain:add("ldflags", targetflag, "-isysroot", xcode_sysroot, "-ObjC", "-fobjc-link-runtime") + toolchain:add("shflags", targetflag, "-isysroot", xcode_sysroot, "-ObjC", "-fobjc-link-runtime") + end + + -- init flags for objc/c++ + toolchain:add("mxflags", targetflag, "-isysroot", xcode_sysroot) + + -- we can use `add_mxflags("-fno-objc-arc")` to override it in xmake.lua + toolchain:add("mxflags", "-fobjc-arc") + + -- init flags for asm + toolchain:add("asflags", targetflag, "-isysroot", xcode_sysroot) + + -- init flags for swift + toolchain:add("scflags", {"-sdk", xcode_sysroot}, targetflag) + toolchain:add("scshflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-library") + toolchain:add("scarflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-library", "-static") + toolchain:add("scldflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-executable") +end + +-- add extra headers/libs/frameworks for catalyst (macosx + appledev=catalyst) +function _add_catalyst_support(toolchain, xcode_sysroot) + + toolchain:add("cxflags", {"-I", path.join(xcode_sysroot, "System/iOSSupport/usr/include")}) + toolchain:add("mxflags", {"-I", path.join(xcode_sysroot, "System/iOSSupport/usr/include")}) + + toolchain:add("asflags", {"-I", path.join(xcode_sysroot, "System/iOSSupport/usr/include")}) + toolchain:add("ldflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) + toolchain:add("shflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) + + toolchain:add("scflags", {"-I", path.join(xcode_sysroot, "System/iOSSupport/usr/include")}) + toolchain:add("scldflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) + toolchain:add("scshflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) + toolchain:add("scarflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) + + toolchain:add("cxflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) + toolchain:add("mxflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) + + toolchain:add("asflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) + toolchain:add("ldflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) + toolchain:add("shflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) + + toolchain:add("scflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) + toolchain:add("scshflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) + toolchain:add("scarflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) + toolchain:add("scldflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) +end + +-- main entry +function main(toolchain) + + local appledev = toolchain:config("appledev") + local xcode_sysroot = toolchain:config("xcode_sysroot") + if toolchain:is_plat("macosx") then + assert(appledev ~= "simulator") + end + + -- init toolset + _set_toolset(toolchain, appledev) + + -- init flags + _add_common_flags(toolchain, xcode_sysroot) + + -- init extra flags for catalyst + if toolchain:is_plat("macosx") and xcode_sysroot and appledev == "catalyst" then + _add_catalyst_support(toolchain, xcode_sysroot) + end +end diff --git a/xmake/toolchains/xcode/load_appletvos.lua b/xmake/toolchains/xcode/load_appletvos.lua deleted file mode 100644 index cc3382a06..000000000 --- a/xmake/toolchains/xcode/load_appletvos.lua +++ /dev/null @@ -1,26 +0,0 @@ ---!A cross-toolchain build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file load_appletvos.lua --- - -import("load_platform") - -function main(toolchain) - load_platform(toolchain, "tvos") -end - diff --git a/xmake/toolchains/xcode/load_applexros.lua b/xmake/toolchains/xcode/load_applexros.lua deleted file mode 100644 index 497c5024c..000000000 --- a/xmake/toolchains/xcode/load_applexros.lua +++ /dev/null @@ -1,26 +0,0 @@ ---!A cross-toolchain build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file load_applexros.lua --- - -import("load_platform") - -function main(toolchain) - load_platform(toolchain, "xros") -end - diff --git a/xmake/toolchains/xcode/load_iphoneos.lua b/xmake/toolchains/xcode/load_iphoneos.lua deleted file mode 100644 index 7c7df157a..000000000 --- a/xmake/toolchains/xcode/load_iphoneos.lua +++ /dev/null @@ -1,25 +0,0 @@ ---!A cross-toolchain build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file load_iphoneos.lua --- - -import("load_platform") - -function main(toolchain) - load_platform(toolchain, "ios") -end diff --git a/xmake/toolchains/xcode/load_macosx.lua b/xmake/toolchains/xcode/load_macosx.lua deleted file mode 100644 index ff484736b..000000000 --- a/xmake/toolchains/xcode/load_macosx.lua +++ /dev/null @@ -1,88 +0,0 @@ ---!A cross-toolchain build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file load_macosx.lua --- - -function main(toolchain) - -- init architecture - local arch = toolchain:arch() - local xcode_sysroot = toolchain:config("xcode_sysroot") - - -- is simulator? - local appledev = toolchain:config("appledev") - local simulator = appledev == "simulator" - assert(not simulator) - local catalyst = appledev == "catalyst" - - -- init target minimal version - local target_minver = toolchain:config("target_minver") - local targetflag = format("%s-apple-macos", arch) - if target_minver then - targetflag = targetflag .. target_minver - end - if catalyst then - targetflag = targetflag .. "-macabi" - end - targetflag = {"-target", targetflag} - - -- init flags for c/c++ - toolchain:add("cxflags", {"-arch", arch}, targetflag, {"-isysroot", xcode_sysroot}) - toolchain:add("ldflags", {"-arch", arch}, targetflag, {"-isysroot", xcode_sysroot}, "-lz") - toolchain:add("shflags", {"-arch", arch}, targetflag, {"-isysroot", xcode_sysroot}, "-lz") - - -- init flags for objc/c++ - toolchain:add("mxflags", {"-arch", arch}, targetflag, {"-isysroot", xcode_sysroot}) - - -- we can use `add_mxflags("-fno-objc-arc")` to override it in xmake.lua - toolchain:add("mxflags", "-fobjc-arc") - - -- init flags for asm - toolchain:add("asflags", {"-arch", arch}, targetflag, "-isysroot", xcode_sysroot) - - -- init flags for swift (with toolchain:add("ldflags and toolchain:add("shflags) - toolchain:add("scflags", {"-sdk", xcode_sysroot}, targetflag) - toolchain:add("scshflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-library") - toolchain:add("scarflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-library", "-static") - toolchain:add("scldflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-executable") - - if xcode_sysroot and catalyst then - toolchain:add("cxflags", {"-I", path.join(xcode_sysroot, "System/iOSSupport/usr/include")}) - toolchain:add("mxflags", {"-I", path.join(xcode_sysroot, "System/iOSSupport/usr/include")}) - - toolchain:add("asflags", {"-I", path.join(xcode_sysroot, "System/iOSSupport/usr/include")}) - toolchain:add("ldflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) - toolchain:add("shflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) - - toolchain:add("scflags", {"-I", path.join(xcode_sysroot, "System/iOSSupport/usr/include")}) - toolchain:add("scldflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) - toolchain:add("scshflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) - toolchain:add("scarflags", {"-L", path.join(xcode_sysroot, "System/iOSSupport/usr/lib")}) - - toolchain:add("cxflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - toolchain:add("mxflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - - toolchain:add("asflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - toolchain:add("ldflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - toolchain:add("shflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - - toolchain:add("scflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - toolchain:add("scshflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - toolchain:add("scarflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - toolchain:add("scldflags", {"-iframework", path.join(xcode_sysroot, "System/iOSSupport/System/Library/Frameworks")}) - end -end diff --git a/xmake/toolchains/xcode/load_platform.lua b/xmake/toolchains/xcode/load_platform.lua deleted file mode 100644 index 74c5c616f..000000000 --- a/xmake/toolchains/xcode/load_platform.lua +++ /dev/null @@ -1,59 +0,0 @@ ---!A cross-toolchain build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file load_platform.lua --- - -function main(toolchain, plat) - -- init architecture - local arch = toolchain:arch() - local xcode_sysroot = toolchain:config("xcode_sysroot") - - -- is simulator? - local appledev = toolchain:config("appledev") - local simulator = appledev == "simulator" - - -- init target minimal version - local target_minver = toolchain:config("target_minver") - if target_minver then - if plat == "ios" and tonumber(target_minver) > 10 and (arch == "armv7" or arch == "armv7s" or arch == "i386") then - target_minver = "10" -- iOS 10 is the maximum deployment target for 32-bit targets - end - end - local targetflag = format("%s-apple-%s%s%s", arch, plat, target_minver or "", simulator and "-simulator" or "") - targetflag = {"-target", targetflag} - - -- init flags for c/c++ - toolchain:add("cxflags", {"-arch", arch}, targetflag, "-isysroot", xcode_sysroot) - toolchain:add("ldflags", {"-arch", arch}, targetflag, "-isysroot", xcode_sysroot, "-ObjC", "-fobjc-link-runtime") - toolchain:add("shflags", {"-arch", arch}, targetflag, "-isysroot", xcode_sysroot, "-ObjC", "-fobjc-link-runtime") - - -- init flags for objc/c++ - toolchain:add("mxflags", {"-arch", arch}, targetflag, "-isysroot", xcode_sysroot) - - -- we can use `add_mxflags("-fno-objc-arc")` to override it in xmake.lua - toolchain:add("mxflags", "-fobjc-arc") - - -- init flags for asm - toolchain:add("asflags", {"-arch", arch}, targetflag, "-isysroot", xcode_sysroot) - - -- init flags for swift (with toolchain:add("ldflags and toolchain:add("shflags) - toolchain:add("scflags", {"-sdk", xcode_sysroot}, targetflag) - toolchain:add("scshflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-library") - toolchain:add("scarflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-library", "-static") - toolchain:add("scldflags", {"-sdk", xcode_sysroot}, targetflag, "-emit-executable") -end diff --git a/xmake/toolchains/xcode/load_watchos.lua b/xmake/toolchains/xcode/load_watchos.lua deleted file mode 100644 index fa3f9f785..000000000 --- a/xmake/toolchains/xcode/load_watchos.lua +++ /dev/null @@ -1,26 +0,0 @@ ---!A cross-toolchain build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file load_watchos.lua --- - -import("load_platform") - -function main(toolchain) - load_platform(toolchain, "watchos") -end - diff --git a/xmake/toolchains/xcode/xmake.lua b/xmake/toolchains/xcode/xmake.lua index 482fbaf7e..59ddb045d 100644 --- a/xmake/toolchains/xcode/xmake.lua +++ b/xmake/toolchains/xcode/xmake.lua @@ -25,44 +25,4 @@ toolchain("xcode") set_runtimes("c++_static", "c++_shared", "stdc++_static", "stdc++_shared") on_check("check") - on_load(function (toolchain) - - -- set toolset - local arch = toolchain:arch() - local bindir = toolchain:bindir() - local appledev = toolchain:config("appledev") - local xc_clang = bindir and path.join(bindir, "clang") or "clang" - local xc_clangxx = bindir and path.join(bindir, "clang++") or "clang++" - local xc_ar = bindir and path.join(bindir, "ar") or "ar" - local xc_strip = bindir and path.join(bindir, "strip") or "strip" - local xc_swift_frontend = bindir and path.join(bindir, "swift-frontend") or "swift-frontend" - local xc_swiftc = bindir and path.join(bindir, "swiftc") or "swiftc" - local xc_dsymutil = bindir and path.join(bindir, "dsymutil") or "dsymutil" - - toolchain:set("toolset", "cc", xc_clang) - toolchain:set("toolset", "cxx", xc_clangxx, xc_clang) - toolchain:set("toolset", "ld", xc_clangxx, xc_clang) - toolchain:set("toolset", "sh", xc_clangxx, xc_clang) - toolchain:set("toolset", "ar", xc_ar) - toolchain:set("toolset", "strip", xc_strip) - toolchain:set("toolset", "dsymutil", xc_dsymutil, "dsymutil") - toolchain:set("toolset", "mm", xc_clang) - toolchain:set("toolset", "mxx", xc_clangxx, xc_clang) - toolchain:set("toolset", "sc", xc_swift_frontend, "swift_frontend", xc_swiftc, "swiftc") - toolchain:set("toolset", "scld", xc_swiftc, "swiftc") - toolchain:set("toolset", "scsh", xc_swiftc, "swiftc") - toolchain:set("toolset", "scar", xc_swiftc, "swiftc") - if arch then - toolchain:set("toolset", "cpp", xc_clang .. " -arch " .. arch .. " -E") - end - if toolchain:is_plat("macosx") then - toolchain:set("toolset", "as", xc_clang) - elseif appledev == "simulator" or appledev == "catalyst" then - toolchain:set("toolset", "as", xc_clang) - else - toolchain:set("toolset", "as", path.join(os.programdir(), "scripts", "gas-preprocessor.pl " .. xc_clang)) - end - - -- load configurations - import("load_" .. toolchain:plat())(toolchain) - end) + on_load("load") |
