diff options
| author | ruki <[email protected]> | 2026-03-30 16:20:40 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-30 16:20:40 +0800 |
| commit | 314e68ea79671930db5e1087c607e011f865790f (patch) | |
| tree | 2f583292a0901fabf4be53432bb6bdc4dc6daf44 | |
| parent | 21760e232a003e32f6ac10099a603a6366eb6aca (diff) | |
| parent | de78ff8943c7b5a08c11c5dff4d14f31f34e0cb9 (diff) | |
Merge pull request #7439 from xmake-io/icx
switch icx to icx-cc on windows
| -rw-r--r-- | xmake/modules/core/tools/icx.lua | 11 | ||||
| -rw-r--r-- | xmake/modules/core/tools/icx_cc.lua | 22 | ||||
| -rw-r--r-- | xmake/modules/core/tools/icx_cc/has_flags.lua | 22 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/find_icx_cc.lua | 39 | ||||
| -rw-r--r-- | xmake/toolchains/icx/load.lua | 12 |
5 files changed, 97 insertions, 9 deletions
diff --git a/xmake/modules/core/tools/icx.lua b/xmake/modules/core/tools/icx.lua index 43bf33721..f9464883e 100644 --- a/xmake/modules/core/tools/icx.lua +++ b/xmake/modules/core/tools/icx.lua @@ -15,8 +15,13 @@ -- Copyright (C) 2015-present, Xmake Open Source Community. -- -- @author ruki --- @file icc.lua +-- @file icx.lua -- --- inherit gcc -inherit("clang") +-- https://github.com/xmake-io/xmake/issues/7438 +-- https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/get-started-guide/2024-1/get-started-on-windows.html +if is_host("windows") then + inherit("clang_cl") +else + inherit("clang") +end diff --git a/xmake/modules/core/tools/icx_cc.lua b/xmake/modules/core/tools/icx_cc.lua new file mode 100644 index 000000000..3023a617d --- /dev/null +++ b/xmake/modules/core/tools/icx_cc.lua @@ -0,0 +1,22 @@ +--!A cross-platform 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 icx_cc.lua +-- + +-- inherit icx (clang-compatible) +inherit("clang") diff --git a/xmake/modules/core/tools/icx_cc/has_flags.lua b/xmake/modules/core/tools/icx_cc/has_flags.lua new file mode 100644 index 000000000..4f1ca98b2 --- /dev/null +++ b/xmake/modules/core/tools/icx_cc/has_flags.lua @@ -0,0 +1,22 @@ +--!A cross-platform 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 has_flags.lua +-- + +-- inherit icx has_flags +inherit("core.tools.icx.has_flags") diff --git a/xmake/modules/detect/tools/find_icx_cc.lua b/xmake/modules/detect/tools/find_icx_cc.lua new file mode 100644 index 000000000..ce3e49fbf --- /dev/null +++ b/xmake/modules/detect/tools/find_icx_cc.lua @@ -0,0 +1,39 @@ +--!A cross-platform 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 find_icx_cc.lua +-- + +-- imports +import("lib.detect.find_program") +import("lib.detect.find_programver") + +-- find icx-cc +-- +-- @param opt the argument options, e.g. {version = true} +-- +-- @return program, version +-- +function main(opt) + opt = opt or {} + local program = find_program(opt.program or "icx-cc", opt) + local version = nil + if program and opt.version then + version = find_programver(program, opt) + end + return program, version +end diff --git a/xmake/toolchains/icx/load.lua b/xmake/toolchains/icx/load.lua index f91bd5348..2f2a03e5b 100644 --- a/xmake/toolchains/icx/load.lua +++ b/xmake/toolchains/icx/load.lua @@ -56,23 +56,23 @@ function _load_intel_on_windows(toolchain) -- set toolset if toolchain:is_plat("windows") then - toolchain:set("toolset", "cc", "icx.exe") - toolchain:set("toolset", "cxx", "icx.exe") + toolchain:set("toolset", "cc", "icx-cc.exe") + toolchain:set("toolset", "cxx", "icx-cc.exe") toolchain:set("toolset", "mrc", "rc.exe") if toolchain:is_arch("x64") then toolchain:set("toolset", "as", "ml64.exe") else toolchain:set("toolset", "as", "ml.exe") end - toolchain:set("toolset", "ld", "link.exe") - toolchain:set("toolset", "sh", "link.exe") - toolchain:set("toolset", "ar", "link.exe") + toolchain:set("toolset", "ld", "icx-cc.exe") + toolchain:set("toolset", "sh", "icx-cc.exe") + toolchain:set("toolset", "ar", "llvm-ar.exe") else toolchain:set("toolset", "cc", "icx") toolchain:set("toolset", "cxx", "icpx", "icx") toolchain:set("toolset", "ld", "icpx", "icx") toolchain:set("toolset", "sh", "icpx", "icx") - toolchain:set("toolset", "ar", "ar") + toolchain:set("toolset", "ar", "llvm-ar", "ar") toolchain:set("toolset", "strip", "strip") toolchain:set("toolset", "as", "icx") end |
