def autodetect(conf,arch=False): v=conf.env if v.NO_MSVC_DETECT: return if arch: compiler,version,path,includes,libdirs,arch=conf.detect_msvc(True) v['DEST_CPU']=arch else: compiler,version,path,includes,libdirs=conf.detect_msvc() v['PATH']=path v['INCLUDES']=includes v['LIBPATH']=libdirs v['MSVC_COMPILER']=compiler try: v['MSVC_VERSION']=float(version) except Exception: v['MSVC_VERSION']=float(version[:-3])
def autodetect(conf): v=conf.env if v.NO_MSVC_DETECT: return compiler,version,path,includes,libdirs=conf.detect_msvc() v['PATH']=path v['INCLUDES']=includes v['LIBPATH']=libdirs v['MSVC_COMPILER']=compiler try: v['MSVC_VERSION']=float(version) except: v['MSVC_VERSION']=float(version[:-3])
def autodetect(conf): v = conf.env if v.NO_MSVC_DETECT: return compiler, version, path, includes, libdirs = conf.detect_msvc() v['PATH'] = path v['INCLUDES'] = includes v['LIBPATH'] = libdirs v['MSVC_COMPILER'] = compiler try: v['MSVC_VERSION'] = float(version) except: v['MSVC_VERSION'] = float(version[:-3])
def autodetect(conf, arch=False): v = conf.env if v.NO_MSVC_DETECT: return compiler, version, path, includes, libdirs, cpu = conf.detect_msvc() if arch: v.DEST_CPU = cpu v.PATH = path v.INCLUDES = includes v.LIBPATH = libdirs v.MSVC_COMPILER = compiler try: v.MSVC_VERSION = float(version) except ValueError: v.MSVC_VERSION = float(version[:-3])
def autodetect(conf,arch=False): v=conf.env if v.NO_MSVC_DETECT: return compiler,version,path,includes,libdirs,cpu=conf.detect_msvc() if arch: v.DEST_CPU=cpu v.PATH=path v.INCLUDES=includes v.LIBPATH=libdirs v.MSVC_COMPILER=compiler try: v.MSVC_VERSION=float(version) except TypeError: v.MSVC_VERSION=float(version[:-3])
def load_win_x64_win_x64_clang_common_settings(conf): """ Setup all compiler and linker settings shared over all win_x64_win_x64 configurations """ v = conf.env global PLATFORM # Load MSVC settings for non-build stuff (AzCG, CrcFix, etc) load_win_x64_win_x64_vs2015_common_settings(conf) windows_kit = conf.options.win_vs2015_winkit try: _, _, _, system_includes, _, _ = conf.detect_msvc(windows_kit, True) except: Logs.warn( 'Unable to find Windows Kit {}, removing build target'.format( windows_kit)) conf.mark_supported_platform_for_removal(PLATFORM) return restricted_tool_list_macro_header = 'AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS=' restricted_tool_list_macro = restricted_tool_list_macro_header # Start with a blank platform slate conf.undefine('AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS') if len(restricted_tool_list_macro) > len( restricted_tool_list_macro_header): v['DEFINES'] += [restricted_tool_list_macro] # Remove MSVC/clang specific settings v['CFLAGS'] = [] v['CXXFLAGS'] = [] v['LINKFLAGS'] = [] # Linker v['CCLNK_SRC_F'] = v['CXXLNK_SRC_F'] = [] v['CCLNK_TGT_F'] = v['CXXLNK_TGT_F'] = '/OUT:' v['LIB_ST'] = '%s.lib' v['LIBPATH_ST'] = '/LIBPATH:%s' v['STLIB_ST'] = '%s.lib' v['STLIBPATH_ST'] = '/LIBPATH:%s' v['cprogram_PATTERN'] = '%s.exe' v['cxxprogram_PATTERN'] = '%s.exe' v['cstlib_PATTERN'] = '%s.lib' v['cxxstlib_PATTERN'] = '%s.lib' v['cshlib_PATTERN'] = '%s.dll' v['cxxshlib_PATTERN'] = '%s.dll' v['LINKFLAGS_cshlib'] = ['/DLL'] v['LINKFLAGS_cxxshlib'] = ['/DLL'] # AR Tools v['ARFLAGS'] = ['/NOLOGO'] v['AR_TGT_F'] = '/OUT:' # Delete the env variables so that they can be replaced with the clang versions del v['AR'] del v['CC'] del v['CXX'] del v['LINK'] conf.find_program('clang', var='CC', mandatory=False, silent_output=True) if not v['CC']: conf.mark_supported_platform_for_removal(PLATFORM) Logs.warn('clang executable not found, removing platform {}'.format( PLATFORM)) return conf.find_program('clang++', var='CXX', silent_output=True) conf.find_program('llvm-lib', var='AR', silent_output=True) conf.find_program('lld-link', var='LINK', silent_output=True) v['LINK_CC'] = v['LINK_CXX'] = v['LINK'] clang_FLAGS = [ '-mcx16', '-msse3', '-Wno-macro-redefined', '-Wno-nonportable-include-path', '-Wno-microsoft-cast', '-Wno-ignored-pragma-intrinsic', # Clang doens't need #pragma intrinsic anyway, so don't whine when one isn't recognized ] # Path to clang.exe is [clang]/bin/clang.exe, but the include path is [clang]/lib/clang/6.0.0/include clang_include_path = os.path.join( os.path.dirname(os.path.dirname(v['CXX'])), 'lib', 'clang', '6.0.0', 'include') system_includes = [clang_include_path] + system_includes # Treat all MSVC include paths as system headers for include in system_includes: clang_FLAGS += ['-isystem', include] v['CFLAGS'] += clang_FLAGS v['CXXFLAGS'] += clang_FLAGS v['DEFINES'] += [ '_CRT_SECURE_NO_WARNINGS', '_CRT_NONSTDC_NO_WARNINGS', ] v['LINKFLAGS'] += [ '/MACHINE:x64', '/MANIFEST', # Create a manifest file '/OPT:REF', '/OPT:ICF', # Always optimize for size, there's no reason not to '/LARGEADDRESSAWARE', # tell the linker that the application can handle addresses larger than 2 gigabytes. ]