Skip to content

Commit 411c829

Browse files
author
Paweł Andruszkiewicz
committed
Make compilation of YACC parsers optional
The compilation of YACC parsers is now optional, this is controlled using the WITH_YACC_PARSER cmake variable. Currently compilation is disabled. Change-Id: I83618386a7a1416a4c0526a0f95f97113c3c0375
1 parent dce7339 commit 411c829

File tree

5 files changed

+34
-7
lines changed

5 files changed

+34
-7
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@ MYSQL_CHECK_SSL()
678678
SET(OPENSSL_VERSION_ID "${OPENSSL_VERSION_MAJOR}${OPENSSL_VERSION_MINOR}${OPENSSL_FIX_VERSION}")
679679
ADD_DEFINITIONS(-DOPENSSL_VERSION_ID=${OPENSSL_VERSION_ID})
680680

681-
INCLUDE(bison)
681+
if(WITH_YACC_PARSER)
682+
INCLUDE(bison)
683+
endif()
682684

683685
if(NOT BUILD_SOURCE_PACKAGE)
684686
if(BUNDLED_ANTLR_DIR)

mysqlshdk/CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ ADD_SUBDIRECTORY(libs/oci)
4646
ADD_SUBDIRECTORY(libs/azure)
4747
ADD_SUBDIRECTORY(libs/ssh)
4848
ADD_SUBDIRECTORY(libs/aws)
49-
ADD_SUBDIRECTORY(libs/yparser)
5049
ADD_SUBDIRECTORY(scripting)
5150
ADD_SUBDIRECTORY(shellcore)
5251

52+
if(WITH_YACC_PARSER)
53+
ADD_SUBDIRECTORY(libs/yparser)
54+
endif()
5355

5456
#TODO: ADD_VERSION_INFO
5557
#merge_libraries(mysqlshdk SHARED
@@ -58,7 +60,7 @@ ADD_SUBDIRECTORY(shellcore)
5860
# scripting
5961
# shellcore)
6062

61-
merge_convenience_libraries(mysqlshdk-static
63+
set(mysqlshdk_LIBS
6264
utils
6365
db
6466
shellssh
@@ -75,8 +77,13 @@ merge_convenience_libraries(mysqlshdk-static
7577
azure
7678
aws
7779
tinyxml2
78-
yparser
79-
SKIP_INSTALL)
80+
)
81+
82+
if(WITH_YACC_PARSER)
83+
list(APPEND mysqlshdk_LIBS yparser)
84+
endif()
85+
86+
merge_convenience_libraries(mysqlshdk-static ${mysqlshdk_LIBS} SKIP_INSTALL)
8087

8188
#target_link_libraries(mysqlshdk
8289
# ${V8_LINK_LIST}

packaging/debian/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ else()
209209
list(APPEND DEB_BUILD_DEPS "libantlr4-runtime-dev (<<4.11)")
210210
endif()
211211

212+
if(WITH_YACC_PARSER)
213+
list(APPEND EXTRA_CMAKE_OPTS "-DWITH_YACC_PARSER=1")
214+
endif()
215+
212216
string(REPLACE ";" " " EXTRA_CMAKE_OPTS "${EXTRA_CMAKE_OPTS}")
213217
string(REPLACE ";" ", " DEB_BUILD_DEPS "${DEB_BUILD_DEPS}")
214218
string(REPLACE ";" ", " DEB_DEPS "${DEB_DEPS}")
@@ -258,7 +262,6 @@ usr/share/mysqlsh/adminapi-metadata/* usr/share/mysqlsh/adminapi-metadata
258262
usr/share/mysqlsh/upgrade_checker.msg
259263
usr/lib/mysqlsh/plugins
260264
usr/lib/mysqlsh/python-packages
261-
usr/lib/mysqlsh/yparser
262265
usr/share/man/man1/mysqlsh.1
263266
")
264267

@@ -308,3 +311,10 @@ file(APPEND "${DEST_DIR}/mysql-shell${PRODUCT_SUFFIX}.install"
308311
usr/lib/mysqlsh/libantlr4-runtime*.so*
309312
")
310313
endif()
314+
315+
if (WITH_YACC_PARSER)
316+
file(APPEND "${DEST_DIR}/mysql-shell${PRODUCT_SUFFIX}.install"
317+
"
318+
usr/lib/mysqlsh/yparser
319+
")
320+
endif()

packaging/rpm/mysql-shell.spec.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ cmake .. \
227227
%endif
228228
%if 0%{?bundled_antlr:1}
229229
-DBUNDLED_ANTLR_DIR="%{bundled_antlr}" \
230+
%endif
231+
%if 0%{?with_yacc_parser:1}
232+
-DWITH_YACC_PARSER=1 \
230233
%endif
231234
-DHAVE_PYTHON=1 \
232235
-DLIBEXECDIR=`basename %{_libexecdir}`
@@ -302,7 +305,9 @@ rm -f %{buildroot}%{_datadir}/mysqlsh/{LICENSE,README}
302305
%endif
303306
%{_prefix}/lib/mysqlsh/plugins/*
304307
%{_prefix}/lib/mysqlsh/python-packages/*
308+
%if 0%{?with_yacc_parser:1}
305309
%{_prefix}/lib/mysqlsh/yparser/*
310+
%endif
306311
%{_mandir}/man1/mysqlsh.1*
307312

308313
%changelog

unittest/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ if(WITH_TESTS)
6969
"${PROJECT_SOURCE_DIR}/unittest/mysqlshdk/libs/innodbcluster/*.cc"
7070
"${PROJECT_SOURCE_DIR}/unittest/mysqlshdk/libs/ssh/*.cc"
7171
"${PROJECT_SOURCE_DIR}/unittest/mysqlshdk/libs/parser/mysql_parser_utils_t.cc"
72-
"${PROJECT_SOURCE_DIR}/unittest/mysqlshdk/libs/yparser/parser_t.cc"
7372
"${PROJECT_SOURCE_DIR}/unittest/mysqlshdk/scripting/*.cc"
7473
"${CMAKE_SOURCE_DIR}/unittest/*_t.cc"
7574
"${CMAKE_SOURCE_DIR}/unittest/test_utils/*.cc"
@@ -104,6 +103,10 @@ if(WITH_TESTS)
104103
"${CMAKE_SOURCE_DIR}/unittest/shell_script_tester.cc"
105104
)
106105

106+
if(WITH_YACC_PARSER)
107+
list(APPEND mysqlsh_tests_SRC "${CMAKE_SOURCE_DIR}/unittest/mysqlshdk/libs/yparser/parser_t.cc")
108+
endif()
109+
107110
if(NOT HAVE_PROTOBUF)
108111
list(REMOVE_ITEM mysqlsh_tests_SRC "${CMAKE_SOURCE_DIR}/unittest/mod_mysqlx_t.cc")
109112
endif()

0 commit comments

Comments
 (0)