-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwscript
165 lines (149 loc) · 8.75 KB
/
wscript
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#! /usr/bin/env python
# encoding: utf-8
#
# Copyright (C) 2011 Serge Monkewitz IPAC/Caltech
#
from __future__ import with_statement
import os
import sys
import traceback
from waflib import Build, Logs, Utils
def options(ctx):
ctx.load('compiler_cxx cxx14 gnu_dirs waf_unit_test')
ctx.add_option('--debug', help='Include debug symbols and turn ' +
'compiler optimizations off',
action='store_true', default=False, dest='debug')
boost=ctx.add_option_group('boost Options')
boost.add_option('--boost-dir',
help='Base directory where boost is installed')
boost.add_option('--boost-incdir',
help='Directory where boost include files are installed')
boost.add_option('--boost-libdir',
help='Directory where boost library files are installed')
boost.add_option('--boost-libs',
help='Names of the boost libraries without prefix or suffix\n'
'(e.g. "boost_filesystem boost_system"')
def configure(ctx):
ctx.load('compiler_cxx cxx14 gnu_dirs waf_unit_test')
ctx.env.append_value('CXXFLAGS', '-Wall')
ctx.env.append_value('CXXFLAGS', '-Wextra')
# Find Boost
if ctx.options.boost_dir:
if not ctx.options.boost_incdir:
ctx.options.boost_incdir=ctx.options.boost_dir + "/include"
if not ctx.options.boost_libdir:
ctx.options.boost_libdir=ctx.options.boost_dir + "/lib"
frag="#include <boost/spirit/include/qi.hpp>\n" + 'int main()\n' \
+ "{}\n"
if ctx.options.boost_incdir:
boost_inc=ctx.options.boost_incdir
else:
boost_inc='/usr/include'
if ctx.options.boost_libs:
boost_libs=[ctx.options.boost_libs]
else:
boost_libs=['boost_system','boost_thread']
ctx.check_cxx(msg="Checking for Boost",
fragment=frag,
includes=[boost_inc], uselib_store='boost',
libpath=[ctx.options.boost_libdir],
rpath=[ctx.options.boost_libdir],
lib=boost_libs)
ctx.env.append_value('CXXFLAGS', '-g')
if not ctx.options.debug:
ctx.env.append_value('CXXFLAGS', '-Ofast')
ctx.env.append_value('CXXFLAGS', '-DNDEBUG')
def build(ctx):
cxx_sources=['src/Query/Query.cxx',
'src/Query/ADQL_parser/ADQL_parser/ADQL_parser.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_column_reference.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_correlation_specification.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_columns.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_value_expression.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_factor.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_trig.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_math.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_point_or_column.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_geometry.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_non_predicate_geometry_function.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_identifier.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_join.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_literals.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_predicate.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_query.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_reserved_words.cxx',
'src/Query/ADQL_parser/ADQL_parser/init_search_condition.cxx',
'src/Query/simplified_columns.cxx',
'src/Query/Query_Specification/Search_Condition_Wrap/empty.cxx',
'src/Query/Query_Specification/Search_Condition_Wrap/ostream.cxx',
'src/Query/Query_Specification/Search_Condition/Boolean_Factor/Boolean_Primary/empty.cxx',
'src/Query/Query_Specification/Search_Condition/Boolean_Factor/Boolean_Primary/ostream.cxx',
'src/Query/Query_Specification/Search_Condition/Boolean_Factor/Boolean_Primary/Predicate/Like_Predicate/ostream.cxx',
'src/Query/Query_Specification/Search_Condition/Boolean_Factor/Boolean_Primary/Predicate/Between_Predicate/ostream.cxx',
'src/Query/Query_Specification/Search_Condition/Boolean_Factor/Boolean_Primary/Predicate/Comparison_Predicate/ostream.cxx',
'src/Query/Query_Specification/Search_Condition/Boolean_Factor/Boolean_Primary/Predicate/Exists_Predicate/ostream.cxx',
'src/Query/Query_Specification/Search_Condition/Boolean_Factor/Boolean_Primary/Predicate/In_Predicate/ostream.cxx',
'src/Query/Query_Specification/Joined_Table_Wrap/empty.cxx',
'src/Query/Query_Specification/Joined_Table/ostream.cxx',
'src/Query/Query_Specification/Joined_Table/Qualified_Join/ostream.cxx',
'src/Query/Query_Specification/Table_Reference/ostream.cxx',
'src/Query/Query_Specification/Table_Reference_Wrap/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary_Wrap/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary_Wrap/empty.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Array_Constructor/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Case_Expression/Result/empty.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Case_Expression/Result/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Case_Expression/Case_Specification/Simple_Case/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Case_Expression/Case_Specification/Simple_Case/Simple_Whens/Simple_When/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Case_Expression/Case_Specification/Searched_Case/Searched_Whens/Searched_When/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Case_Expression/Case_Abbreviation/Nullif/empty.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Case_Expression/Case_Abbreviation/Nullif/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Primary/Case_Expression/Case_Abbreviation/Coalesce/ostream.cxx',
'src/Query/Query_Specification/User_Defined_Function_Wrap/ostream.cxx',
'src/Query/Query_Specification/Value_Expression/empty.cxx',
'src/Query/Query_Specification/Value_Expression/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Wrap/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Wrap/empty.cxx',
'src/Query/Query_Specification/Value_Expression_Non_Bool_Wrap/ostream.cxx',
'src/Query/Query_Specification/Value_Expression_Non_Bool_Wrap/empty.cxx',
'src/Query/Query_Specification/Factor/Numeric_Primary/ostream.cxx',
'src/Query/Query_Specification/Factor/Numeric_Primary/empty.cxx',
'src/Query/Query_Specification/Factor/Numeric_Primary/Numeric_Value_Function/empty.cxx',
'src/Query/Query_Specification/Factor/Numeric_Primary/Numeric_Value_Function/ostream.cxx',
'src/Query/Query_Specification/Group_By_Term/empty.cxx',
'src/Query/Query_Specification/Group_By_Term/ostream.cxx',
'src/Query/Subquery/ostream.cxx',
'src/Query/Subquery/empty.cxx',
'src/Query/Subquery_Wrap/ostream.cxx',
'src/Query/Subquery_Wrap/empty.cxx',
]
ctx.stlib(
source=cxx_sources,
includes='',
target='adql_query',
name='adql_query_st',
install_path=os.path.join(ctx.env.PREFIX, 'lib'),
use=['boost','cxx14']
)
# shared library
ctx.shlib(
source=cxx_sources,
includes='',
target='adql_query',
name='adql_query_sh',
install_path=os.path.join(ctx.env.PREFIX, 'lib'),
use=['boost','cxx14']
)
# Install headers
ctx.install_files(ctx.env.INCLUDEDIR + '/ADQL',
ctx.path.ant_glob('src/**/*.hxx'),
cwd=ctx.path.find_dir('src'), relative_trick=True)
ctx.program(features='test',
source=['test/parse_adql.cxx'],
target='parse_adql',
name='parse_adql',
use=['boost','adql_query_st','cxx14']
)
from waflib.Tools import waf_unit_test
ctx.add_post_fun(waf_unit_test.summary)