-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathJamroot.jam
66 lines (46 loc) · 2.09 KB
/
Jamroot.jam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
project : default-build <optimization>off debug ;
INSTALL_LOC = <location>stage/ ;
### Boost directory
import os ;
local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
if $(BOOST_ROOT) {
# echo "BOOST_ROOT = '" $(BOOST_ROOT) "'" ;
BOOST_INCLUDE_DIR = $(BOOST_ROOT) ;
} else {
echo "BOOST_ROOT variable not set!" ;
BOOST_INCLUDE_DIR = "/usr/include" ;
}
# Try to find boost/version.hpp
if [ GLOB $(BOOST_INCLUDE_DIR)/boost/ : version.hpp ] {
echo "Using BOOST_INCLUDE_DIR = '" $(BOOST_INCLUDE_DIR) "'" ;
} else {
echo "Could not find boost, skipping boost tests" ;
BOOST_INCLUDE_DIR = ;
}
# Check TEST_HANA env variable
local TEST_CXX14 = [ os.environ TEST_CXX14 ] ;
local SKIP_INTRUSIVE = [ os.environ SKIP_INTRUSIVE ] ;
### Setup visit_struct target
alias visit_struct : : : : <include>include/ ;
### Setup boost includes
alias boost : : : : <include>$(BOOST_INCLUDE_DIR) ;
### Build tests
# TODO: Work around this on windows
GNU_FLAGS = "-Wall -Werror -Wextra -pedantic -std=c++11" ;
FLAGS = <toolset>gcc:<cxxflags>$(GNU_FLAGS) <toolset>clang:<cxxflags>$(GNU_FLAGS) <toolset>msvc:<warnings-as-errors>"off" ;
exe test_visit_struct : test_visit_struct.cpp visit_struct : $(FLAGS) ;
exe test_visit_struct_boost_fusion : test_visit_struct_boost_fusion.cpp visit_struct boost : $(FLAGS) ;
install install-bin : test_visit_struct test_visit_struct_boost_fusion : $(INSTALL_LOC) ;
if $(SKIP_INTRUSIVE) {
echo "Skipping intrusive syntax test" ;
} else {
exe test_visit_struct_intrusive : test_visit_struct_intrusive.cpp visit_struct : $(FLAGS) ;
install install-intrusive : test_visit_struct_intrusive : $(INSTALL_LOC) ;
}
if $(TEST_CXX14) {
GNU_FLAGS = "-Wall -Werror -Wextra -pedantic -std=c++14" ;
FLAGS = <toolset>gcc:<cxxflags>$(GNU_FLAGS) <toolset>clang:<cxxflags>$(GNU_FLAGS) <toolset>msvc:<warnings-as-errors>"off" ;
exe test_visit_struct_boost_hana : test_visit_struct_boost_hana.cpp visit_struct boost : $(FLAGS) ;
exe test_fully_visitable : test_fully_visitable.cpp visit_struct : $(FLAGS) ;
install install-hana : test_fully_visitable test_visit_struct_boost_hana : $(INSTALL_LOC) ;
}