1 # Copyright (c) 2010 Vladimir Prus.
2 # Copyright (c) 2013 Steven Watanabe
4 # Use, modification and distribution is subject to the Boost Software
5 # License Version 1.0. (See accompanying file LICENSE_1_0.txt or
6 # http://www.boost.org/LICENSE_1_0.txt)
8 # Supports the zstd library
10 # After 'using zstd', the following targets are available:
12 # /zstd//zstd -- The zstd library
18 import "class" : new ;
31 if --debug-configuration in [ modules.peek : ARGV ]
41 # A list of the options to use
44 # The requirements for the target
47 local caller = [ project.current ] ;
53 project.initialize $(__name__) ;
54 .project = [ project.current ] ;
58 local library-path = [ feature.get-values <search> : $(options) ] ;
59 local include-path = [ feature.get-values <include> : $(options) ] ;
60 local library-name = [ feature.get-values <name> : $(options) ] ;
62 condition = [ property-set.create $(requirements) ] ;
63 condition = [ property-set.create [ $(condition).base ] ] ;
65 if $(.configured.$(condition))
71 ECHO "notice: [zstd] zstd is already configured" ;
76 errors.user-error "zstd is already configured" ;
84 ECHO "notice: [zstd] Using pre-installed library" ;
87 ECHO "notice: [zstd] Condition" [ $(condition).raw ] ;
91 local mt = [ new ac-library zstd : $(.project) : $(condition) :
92 $(include-path) : $(library-path) : $(library-name) ] ;
93 $(mt).set-header $(header) ;
94 $(mt).set-default-names $(names) ;
95 targets.main-target-alternative $(mt) ;
97 .configured.$(condition) = true ;