Files
MaxScale/server/core/CMakeLists.txt
Johan Wikman b36f6faa7e MXS-1754 Reintroduce maxscale::Worker
Worker is now the base class of all workers. It has a message
queue and can be run in a thread of its own, or in the calling
thread. Worker can not be used as such, but a concrete worker
class must be derived from it. Currently there is only one
concrete class RoutingWorker.

There is some overlapping in functionality between Worker and
RoutingWorker, as there is e.g. a need for broadcasting a
message to all routing workers, but not to other workers.

Currently other workers can not be created as the array for
holding the pointers to the workers is exactly as large as
there will be RoutingWorkers. That will be changed so that
the maximum number of threads is hardwired to some ridiculous
value such as 128. That's the first step in the path towards
a situation where the number of worker threads can be changed
at runtime.
2018-04-16 14:53:08 +03:00

119 lines
2.2 KiB
CMake

add_library(maxscale-common SHARED
admin.cc
adminusers.cc
alloc.cc
atomic.cc
authenticator.cc
backend.cc
buffer.cc
config.cc
config_runtime.cc
dcb.cc
encryption.cc
externcmd.cc
filter.cc
hashtable.cc
hint.cc
housekeeper.cc
httprequest.cc
httpresponse.cc
json_api.cc
listener.cc
load_utils.cc
log_manager.cc
maxscale_pcre2.cc
misc.cc
mlist.cc
messagequeue.cc
modulecmd.cc
modutil.cc
monitor.cc
mysql_binlog.cc
mysql_utils.cc
paths.cc
poll.cc
queryclassifier.cc
query_classifier.cc
random_jkiss.cc
resultset.cc
resource.cc
router.cc
routingworker.cc
secrets.cc
semaphore.cc
server.cc
service.cc
session.cc
session_command.cc
skygw_utils.cc
spinlock.cc
ssl.cc
statistics.cc
thread.cc
users.cc
utils.cc
worker.cc
workertask.cc
)
if(WITH_JEMALLOC)
target_link_libraries(maxscale-common ${JEMALLOC_LIBRARIES})
elseif(WITH_TCMALLOC)
target_link_libraries(maxscale-common ${TCMALLOC_LIBRARIES})
endif()
target_link_libraries(maxscale-common
${MARIADB_CONNECTOR_LIBRARIES}
${LZMA_LINK_FLAGS}
${PCRE2_LIBRARIES}
${JANSSON_LIBRARIES}
ssl
pthread
crypt
crypto
inih
z
rt
m
sqlite3
stdc++
gnutls
gcrypt
${MICROHTTPD_LIBRARIES}
)
find_library(HAVE_LIBDL NAMES dl)
if (HAVE_LIBDL)
# libdl just exposes libc functionality on most systems. This means that if
# we can't find it, it's likely that libc already exposes the symbols.
target_link_libraries(maxscale-common dl)
endif()
add_dependencies(maxscale-common pcre2 connector-c libmicrohttpd jansson)
set_target_properties(maxscale-common PROPERTIES VERSION "1.0.0")
install_module(maxscale-common core)
add_executable(maxscale gateway.cc)
add_dependencies(maxscale pcre2)
if(WITH_JEMALLOC)
target_link_libraries(maxscale ${JEMALLOC_LIBRARIES})
elseif(WITH_TCMALLOC)
target_link_libraries(maxscale ${TCMALLOC_LIBRARIES})
endif()
target_link_libraries(maxscale maxscale-common)
install_executable(maxscale core)
add_executable(maxkeys maxkeys.c)
target_link_libraries(maxkeys maxscale-common)
install_executable(maxkeys core)
add_executable(maxpasswd maxpasswd.c)
target_link_libraries(maxpasswd maxscale-common)
install_executable(maxpasswd core)
if(BUILD_TESTS)
add_subdirectory(test)
endif()