2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 11:19:52 +01:00

Improve iocx/icpx/icx-cl detection

This commit is contained in:
Waf Project 2023-10-24 18:38:21 +02:00
parent e98914bf74
commit b49860a568
2 changed files with 35 additions and 30 deletions

View File

@ -18,24 +18,24 @@ def find_icc(conf):
Finds the program icc and execute it to ensure it really is icc
"""
if Utils.is_win32:
cc = conf.find_program(['icx-cc', 'icc', 'ICL'], var='CC')
else:
cc = conf.find_program(['icx', 'icc', 'ICL'], var='CC')
conf.get_cc_version(cc, icc=True)
conf.find_program(['icx-cl'], var='ICXCL', mandatory=False)
if conf.env.ICXCL:
conf.env.INTEL_CLANG_COMPILER = True
conf.env.CC = conf.env.ICXCL
if not conf.env.INTEL_CLANG_COMPILER:
conf.find_program(['icx', 'icc', 'ICL'], var='CC')
conf.get_cc_version(cc, icc=True)
conf.env.CC_NAME = 'icc'
def configure(conf):
conf.find_icc()
if conf.env.INTEL_CLANG_COMPILER and Utils.is_win32:
# need the linker from msvc
cc = conf.env.CC
cxx = conf.env.CXX
cxx_name = conf.env.CXX_NAME
conf.find_msvc()
conf.env.CC = cc
conf.env.CXX = cxx
conf.env.CC_NAME = 'icc'
conf.env.CXX_NAME = cxx_name
conf.find_program('MT', var='MT')
conf.env.MTFLAGS = ['/nologo']
conf.env.MSVC_MANIFEST = True
conf.msvc_common_flags()
@ -45,8 +45,8 @@ def configure(conf):
conf.link_add_flags()
conf.visual_studio_add_flags()
conf.env.LINK_CC = conf.env.AR
conf.env.CC_TGT_F = ['/c', '/o']
conf.env.CC_TGT_F = ['/FC', '/c', '/Fo']
conf.env.CPPPATH_ST = '/I%s'
else:
conf.find_ar()
conf.gcc_common_flags()

View File

@ -6,45 +6,50 @@
Detects the Intel C++ compiler
"""
from waflib import Utils
from waflib.Tools import ccroot, ar, gxx
from waflib.Configure import conf
from waflib.Tools import msvc
@conf
def find_icpc(conf):
"""
Finds the program icpc, and execute it to ensure it really is icpc
"""
cxx = conf.find_program(['icpx', 'icpc'], var='CXX')
conf.get_cc_version(cxx, icc=True)
conf.env.CXX_NAME = 'icc'
if Utils.is_win32:
conf.find_program(['icx-cl'], var='ICXCL', mandatory=False)
if conf.env.ICXCL:
conf.env.INTEL_CLANG_COMPILER = True
conf.env.CXX = conf.env.ICXCL
if not conf.env.INTEL_CLANG_COMPILER:
conf.find_program(['icpx', 'icpc', 'ICL'], var='CXX')
conf.get_cc_version(cc, icc=True)
conf.env.CC_NAME = 'icc'
def configure(conf):
conf.find_icpc()
if conf.env.INTEL_CLANG_COMPILER and Utils.is_win32:
# need the linker from msvc
cc = conf.env.CC
cxx = conf.env.CXX
cxx_name = conf.env.CXX_NAME
conf.find_msvc()
conf.env.CC = cc
conf.env.CXX = cxx
conf.env.CC_NAME = 'icc'
conf.env.CXX_NAME = cxx_name
conf.find_program('MT', var='MT')
conf.env.MTFLAGS = ['/nologo']
conf.env.MSVC_MANIFEST = True
conf.msvc_common_flags()
conf.env.CFLAGS = []
conf.env.CXXFLAGS = []
conf.cc_load_tools()
conf.cc_add_flags()
conf.link_add_flags()
conf.visual_studio_add_flags()
conf.env.LINK_CXX = conf.env.AR
conf.env.CXX_TGT_F = ['/c', '/o']
conf.env.CXX_TGT_F = ['/c', '/Fo']
conf.env.CPPPATH_ST = '/I%s'
else:
conf.find_ar()
conf.gcc_common_flags()
conf.gcc_modifier_platform()
conf.gxx_common_flags()
conf.gxx_modifier_platform()
conf.cc_load_tools()
conf.cc_add_flags()
conf.link_add_flags()