Skip to content

Commit

Permalink
Bug #29776077: PERFSCHEMA TEST COMPONENT SHOULD NOT NEED LIBSERVICES …
Browse files Browse the repository at this point in the history
…OR EXTRA DEFINES

Remove redundant cmake lines for some components:
REMOVE_DEFINITIONS(-DMYSQL_SERVER)
Add explicit check for MYSQL_SERVER defines in MYSQL_ADD_COMPONENT() instead.

Do not link mysqlservices into PFS test components.

Change-Id: I662a7187e104d3f654c0d7120cb9fc544befcb0d
(cherry picked from commit 428a9c1ba317374a53e6c00d696cf45acdd78e6b)
  • Loading branch information
Tor Didriksen committed May 16, 2019
1 parent bc3d8f8 commit 54fc7d5
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 43 deletions.
11 changes: 9 additions & 2 deletions cmake/component.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
Expand Down Expand Up @@ -56,7 +56,7 @@ MACRO(MYSQL_ADD_COMPONENT)
"LINK_LIBRARIES"
"STATIC;MODULE;TEST;NO_INSTALL"
${ARGN}
)
)

# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
Expand All @@ -68,6 +68,13 @@ MACRO(MYSQL_ADD_COMPONENT)
STRING(TOLOWER ${component} component_lower)
STRING(TOLOWER component_${component} target)

GET_PROPERTY(CWD_DEFINITIONS DIRECTORY PROPERTY COMPILE_DEFINITIONS)
LIST(FIND CWD_DEFINITIONS "MYSQL_SERVER" FOUND_DEFINITION)
IF(NOT FOUND_DEFINITION EQUAL -1)
MESSAGE(FATAL_ERROR
"component ${component} has -DMYSQL_SERVER")
ENDIF()

# If not dynamic component, add it to list of built-ins
IF (ARG_STATIC)
IF (NOT "${component}" STREQUAL "MYSQL_SERVER")
Expand Down
4 changes: 1 addition & 3 deletions components/example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
Expand All @@ -20,8 +20,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

REMOVE_DEFINITIONS(-DMYSQL_SERVER)

MYSQL_ADD_COMPONENT(example_component1
english_greeting_service_imp.cc
example_component1.cc
Expand Down
17 changes: 1 addition & 16 deletions components/logging/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
Expand All @@ -24,8 +24,6 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/libbinlogevents/include
)

REMOVE_DEFINITIONS(-DMYSQL_SERVER)

MYSQL_ADD_COMPONENT(log_sink_syseventlog
log_sink_syseventlog.cc
MODULE)
Expand All @@ -34,19 +32,6 @@ MYSQL_ADD_COMPONENT(log_sink_json
log_sink_json.cc
MODULE)

# IF (WITH_SYSTEMD)
#
# MYSQL_ADD_COMPONENT(log_sink_systemd
# log_sink_systemd.cc
# MODULE)
# TARGET_LINK_LIBRARIES(component_log_sink_systemd systemd mysys)
#
# ENDIF()
#
# MYSQL_ADD_COMPONENT(log_sink_xml
# log_sink_xml.cc
# MODULE)

MYSQL_ADD_COMPONENT(log_filter_dragnet
log_filter_dragnet.cc
MODULE)
Expand Down
16 changes: 7 additions & 9 deletions components/pfs_component/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -21,11 +21,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

REMOVE_DEFINITIONS(-DMYSQL_SERVER)

SET(PFS_EXAMPLE_COMPONENT_POPULATION_SOURCE
pfs_example_component_population.cc
pfs_example_continent.cc
pfs_example_country.cc)

MYSQL_ADD_COMPONENT(pfs_example_component_population ${PFS_EXAMPLE_COMPONENT_POPULATION_SOURCE} TEST MODULE)
MYSQL_ADD_COMPONENT(pfs_example_component_population
pfs_example_component_population.cc
pfs_example_continent.cc
pfs_example_country.cc
TEST MODULE
)
4 changes: 1 addition & 3 deletions components/pfs_example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
Expand All @@ -20,8 +20,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

REMOVE_DEFINITIONS(-DMYSQL_SERVER)

MYSQL_ADD_COMPONENT(pfs_example
pfs_example.cc
TEST MODULE)
2 changes: 0 additions & 2 deletions components/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

REMOVE_DEFINITIONS(-DMYSQL_SERVER)

MYSQL_ADD_COMPONENT(test_udf_registration
test_udf_registration.cc
TEST MODULE)
Expand Down
9 changes: 1 addition & 8 deletions components/test/perfschema/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
Expand All @@ -20,17 +20,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

REMOVE_DEFINITIONS(-DMYSQL_SERVER)

MYSQL_ADD_COMPONENT(test_pfs_resource_group
test_pfs_resource_group.cc
TEST MODULE)

TARGET_LINK_LIBRARIES(component_test_pfs_resource_group mysqlservices mysys)

MYSQL_ADD_COMPONENT(test_pfs_notification
test_pfs_notification.cc
TEST MODULE)

TARGET_LINK_LIBRARIES(component_test_pfs_notification mysqlservices)

0 comments on commit 54fc7d5

Please sign in to comment.