blob: 720a4b345bb219344a734c67995f7a52676824c1 [file] [log] [blame]
Roger Meierd3b9dca2011-06-24 14:01:10 +00001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
Kevin Wojniaka3925662019-07-01 11:07:45 -070019AUTOMAKE_OPTIONS = subdir-objects serial-tests nostdinc
Roger Meier81a1f992014-10-22 14:09:43 +020020
Nobuaki Sukegawaa0c5ab72015-02-01 00:27:12 +090021BUILT_SOURCES = gen-cpp/ThriftTest.cpp \
22 gen-cpp/ThriftTest_types.cpp \
23 gen-cpp/ThriftTest_constants.cpp \
James E. King, III58402ff2017-11-17 14:41:46 -050024 gen-cpp/SecondService.cpp \
Copilot1e09a042026-01-29 10:36:28 -080025 gen-cpp/Service.cpp \
26 gen-cpp-forward/ThriftTest_types.cpp \
27 gen-cpp-forward/ThriftTest_constants.cpp \
28 gen-cpp-private/ThriftTest_types.cpp \
29 gen-cpp-private/ThriftTest_constants.cpp \
30 gen-cpp-enumclass/ThriftTest_types.cpp \
copilot-swe-agent[bot]c3cdacf2026-02-09 21:30:16 +000031 gen-cpp-enumclass/ThriftTest_constants.cpp \
32 gen-cpp-templatestreamop/ThriftTest_types.cpp \
33 gen-cpp-templatestreamop/ThriftTest_types.tcc \
34 gen-cpp-templatestreamop/ThriftTest_constants.cpp
Nobuaki Sukegawaa0c5ab72015-02-01 00:27:12 +090035
Roger Meierd3b9dca2011-06-24 14:01:10 +000036noinst_LTLIBRARIES = libtestgencpp.la libstresstestgencpp.la
37nodist_libtestgencpp_la_SOURCES = \
James E. King, III58402ff2017-11-17 14:41:46 -050038 gen-cpp/SecondService.cpp \
39 gen-cpp/SecondService.h \
40 gen-cpp/SecondService.tcc \
Jens Geyer79f988c2014-10-03 20:42:54 +020041 gen-cpp/ThriftTest_constants.cpp \
42 gen-cpp/ThriftTest_constants.h \
43 gen-cpp/ThriftTest_types.cpp \
44 gen-cpp/ThriftTest_types.h \
45 gen-cpp/ThriftTest_types.tcc \
46 gen-cpp/ThriftTest.cpp \
47 gen-cpp/ThriftTest.h \
48 gen-cpp/ThriftTest.tcc \
49 src/ThriftTest_extras.cpp
Roger Meierd3b9dca2011-06-24 14:01:10 +000050
51libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
52
Copilot1e09a042026-01-29 10:36:28 -080053# Libraries for option-specific tests
54noinst_LTLIBRARIES += \
55 libforwardsettertestgencpp.la \
56 libprivateoptonaltestgencpp.la \
copilot-swe-agent[bot]c3cdacf2026-02-09 21:30:16 +000057 libenumclasstestgencpp.la \
58 libtemplatestreamoptestgencpp.la
Copilot1e09a042026-01-29 10:36:28 -080059
60nodist_libforwardsettertestgencpp_la_SOURCES = \
61 gen-cpp-forward/ThriftTest_types.cpp \
62 gen-cpp-forward/ThriftTest_types.h \
63 gen-cpp-forward/ThriftTest_types.tcc \
64 gen-cpp-forward/ThriftTest_constants.cpp \
65 gen-cpp-forward/ThriftTest_constants.h \
66 src/ThriftTest_extras.cpp
67
68libforwardsettertestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
69
70nodist_libprivateoptonaltestgencpp_la_SOURCES = \
71 gen-cpp-private/ThriftTest_types.cpp \
72 gen-cpp-private/ThriftTest_types.h \
73 gen-cpp-private/ThriftTest_constants.cpp \
74 gen-cpp-private/ThriftTest_constants.h \
75 src/ThriftTest_extras.cpp
76
77libprivateoptonaltestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
78
79nodist_libenumclasstestgencpp_la_SOURCES = \
80 gen-cpp-enumclass/ThriftTest_types.cpp \
81 gen-cpp-enumclass/ThriftTest_types.h \
82 gen-cpp-enumclass/ThriftTest_constants.cpp \
83 gen-cpp-enumclass/ThriftTest_constants.h \
84 src/ThriftTest_extras.cpp
85
86libenumclasstestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
87
copilot-swe-agent[bot]c3cdacf2026-02-09 21:30:16 +000088nodist_libtemplatestreamoptestgencpp_la_SOURCES = \
89 gen-cpp-templatestreamop/ThriftTest_types.cpp \
90 gen-cpp-templatestreamop/ThriftTest_types.h \
91 gen-cpp-templatestreamop/ThriftTest_types.tcc \
92 gen-cpp-templatestreamop/ThriftTest_constants.cpp \
93 gen-cpp-templatestreamop/ThriftTest_constants.h \
94 src/ThriftTest_extras.cpp
95
96libtemplatestreamoptestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
97
Roger Meierd3b9dca2011-06-24 14:01:10 +000098nodist_libstresstestgencpp_la_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020099 gen-cpp/StressTest_types.h \
100 gen-cpp/Service.cpp \
101 gen-cpp/Service.h
Roger Meierd3b9dca2011-06-24 14:01:10 +0000102
103libstresstestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
104
Roger Meier41ad4342015-03-24 22:30:40 +0100105precross: TestServer TestClient
106
Roger Meierd3b9dca2011-06-24 14:01:10 +0000107check_PROGRAMS = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200108 TestServer \
109 TestClient \
110 StressTest \
Copilot1e09a042026-01-29 10:36:28 -0800111 StressTestNonBlocking \
112 ForwardSetterTest \
113 PrivateOptionalTest \
copilot-swe-agent[bot]c3cdacf2026-02-09 21:30:16 +0000114 EnumClassTest \
115 TemplateStreamOpTest
Roger Meierd3b9dca2011-06-24 14:01:10 +0000116
117# we currently do not run the testsuite, stop c++ server issue
118# TESTS = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200119# $(check_PROGRAMS)
Roger Meierd3b9dca2011-06-24 14:01:10 +0000120
121TestServer_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200122 src/TestServer.cpp
Roger Meierd3b9dca2011-06-24 14:01:10 +0000123
124TestServer_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200125 libtestgencpp.la \
126 $(top_builddir)/lib/cpp/libthrift.la \
127 $(top_builddir)/lib/cpp/libthriftz.la \
128 $(top_builddir)/lib/cpp/libthriftnb.la \
Dave Watson792db4e2015-01-16 11:22:01 -0800129 -levent -lboost_program_options -lboost_system -lboost_filesystem $(ZLIB_LIBS)
Roger Meierd3b9dca2011-06-24 14:01:10 +0000130
131TestClient_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200132 src/TestClient.cpp
Roger Meierd3b9dca2011-06-24 14:01:10 +0000133
134TestClient_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200135 libtestgencpp.la \
136 $(top_builddir)/lib/cpp/libthrift.la \
137 $(top_builddir)/lib/cpp/libthriftz.la \
138 $(top_builddir)/lib/cpp/libthriftnb.la \
Dave Watson792db4e2015-01-16 11:22:01 -0800139 -levent -lboost_program_options -lboost_system -lboost_filesystem $(ZLIB_LIBS)
Roger Meierd3b9dca2011-06-24 14:01:10 +0000140
141StressTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200142 src/StressTest.cpp
Roger Meierd3b9dca2011-06-24 14:01:10 +0000143
144StressTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200145 libstresstestgencpp.la \
146 $(top_builddir)/lib/cpp/libthrift.la
Roger Meierd3b9dca2011-06-24 14:01:10 +0000147
148StressTestNonBlocking_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200149 src/StressTestNonBlocking.cpp
Roger Meierd3b9dca2011-06-24 14:01:10 +0000150
151StressTestNonBlocking_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200152 libstresstestgencpp.la \
153 $(top_builddir)/lib/cpp/libthriftnb.la \
154 -levent
Copilot1e09a042026-01-29 10:36:28 -0800155
156ForwardSetterTest_SOURCES = \
157 src/ForwardSetterTest.cpp
158
159ForwardSetterTest_CPPFLAGS = -Igen-cpp-forward $(AM_CPPFLAGS)
160ForwardSetterTest_LDADD = \
161 libforwardsettertestgencpp.la \
162 $(top_builddir)/lib/cpp/libthrift.la
163
164PrivateOptionalTest_SOURCES = \
165 src/PrivateOptionalTest.cpp
166
167PrivateOptionalTest_CPPFLAGS = -Igen-cpp-private $(AM_CPPFLAGS)
168PrivateOptionalTest_LDADD = \
169 libprivateoptonaltestgencpp.la \
170 $(top_builddir)/lib/cpp/libthrift.la
171
172EnumClassTest_SOURCES = \
173 src/EnumClassTest.cpp
174
175EnumClassTest_CPPFLAGS = -Igen-cpp-enumclass $(AM_CPPFLAGS)
176EnumClassTest_LDADD = \
177 libenumclasstestgencpp.la \
178 $(top_builddir)/lib/cpp/libthrift.la
179
copilot-swe-agent[bot]c3cdacf2026-02-09 21:30:16 +0000180TemplateStreamOpTest_SOURCES = \
181 src/TemplateStreamOpTest.cpp
182
183TemplateStreamOpTest_CPPFLAGS = -Igen-cpp-templatestreamop $(AM_CPPFLAGS)
184TemplateStreamOpTest_LDADD = \
185 libtemplatestreamoptestgencpp.la \
186 $(top_builddir)/lib/cpp/libthrift.la
187
Roger Meierd3b9dca2011-06-24 14:01:10 +0000188#
189# Common thrift code generation rules
190#
Carel Combrinkfbe685a2025-06-05 08:38:07 +0200191gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/SecondService.cpp gen-cpp/SecondService.h gen-cpp/SecondService.tcc: $(top_srcdir)/test/ThriftTest.thrift $(THRIFT)
Jens Geyer79f988c2014-10-03 20:42:54 +0200192 $(THRIFT) --gen cpp:templates,cob_style -r $<
Roger Meierd3b9dca2011-06-24 14:01:10 +0000193
Copilot1e09a042026-01-29 10:36:28 -0800194# Generate ThriftTest with forward_setter option
195gen-cpp-forward/ThriftTest_types.cpp gen-cpp-forward/ThriftTest_types.h gen-cpp-forward/ThriftTest_types.tcc gen-cpp-forward/ThriftTest_constants.cpp: $(top_srcdir)/test/ThriftTest.thrift $(THRIFT)
196 $(MKDIR_P) gen-cpp-forward
197 $(THRIFT) --gen cpp:moveable_types=forward_setter -out gen-cpp-forward $<
198
199# Generate ThriftTest with private_optional option
200gen-cpp-private/ThriftTest_types.cpp gen-cpp-private/ThriftTest_types.h gen-cpp-private/ThriftTest_constants.cpp: $(top_srcdir)/test/ThriftTest.thrift $(THRIFT)
201 $(MKDIR_P) gen-cpp-private
202 $(THRIFT) --gen cpp:private_optional -out gen-cpp-private $<
203
204# Generate ThriftTest with enum_class option
205gen-cpp-enumclass/ThriftTest_types.cpp gen-cpp-enumclass/ThriftTest_types.h gen-cpp-enumclass/ThriftTest_constants.cpp: $(top_srcdir)/test/ThriftTest.thrift $(THRIFT)
206 $(MKDIR_P) gen-cpp-enumclass
207 $(THRIFT) --gen cpp:pure_enums=enum_class -out gen-cpp-enumclass $<
208
copilot-swe-agent[bot]c3cdacf2026-02-09 21:30:16 +0000209# Generate ThriftTest with template_streamop option
210gen-cpp-templatestreamop/ThriftTest_types.cpp gen-cpp-templatestreamop/ThriftTest_types.h gen-cpp-templatestreamop/ThriftTest_types.tcc gen-cpp-templatestreamop/ThriftTest_constants.cpp: $(top_srcdir)/test/ThriftTest.thrift $(THRIFT)
211 $(MKDIR_P) gen-cpp-templatestreamop
212 $(THRIFT) --gen cpp:template_streamop -out gen-cpp-templatestreamop $<
213
zeshuai00757c25072020-04-09 11:17:05 +0800214gen-cpp/Service.cpp: $(top_srcdir)/test/StressTest.thrift $(THRIFT)
Jens Geyer79f988c2014-10-03 20:42:54 +0200215 $(THRIFT) --gen cpp $<
Roger Meierd3b9dca2011-06-24 14:01:10 +0000216
Zezeng Wang371d92f2020-04-28 14:23:15 +0800217gen-cpp/SpecificNameTest_types.cpp gen-cpp/EchoService.cpp: $(top_srcdir)/test/SpecificName.thrift $(THRIFT)
218 $(THRIFT) --gen cpp $<
219
Kevin Wojniaka3925662019-07-01 11:07:45 -0700220AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(LIBEVENT_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src -Igen-cpp -I.
James E. King, IIId7142b72017-09-01 13:00:36 -0700221AM_CXXFLAGS = -Wall -Wextra -pedantic -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
Roger Meier051ea1c2014-12-20 22:43:24 +0100222AM_LDFLAGS = $(BOOST_LDFLAGS) $(LIBEVENT_LDFLAGS) $(ZLIB_LIBS)
Roger Meierd3b9dca2011-06-24 14:01:10 +0000223
224clean-local:
copilot-swe-agent[bot]c3cdacf2026-02-09 21:30:16 +0000225 $(RM) -r gen-cpp/ gen-cpp-forward/ gen-cpp-private/ gen-cpp-enumclass/ gen-cpp-templatestreamop/
Roger Meierd3b9dca2011-06-24 14:01:10 +0000226
Konrad Grochowski16a23a62014-11-13 15:33:38 +0100227style-local:
228 $(CPPSTYLE_CMD)
229
Thomas63f04582024-03-21 22:51:07 +0900230distdir:
231 $(MAKE) $(AM_MAKEFLAGS) distdir-am
232
Roger Meierd3b9dca2011-06-24 14:01:10 +0000233EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200234 src/TestClient.cpp \
235 src/TestServer.cpp \
236 src/StressTest.cpp \
Copilot1e09a042026-01-29 10:36:28 -0800237 src/StressTestNonBlocking.cpp \
238 src/ForwardSetterTest.cpp \
239 src/PrivateOptionalTest.cpp \
copilot-swe-agent[bot]c3cdacf2026-02-09 21:30:16 +0000240 src/EnumClassTest.cpp \
241 src/TemplateStreamOpTest.cpp