# Copyright (C) 2002, Rene Rivera. 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.

# Example of how to define and depend on a library target.
# This is for Boost.Build-V1

subproject tools/build/examples/lib_use ;

# Declare the library target. Composed of a single source file.
# The real name of the target will vary according to the build
# build platform. For example in Unix it will generate a file
# named "libsimple.a".
#
# In this example the default build is given so that it builds
# two default versions of the library: debug with single-threading,
# and debug with multi-threading.
#
lib simple
    :
        # SOURCES
        simple_lib.cpp
    :
        # REQUIREMENTS
    :
        # DEFAULT BUILDS
        debug <threading>single/multi
    ;

# Declare an executable target that uses the library.
# Here the executable has a single source file, but also
# depends on the above library. Therefore this executable
# has the additional source file as generated by the library
# target.
#
# This target also specifies the requirement that it be built
# as multi-threaded. This also forces which variant of the library
# is used, and in this case, regardless of the build requested on this
# target.
#
exe simple
    :
        # SOURCES
        simple.cpp
        <lib>simple
    :
        # REQUIREMENTS
        <threading>multi
    :
        # DEFAULT BUILDS
    ;
