发新话题
打印

SciTE4D使用技巧之explicit编译

SciTE4D使用技巧之explicit编译


    20071222 DSSS version 0.74

    SciTE4D使用DSSS来编译库或文件,DSSS默认是重新编译所有依赖文件,这使得编译binary时速度很慢.有什么办法?
   
    解决办法就是使用Rebuild的-explicit开关
   
    Rebuild文档中是这样描述的:
引用:
        -explicit
        only compile files explicitly named, not dependencies
把相关库把编译成静态库,用program编译器指令在程序里显式指定依赖库,然后在binary的编译命令中加上-explicit开关.
   
    下面是我的一个dsss.conf文件示例:
引用:
        [*]
        buildflags=-explicit -SD:\d\dmd\tango\lib -lltango-base-dmd -version=DFL -version=pho -version=Tango -JD:\d\code\test
        debugflags=-debug=UnitTest -unittest -g -debug
        releaseflags=-release

        [test.d]
        type=binary
        target=test   
然后使用SciTE4D编辑test.d, 按F7进行debug模式编译,按Ctrl+F7进行release编译, 既方便,又快速.
    还可以使用DSSS的prebuild和postbuild,在编译前后进行相关操作,比如压缩文件,移动文件等.
   
    DSSS的缺点是文档不完整,初学者有点麻烦,熟悉以后是很好用的.
   
    附Rebuild 编译开关:
引用:
           
        .TH rebuild 1
        .SH NAME
        rebuild - Build tool for D
        .SH SYNOPSIS
        .B rebuild
        files.d
        ...
        .I { -switch }
        .SH DESCRIPTION
        .IP files.d
        D source files
        .IP -rf<filename>
        Use specified response file
        .IP -dc=<compiler>
        use the specified compiler configuration
        .IP -p
        do not compile (or link)
        .IP -c
        do not link
        .IP -lib
        link a static library
        .IP -libs-safe
        exit failure or success for whether libraries can be safely be used with any D code
        .IP -shlib
        link a shared library
        .IP -shlib-support
        exit failure or success for whether shared libraries are supported
        .IP -dylib
        link a dynamic library (a library intended to be loaded at runtime)
        .IP -dylib-support
        exit failure or success for whether dynamic libraries are supported
        .IP -g
        add symbolic debug info
        .IP -gc
        add symbolic debug info, pretend to be C
        .IP -files
        list files which would be compiled (but don't compile)
        .IP -objfiles
        list object files generated
        .IP -full
        compile all source files, regardless of their age
        .IP -explicit
        only compile files explicitly named, not dependencies
        .IP --help
        print help
        .IP -Ipath
        where to look for imports
        .IP -Ccompileflag
        pass compileflag to compilation
        .IP -Llinkerflag
        pass linkerflag to the linker at link time
        .IP -Klinkerflag
        pass linkerflag to the compiler at link time
        .IP -ll<lib>
        link in the specified library
        .RS
        .IP Windows:
        Link to <lib>.lib
        .IP Posix:
        Link to lib<lib>.{a,so}
        .RE
        .IP -Spath
        search path for libraries
        .IP -O
        optimize
        .IP -oqobjdir
        write object files to directory objdir with fully-qualified module names
        .IP -odobjdir
        write object files to directory objdir
        .IP -offilename
        name output file to filename
        .IP -quiet
        suppress unnecessary messages
        .IP -release
        compile release version
        .IP -exec
        run resulting program
        .IP -v
        verbose
        .IP -n
        just list the commands to be run, don't run them
        .IP -version=level
        compile in version code >= level
        .IP -version=ident
        compile in version code identified by ident
        .IP -debug
        compile in debug code
        .IP -debug=level
        compile in debug code <= level
        .IP -debug=ident
        compile in debug code identified by ident
        .IP -clean
        remove object files after done building
        .IP -circular
        allow circular dependencies to work on some compilers (namely GDC)
        .IP -testversion=<version>
        exit failure or success for whether the specified version is defined
        .IP -reflect
        use drefgen to make rodin-compatible reflections of all included modules
        .IP -candydoc
        generate the modules.ddoc file for candydoc (must specify -Dd, implies -explicit)

        All other flags are passed to the compiler.
        .SH AUTHOR
        written by Walter Bright and Gregor Richards
        .SH COPYRIGHT
        Copyright (c) 1999-2007 by Digital Mars and Gregor Richards
                    
   

TOP

发新话题