📄 msvc.jam
字号:
#local rule default-paths ( version ? ){ local possible-paths ; if $(version) { possible-paths += [ default-path $(version) ] ; } else { for local i in $(.known-versions) { possible-paths += [ default-path $(i) ] ; } } return $(possible-paths) ;}local rule get-rspline ( target : lang-opt ){ CC_RSPLINE on $(target) = [ on $(target) return $(lang-opt) -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(.nl)-D$(DEFINES) $(.nl)\"-I$(INCLUDES:W)\" ] ;}# Unsafe worker rule for the register-toolset() rule. Must not be called# multiple times.#local rule register-toolset-really ( ){ feature.extend toolset : msvc ; # Intel and msvc supposedly have link-compatible objects. feature.subfeature toolset msvc : vendor : intel : propagated optional ; # Inherit MIDL flags. toolset.inherit-flags msvc : midl ; # Inherit MC flags. toolset.inherit-flags msvc : mc ; # Dynamic runtime comes only in MT flavour. toolset.add-requirements <toolset>msvc,<runtime-link>shared:<threading>multi ; # Declare msvc toolset specific features. { feature.feature debug-store : object database : propagated ; feature.feature pch-source : : dependency free ; } # Declare generators. { # TODO: Is it possible to combine these? Make the generators # non-composing so that they do not convert each source into a separate # .rsp file. generators.register-linker msvc.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : EXE : <toolset>msvc ; generators.register-linker msvc.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB : <toolset>msvc ; generators.register-archiver msvc.archive : OBJ : STATIC_LIB : <toolset>msvc ; generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : <toolset>msvc ; generators.register-c-compiler msvc.compile.c : C : OBJ : <toolset>msvc ; # Using 'register-c-compiler' adds the build directory to INCLUDES. generators.register-c-compiler msvc.compile.rc : RC : OBJ(%_res) : <toolset>msvc ; generators.override msvc.compile.rc : rc.compile.resource ; generators.register-standard msvc.compile.asm : ASM : OBJ : <toolset>msvc ; generators.register-c-compiler msvc.compile.idl : IDL : MSTYPELIB H C(%_i) C(%_proxy) C(%_dlldata) : <toolset>msvc ; generators.override msvc.compile.idl : midl.compile.idl ; generators.register-standard msvc.compile.mc : MC : H RC : <toolset>msvc ; generators.override msvc.compile.mc : mc.compile ; # Note: the 'H' source type will catch both '.h' and '.hpp' headers as # the latter have their HPP type derived from H. The type of compilation # is determined entirely by the destination type. generators.register [ new msvc-pch-generator msvc.compile.c.pch : H : C_PCH OBJ : <pch>on <toolset>msvc ] ; generators.register [ new msvc-pch-generator msvc.compile.c++.pch : H : CPP_PCH OBJ : <pch>on <toolset>msvc ] ; generators.override msvc.compile.c.pch : pch.default-c-pch-generator ; generators.override msvc.compile.c++.pch : pch.default-cpp-pch-generator ; } toolset.flags msvc.compile PCH_FILE <pch>on : <pch-file> ; toolset.flags msvc.compile PCH_SOURCE <pch>on : <pch-source> ; toolset.flags msvc.compile PCH_HEADER <pch>on : <pch-header> ; # # Declare flags for compilation. # toolset.flags msvc.compile CFLAGS <optimization>speed : /O2 ; toolset.flags msvc.compile CFLAGS <optimization>space : /O1 ; toolset.flags msvc.compile CFLAGS $(.cpu-arch-ia64)/<instruction-set>$(.cpu-type-itanium) : /G1 ; toolset.flags msvc.compile CFLAGS $(.cpu-arch-ia64)/<instruction-set>$(.cpu-type-itanium2) : /G2 ; toolset.flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>object : /Z7 ; toolset.flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>database : /Zi ; toolset.flags msvc.compile CFLAGS <optimization>off : /Od ; toolset.flags msvc.compile CFLAGS <inlining>off : /Ob0 ; toolset.flags msvc.compile CFLAGS <inlining>on : /Ob1 ; toolset.flags msvc.compile CFLAGS <inlining>full : /Ob2 ; toolset.flags msvc.compile CFLAGS <warnings>on : /W3 ; toolset.flags msvc.compile CFLAGS <warnings>off : /W0 ; toolset.flags msvc.compile CFLAGS <warnings>all : /W4 ; toolset.flags msvc.compile CFLAGS <warnings-as-errors>on : /WX ; toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>off : /EHs ; toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>on : /EHsc ; toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>on/<extern-c-nothrow>off : /EHa ; toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>on/<extern-c-nothrow>on : /EHac ; # By default 8.0 enables rtti support while prior versions disabled it. We # simply enable or disable it explicitly so we do not have to depend on this # default behaviour. toolset.flags msvc.compile CFLAGS <rtti>on : /GR ; toolset.flags msvc.compile CFLAGS <rtti>off : /GR- ; toolset.flags msvc.compile CFLAGS <runtime-debugging>off/<runtime-link>shared : /MD ; toolset.flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>shared : /MDd ; toolset.flags msvc.compile CFLAGS <runtime-debugging>off/<runtime-link>static/<threading>multi : /MT ; toolset.flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>static/<threading>multi : /MTd ; toolset.flags msvc.compile.c OPTIONS <cflags> : ; toolset.flags msvc.compile.c++ OPTIONS <cxxflags> : ; toolset.flags msvc.compile PDB_CFLAG <debug-symbols>on/<debug-store>database : /Fd ; # not used yet toolset.flags msvc.compile DEFINES <define> ; toolset.flags msvc.compile UNDEFS <undef> ; toolset.flags msvc.compile INCLUDES <include> ; # Declare flags for the assembler. toolset.flags msvc.compile.asm USER_ASMFLAGS <asmflags> ; # Declare flags for linking. { toolset.flags msvc.link PDB_LINKFLAG <debug-symbols>on/<debug-store>database : /PDB: ; # not used yet toolset.flags msvc.link LINKFLAGS <debug-symbols>on : /DEBUG ; toolset.flags msvc.link DEF_FILE <def-file> ; # The linker disables the default optimizations when using /DEBUG so we # have to enable them manually for release builds with debug symbols. toolset.flags msvc LINKFLAGS <debug-symbols>on/<runtime-debugging>off : /OPT:REF,ICF ; toolset.flags msvc LINKFLAGS <user-interface>console : /subsystem:console ; toolset.flags msvc LINKFLAGS <user-interface>gui : /subsystem:windows ; toolset.flags msvc LINKFLAGS <user-interface>wince : /subsystem:windowsce ; toolset.flags msvc LINKFLAGS <user-interface>native : /subsystem:native ; toolset.flags msvc LINKFLAGS <user-interface>auto : /subsystem:posix ; toolset.flags msvc.link OPTIONS <linkflags> ; toolset.flags msvc.link LINKPATH <library-path> ; toolset.flags msvc.link FINDLIBS_ST <find-static-library> ; toolset.flags msvc.link FINDLIBS_SA <find-shared-library> ; toolset.flags msvc.link LIBRARY_OPTION <toolset>msvc : "" : unchecked ; toolset.flags msvc.link LIBRARIES_MENTIONED_BY_FILE : <library-file> ; } toolset.flags msvc.archive AROPTIONS <archiveflags> ;}# Locates the requested setup script under the given folder and returns its full# path or nothing in case the script can not be found. In case multiple scripts# are found only the first one is returned.## TODO: There used to exist a code comment for the msvc.init rule stating that# we do not correctly detect the location of the vcvars32.bat setup script for# the free VC7.1 tools in case user explicitly provides a path. This should be# tested or simply remove this whole comment in case this toolset version is no# longer important.#local rule locate-default-setup ( command : parent : setup-name ){ local result = [ GLOB $(command) $(parent) : $(setup-name) ] ; if $(result[1]) { return $(result[1]) ; }}# Validates given path, registers found configuration and prints debug# information about it.#local rule register-configuration ( version : path ? ){ if $(path) { local command = [ GLOB $(path) : cl.exe ] ; if $(command) { if $(.debug-configuration) { ECHO "notice: [msvc-cfg] msvc-$(version) detected, command: '$(command)'" ; } $(.versions).register $(version) ; $(.versions).set $(version) : options : <command>$(command) ; } }}################################################################################## Startup code executed when loading this module.#################################################################################if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]{ .debug-configuration = true ;}# Miscellaneous constants..RM = [ common.rm-command ] ;.nl = "" ;.ProgramFiles = [ path.make [ common.get-program-files-dir ] ] ;.escaped-double-quote = "\"" ;.TOUCH_FILE = [ common.file-touch-command ] ;# List of all registered configurations..versions = [ new configurations ] ;# Supported CPU architectures..cpu-arch-i386 = <architecture>/<address-model> <architecture>/<address-model>32 <architecture>x86/<address-model> <architecture>x86/<address-model>32 ;.cpu-arch-amd64 = <architecture>/<address-model>64 <architecture>x86/<address-model>64 ;.cpu-arch-ia64 = <architecture>ia64/<address-model> <architecture>ia64/<address-model>64 ;# Supported CPU types (only Itanium optimization options are supported from# VC++ 2005 on). See# http://msdn2.microsoft.com/en-us/library/h66s5s0e(vs.90).aspx for more# detailed information..cpu-type-g5 = i586 pentium pentium-mmx ;.cpu-type-g6 = i686 pentiumpro pentium2 pentium3 pentium3m pentium-m k6 k6-2 k6-3 winchip-c6 winchip2 c3 c3-2 ;.cpu-type-em64t = prescott nocona conroe conroe-xe conroe-l allendale mermon mermon-xe kentsfield kentsfield-xe penryn wolfdale yorksfield nehalem ;.cpu-type-amd64 = k8 opteron athlon64 athlon-fx ;.cpu-type-g7 = pentium4 pentium4m athlon athlon-tbird athlon-4 athlon-xp athlon-mp $(.cpu-type-em64t) $(.cpu-type-amd64) ;.cpu-type-itanium = itanium itanium1 merced ;.cpu-type-itanium2 = itanium2 mckinley ;# Known toolset versions, in order of preference..known-versions = 9.0 9.0express 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ;# Version aliases..version-alias-6 = 6.0 ;.version-alias-6.5 = 6.0 ;.version-alias-7 = 7.0 ;.version-alias-8 = 8.0 ;.version-alias-9 = 9.0 ;# Names of registry keys containing the Visual C++ installation path (relative# to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft")..version-6.0-reg = "VisualStudio\\6.0\\Setup\\Microsoft Visual C++" ;.version-7.0-reg = "VisualStudio\\7.0\\Setup\\VC" ;.version-7.1-reg = "VisualStudio\\7.1\\Setup\\VC" ;.version-8.0-reg = "VisualStudio\\8.0\\Setup\\VC" ;.version-8.0express-reg = "VCExpress\\8.0\\Setup\\VC" ;.version-9.0-reg = "VisualStudio\\9.0\\Setup\\VC" ;.version-9.0express-reg = "VCExpress\\9.0\\Setup\\VC" ;# Visual C++ Toolkit 2003 does not store its installation path in the registry.# The environment variable 'VCToolkitInstallDir' and the default installation# path will be checked instead..version-7.1toolkit-path = "Microsoft Visual C++ Toolkit 2003" "bin" ;.version-7.1toolkit-env = VCToolkitInstallDir ;# Path to the folder containing "cl.exe" relative to the value of the# corresponding environment variable..version-7.1toolkit-envpath = "bin" ;# Auto-detect all the available msvc installations on the system.auto-detect-toolset-versions ;# And finally trigger the actual Boost Build toolset registration.register-toolset ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -