Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

tools/build/v2/tools/rc.jam

#  Copyright (C) Andre Hentz 2003. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears in
#  all copies. This software is provided "as is" without express or implied
#  warranty, and with no claim as to its suitability for any purpose.

import type ;
import generators ;
import feature ;
import errors ;

type.register RC : rc ;

rule init ( )
{
}

rule resource-compile ( target : sources * : properties * )
{
    local OS = [ feature.get-values <os> : $(properties) ] ;
    switch $(OS)
    {
        case "NT" :
            resource-compile-nt $(target) : $(sources[1]) ;
        case "CYGWIN" :
            resource-compile-cygwin $(target) : $(sources[1]) ;
        case "FREEBSD" :
            create-empty-object $(target) : $(sources[1]) ;
        case "SOLARIS" :
            create-empty-object $(target) : $(sources[1]) ;
        case "LINUX" :
            create-empty-object $(target) : $(sources[1]) ;
        case "*" :
            errors.error "Cannot process RC files for OS=$(OS)" ;
    }
}


actions quietly resource-compile-nt
{
    rc /i "$(>:D)" /i "$(<:D)" /fo "$(<)" "$(>)"
}

actions quietly resource-compile-cygwin
{
    windres --include-dir "$(>:D)" -o "$(<)" -i "$(>)"
}

actions quietly create-empty-object
{
    as /dev/null -o "$(<)"
}

# Since it's a common practice to write
# exe hello : hello.cpp hello.rc
# we change the name of object created from RC file, to
# avoid conflict with hello.cpp.
generators.register-standard rc.resource-compile : RC : OBJ(%_res) ;