You can edit almost every page by Creating an account. Otherwise, see the FAQ.

Rscons

From EverybodyWiki Bios & Wiki




Script error: No such module "Draft topics". Script error: No such module "AfC topic".

Rscons
Original author(s)Josh Holtrop
Initial releaseFebruary 14, 2014; 10 years ago (2014-02-14)
Stable release
3.1.0[1] / August 11, 2022; 20 months ago (2022-08-11)
Repositorygithub.com/holtrop/rscons
Written inRuby
Engine
    Operating systemCross-platform
    TypeSoftware development tools
    LicenseMIT License
    Websiteholtrop.github.io/rscons/

    Search Rscons on Amazon.

    Rscons is a computer software build tool that is designed to provide a software developer with a command-line interface to efficiently build and rebuild a software project across multiple build target(s) and build option variant(s). One way it does this is by keeping track of source code dependencies and only rebuilding an output file if any of its dependencies have changed since the last time it was built.

    Rscons takes inspiration from SCons, Waf, and Rake. Rscons build scripts are Ruby scripts. Rscons requires a very minimal build script to build a simple project, but provides several features to help the build script author as a project scales in size and adds build variants, build targets, or extra tasks.

    Major features[edit]

    Major Rscons features include the following:

    • Configuration files are Ruby scripts, which means that user-written builds have access to a complete general-purpose programming language.
    • Built-in support for C, C++, and D programming languages and source generators such as Yacc/Bison and Lex/Flex.
    • Built-in builders for producing linked executables, static library archives, dynamically linked shared libraries, and other types of build targets.
    • Extensibility via user-defined builders to handle other languages, source generators, or any executable capable of producing output files.
    • Dependency tracking based on compiler-emitted dependency information.
    • Detection of file content changes using MD5 hashes rather than timestamps.
    • Multi-threaded job execution.
    • Auto-configuration functionality to check for include files, libraries, executable programs, and user-specified custom checks.
    • pkg-config support to import build settings for external packages.
    • Cross-platform support (runs on Linux, Microsoft Windows, OS X).
    • Installation-free distribution by simply copying the rscons executable script into a project's source code repository.
    • Build hooks, which allow overriding environment settings for a specific build target (e.g. compile some source file(s) with different compilation flags) or registering other build targets dynamically (e.g. a disassembly listing for each object file compiled).

    Inspiration[edit]

    Rscons takes its main inspiration from SCons, including the use of environments to contain common build settings across a set of build targets.

    From Waf Rscons was inspired to allow distribution as a single compact executable file that can simply be versioned along with the project source code, allowing other users to build the project using Rscons without needing to separately install it. Rscons also colorizes build system output and displays build progress similarly to Waf.

    Rscons also takes inspiration from Rake and allows generic user-defined tasks that can perform any user-defined action (whether building a build target or something completely different).

    Examples[edit]

    The following example is a very simple Rsconscript file that compiles a C program using the default compiler:

    env do |env|
      env["CFLAGS"] << "-Wall"
      env.Program("program.exe", glob("src/**/*.c"))
    end
    

    Here is a more complex example showing how to use different compilation flags for certain source files:

    env do |env|
      env["CFLAGS"] = ["-O3", "-Wall"]
      env.add_build_hook do |builder|
        if builder.sources.first =~ %r{src/third-party/}
          build_op[:vars]["CFLAGS"] -= ["-Wall"]
        end
      end
      env.Program("program", glob("**/*.cc"))
    end
    

    See also[edit]

    Some use of "" in your query was not closed by a matching "".Some use of "" in your query was not closed by a matching "".

    References[edit]

    1. "Rscons - A Build System for Developers".

    External links[edit]


    This article "Rscons" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Rscons. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.