import "class" : new ;
import type ;
import virtual-target ;
+import errors ;
path-constant SELF : . ;
project b2
: build-dir .build
+ : requirements
+ <cxxstd>11
+ <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS=1
+ <toolset>msvc:<define>_CRT_NONSTDC_NO_DEPRECATE=1
;
#|
Define grammar translation with Bison.
|#
+BISON = [ os.environ BISON ] ;
+BISON ?= bison ;
+local BISON_IN_PATH = [ path.glob [ os.executable-path ] : $(BISON[1]) $(BISON[1]).* ] ;
+
rule grammar ( target : source : properties * )
{
# LOCATE on $(target) = $(source:D) ;
- local BISON = [ os.environ BISON ] ;
- BISON ?= bison ;
BISON on $(target) = $(BISON) ;
}
"$(BISON)" --yacc --defines -o "$(<[1])" "$(>)"
}
-make jamgram.cpp
- : src/engine/jamgram.y
- : @grammar
- : <dependency>jamgram.y
- <location>src/engine ;
+if $(BISON_IN_PATH)
+{
+ make jamgram.cpp
+ : src/engine/jamgram.y
+ : @grammar
+ : <dependency>jamgram.y
+ <location>src/engine ;
+}
+else
+{
+ errors.warning "Bison generator program '$(BISON:J= )' not found. Skipping grammar build." ;
+ alias jamgram.cpp
+ : src/engine/jamgram.cpp ;
+}
explicit jamgram.cpp ;
#|
[ glob src/engine/*.cpp src/engine/modules/*.cpp :
src/engine/*nt.cpp src/engine/*unix.cpp src/engine/*vms.cpp
src/engine/yyacc.cpp src/engine/mkjambase.cpp
+ src/engine/check_cxx11.cpp
] ;
local b2_src_nt = [ glob src/engine/*nt.cpp ] ;
local b2_src_unix = [ glob src/engine/*unix.cpp ] ;
<target-os>$(unix_os):<source>$(b2_src_unix)
<dependency>jamgram.cpp
<dependency>jambase.cpp
+ <toolset>msvc:<find-static-library>kernel32
+ <toolset>msvc:<find-static-library>advapi32
+ <toolset>msvc:<find-static-library>user32
;
explicit b2 ;