diff --git a/CMakeLists.txt b/CMakeLists.txt index e4bd5907a..161f3303f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,7 @@ include(packages) include(dirs) include(includes) include(libs) +include(ColumnstoreLibrary) include(columnstore_version) include(configureEngine) include(compiler_flags) diff --git a/build/bootstrap_mcs.sh b/build/bootstrap_mcs.sh index fa8180b40..ba35528d3 100755 --- a/build/bootstrap_mcs.sh +++ b/build/bootstrap_mcs.sh @@ -38,33 +38,34 @@ cd - >/dev/null echo "Arguments received: $@" message "Building Mariadb Server from $color_yellow$MDB_SOURCE_PATH$color_normal" -optparse.define short=A long=asan desc="Build with ASAN" variable=ASAN default=false value=true -optparse.define short=a long=build-path variable=MARIA_BUILD_PATH default="$MDB_SOURCE_PATH"/../MariaDBBuild -optparse.define short=B long=run-microbench desc="Compile and run microbenchmarks " variable=RUN_BENCHMARKS default=false value=true -optparse.define short=c long=cloud desc="Enable cloud storage" variable=CLOUD_STORAGE_ENABLED default=false value=true -optparse.define short=C long=force-cmake-reconfig desc="Force cmake reconfigure" variable=FORCE_CMAKE_CONFIG default=false value=true +optparse.define short=t long=build-type desc="Build Type: ${BUILD_TYPE_OPTIONS[*]}" variable=MCS_BUILD_TYPE optparse.define short=d long=distro desc="Choose your OS: ${DISTRO_OPTIONS[*]}" variable=OS optparse.define short=D long=install-deps desc="Install dependences" variable=INSTALL_DEPS default=false value=true -optparse.define short=F long=custom-cmake-flags desc="Add custom cmake flags" variable=CUSTOM_CMAKE_FLAGS -optparse.define short=f long=do-not-freeze-revision desc="Disable revision freezing, or do not set 'update none' for columnstore submodule in MDB repository" variable=DO_NOT_FREEZE_REVISION default=false value=true -optparse.define short=G long=draw-deps desc="Draw dependencies graph" variable=DRAW_DEPS default=false value=true -optparse.define short=j long=parallel desc="Number of paralles for build" variable=CPUS default=$(getconf _NPROCESSORS_ONLN) -optparse.define short=M long=skip-smoke desc="Skip final smoke test" variable=SKIP_SMOKE default=false value=true -optparse.define short=N long=ninja desc="Build with ninja" variable=USE_NINJA default=false value=true -optparse.define short=n long=no-clean-install desc="Do not perform a clean install (keep existing db files)" variable=NO_CLEAN default=false value=true -optparse.define short=o long=recompile-only variable=RECOMPILE_ONLY default=false value=true -optparse.define short=p long=build-packages desc="Build packages" variable=BUILD_PACKAGES default=false value=true -optparse.define short=P long=report-path desc="Path for storing reports and profiles" variable=REPORT_PATH default="/core" -optparse.define short=r long=restart-services variable=RESTART_SERVICES default=true value=false -optparse.define short=R long=server-version desc="MariaDB server version" variable=MARIADB_SERVER_VERSION -optparse.define short=s long=sccache desc="Build with sccache" variable=SCCACHE default=false value=true +optparse.define short=C long=force-cmake-reconfig desc="Force cmake reconfigure" variable=FORCE_CMAKE_CONFIG default=false value=true optparse.define short=S long=skip-columnstore-submodules desc="Skip columnstore submodules initialization" variable=SKIP_SUBMODULES default=false value=true -optparse.define short=t long=build-type desc="Build Type: ${BUILD_TYPE_OPTIONS[*]}" variable=MCS_BUILD_TYPE -optparse.define short=T long=tsan desc="Build with TSAN" variable=TSAN default=false value=true optparse.define short=u long=skip-unit-tests desc="Skip UnitTests" variable=SKIP_UNIT_TESTS default=false value=true -optparse.define short=U long=ubsan desc="Build with UBSAN" variable=UBSAN default=false value=true -optparse.define short=v long=verbose desc="Verbose makefile commands" variable=MAKEFILE_VERBOSE default=false value=true +optparse.define short=B long=run-microbench desc="Compile and run microbenchmarks " variable=RUN_BENCHMARKS default=false value=true optparse.define short=W long=without-core-dumps desc="Do not produce core dumps" variable=WITHOUT_COREDUMPS default=false value=true +optparse.define short=v long=verbose desc="Verbose makefile commands" variable=MAKEFILE_VERBOSE default=false value=true +optparse.define short=A long=asan desc="Build with ASAN" variable=ASAN default=false value=true +optparse.define short=T long=tsan desc="Build with TSAN" variable=TSAN default=false value=true +optparse.define short=U long=ubsan desc="Build with UBSAN" variable=UBSAN default=false value=true +optparse.define short=P long=report-path desc="Path for storing reports and profiles" variable=REPORT_PATH default="/core" +optparse.define short=N long=ninja desc="Build with ninja" variable=USE_NINJA default=false value=true +optparse.define short=G long=draw-deps desc="Draw dependencies graph" variable=DRAW_DEPS default=false value=true +optparse.define short=M long=skip-smoke desc="Skip final smoke test" variable=SKIP_SMOKE default=false value=true +optparse.define short=n long=no-clean-install desc="Do not perform a clean install (keep existing db files)" variable=NO_CLEAN default=false value=true +optparse.define short=j long=parallel desc="Number of paralles for build" variable=CPUS default=$(getconf _NPROCESSORS_ONLN) +optparse.define short=F long=show-build-flags desc="Print CMake flags, while build" variable=PRINT_CMAKE_FLAGS default=false value=true +optparse.define short=c long=cloud desc="Enable cloud storage" variable=CLOUD_STORAGE_ENABLED default=false value=true +optparse.define short=f long=do-not-freeze-revision desc="Disable revision freezing, or do not set 'update none' for columnstore submodule in MDB repository" variable=DO_NOT_FREEZE_REVISION default=false value=true +optparse.define short=a long=build-path variable=MARIA_BUILD_PATH default="$MDB_SOURCE_PATH"/../MariaDBBuild +optparse.define short=O long=static desc="Build all with static libraries" variable=STATIC_BUILD default=false value=true +optparse.define short=o long=recompile-only variable=RECOMPILE_ONLY default=false value=true +optparse.define short=r long=restart-services variable=RESTART_SERVICES default=true value=false +optparse.define short=s long=sccache desc="Build with sccache" variable=SCCACHE default=false value=true +optparse.define short=p long=build-packages desc="Build packages" variable=BUILD_PACKAGES default=false value=true +optparse.define short=R long=server-version desc="MariaDB server version" variable=MARIADB_SERVER_VERSION source $(optparse.build) @@ -284,6 +285,11 @@ construct_cmake_flags() { MDB_CMAKE_FLAGS+=(-GNinja) fi + if [[ $STATIC_BUILD = true ]]; then + warn "Building all with static linkage" + MDB_CMAKE_FLAGS+=(-DCOLUMNSTORE_STATIC_LIBRARIES:BOOL=ON) + fi + if [[ $ASAN = true ]]; then warn "Building with Address Sanitizer " MDB_CMAKE_FLAGS+=(-DWITH_ASAN=ON -DWITH_COLUMNSTORE_ASAN=ON -DWITH_COLUMNSTORE_REPORT_PATH=${REPORT_PATH}) @@ -363,10 +369,10 @@ construct_cmake_flags() { MDB_CMAKE_FLAGS+=(-DDEB=${CODENAME}) fi - MDB_CMAKE_FLAGS+=($CUSTOM_CMAKE_FLAGS) - - message "Building with flags" - newline_array "${MDB_CMAKE_FLAGS[@]}" + if [[ $PRINT_CMAKE_FLAGS = true ]]; then + message "Building with flags" + newline_array "${MDB_CMAKE_FLAGS[@]}" + fi } init_submodules() { diff --git a/cmake/ColumnstoreLibrary.cmake b/cmake/ColumnstoreLibrary.cmake new file mode 100644 index 000000000..503b4c540 --- /dev/null +++ b/cmake/ColumnstoreLibrary.cmake @@ -0,0 +1,8 @@ +# Function to create either a static or shared library based on COLUMNSTORE_STATIC_LIBRARIES +macro(columnstore_library libname) + if(COLUMNSTORE_STATIC_LIBRARIES) + add_library(${libname} STATIC ${ARGN}) + else() + add_library(${libname} SHARED ${ARGN}) + endif() +endmacro() diff --git a/datatypes/CMakeLists.txt b/datatypes/CMakeLists.txt index 3526d6184..91b43920c 100644 --- a/datatypes/CMakeLists.txt +++ b/datatypes/CMakeLists.txt @@ -1,11 +1,9 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) set(datatypes_LIB_SRCS mcs_int128.cpp mcs_decimal.cpp) -add_library(datatypes SHARED ${datatypes_LIB_SRCS}) +columnstore_library(datatypes ${datatypes_LIB_SRCS}) add_dependencies(datatypes loggingcpp external_boost) install(TARGETS datatypes DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/dbcon/ddlpackage/CMakeLists.txt b/dbcon/ddlpackage/CMakeLists.txt index 7c639bbf3..3d1b5dfe5 100644 --- a/dbcon/ddlpackage/CMakeLists.txt +++ b/dbcon/ddlpackage/CMakeLists.txt @@ -14,7 +14,7 @@ set_source_files_properties(ddl-gram.cpp PROPERTIES COMPILE_FLAGS "-Wno-unused-b ########### next target ############### include_directories(${CMAKE_CURRENT_BINARY_DIR}) # to pick up flex/bison output -ADD_LIBRARY(ddlpackage SHARED +columnstore_library(ddlpackage serialize.cpp ddl-scan.cpp ddl-gram.cpp @@ -40,4 +40,3 @@ ADD_LIBRARY(ddlpackage SHARED add_dependencies(ddlpackage loggingcpp) INSTALL(TARGETS ddlpackage DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/dbcon/ddlpackageproc/CMakeLists.txt b/dbcon/ddlpackageproc/CMakeLists.txt index d2f2a9a62..788c5bce6 100644 --- a/dbcon/ddlpackageproc/CMakeLists.txt +++ b/dbcon/ddlpackageproc/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) ########### next target ############### @@ -12,11 +11,10 @@ set(ddlpackageproc_LIB_SRCS restorepartitionprocessor.cpp droppartitionprocessor.cpp) -add_library(ddlpackageproc SHARED ${ddlpackageproc_LIB_SRCS}) +columnstore_library(ddlpackageproc ${ddlpackageproc_LIB_SRCS}) add_dependencies(ddlpackageproc loggingcpp) target_link_libraries(ddlpackageproc ${NETSNMP_LIBRARIES}) install(TARGETS ddlpackageproc DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/dbcon/dmlpackage/CMakeLists.txt b/dbcon/dmlpackage/CMakeLists.txt index ccd0b0985..3561d4f4e 100644 --- a/dbcon/dmlpackage/CMakeLists.txt +++ b/dbcon/dmlpackage/CMakeLists.txt @@ -1,4 +1,3 @@ - INCLUDE_DIRECTORIES( ${ENGINE_COMMON_INCLUDES} ) FIND_PACKAGE(BISON REQUIRED) @@ -15,7 +14,7 @@ set_source_files_properties(dml-gram.cpp PROPERTIES COMPILE_FLAGS "-Wno-unused-b ########### next target ############### include_directories(${CMAKE_CURRENT_BINARY_DIR}) # to pick up flex/bison output -ADD_LIBRARY(dmlpackage SHARED +columnstore_library(dmlpackage dml-scan.cpp dml-gram.cpp calpontdmlfactory.cpp @@ -40,4 +39,3 @@ ADD_LIBRARY(dmlpackage SHARED add_dependencies(dmlpackage loggingcpp) INSTALL(TARGETS dmlpackage DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/dbcon/dmlpackageproc/CMakeLists.txt b/dbcon/dmlpackageproc/CMakeLists.txt index 6717045e8..e44609f7a 100644 --- a/dbcon/dmlpackageproc/CMakeLists.txt +++ b/dbcon/dmlpackageproc/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -13,12 +12,10 @@ set(dmlpackageproc_LIB_SRCS autoincrementdata.cpp tablelockdata.cpp) -add_library(dmlpackageproc SHARED ${dmlpackageproc_LIB_SRCS}) +columnstore_library(dmlpackageproc ${dmlpackageproc_LIB_SRCS}) add_dependencies(dmlpackageproc loggingcpp) target_link_libraries(dmlpackageproc ${NETSNMP_LIBRARIES}) install(TARGETS dmlpackageproc DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - - diff --git a/dbcon/execplan/CMakeLists.txt b/dbcon/execplan/CMakeLists.txt index d65503a1e..4a30e8505 100755 --- a/dbcon/execplan/CMakeLists.txt +++ b/dbcon/execplan/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ${ENGINE_UTILS_UDFSDK_INCLUDE} ${ENGINE_DATATYPES_INCLUDE}) @@ -46,7 +45,7 @@ set(execplan_LIB_SRCS windowfunctioncolumn.cpp udafcolumn.cpp) -add_library(execplan SHARED ${execplan_LIB_SRCS}) +columnstore_library(execplan ${execplan_LIB_SRCS}) add_dependencies(execplan loggingcpp) diff --git a/dbcon/joblist/CMakeLists.txt b/dbcon/joblist/CMakeLists.txt index aabf31c48..9342761c0 100644 --- a/dbcon/joblist/CMakeLists.txt +++ b/dbcon/joblist/CMakeLists.txt @@ -1,5 +1,5 @@ -include_directories( ${ENGINE_COMMON_INCLUDES} ${ENGINE_SRC_DIR}/tools/passwd) -########### next target ############### +include_directories(${ENGINE_COMMON_INCLUDES} ${ENGINE_SRC_DIR}/tools/passwd) +# ########## next target ############### set(joblist_LIB_SRCS anydatalist.cpp @@ -52,28 +52,36 @@ set(joblist_LIB_SRCS unique32generator.cpp virtualtable.cpp windowfunctionstep.cpp - ${ENGINE_SRC_DIR}/tools/passwd/secrets.cpp) + ${ENGINE_SRC_DIR}/tools/passwd/secrets.cpp +) -########### next target ############### +# ########## next target ############### add_library(joblist_server STATIC ${joblist_LIB_SRCS}) add_dependencies(joblist_server loggingcpp) -########### next target ############### +# ########## next target ############### add_definitions(-DMYSQL_SERVICE_THD_TIMEZONE_INCLUDED) -add_library(joblist SHARED ${joblist_LIB_SRCS}) -target_include_directories(joblist BEFORE PUBLIC ${OPENSSL_INCLUDE_DIR} - ${LIBMARIADB_BININC_DIR} - ${LIBMARIADB_SRCINC_DIR}) +columnstore_library(joblist ${joblist_LIB_SRCS}) +target_include_directories( + joblist BEFORE PUBLIC ${OPENSSL_INCLUDE_DIR} ${LIBMARIADB_BININC_DIR} ${LIBMARIADB_SRCINC_DIR} +) add_dependencies(joblist loggingcpp) -install(TARGETS joblist DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) +install( + TARGETS joblist + DESTINATION ${ENGINE_LIBDIR} + COMPONENT columnstore-engine +) -if (WITH_ORDERBY_UT) +if(WITH_ORDERBY_UT) add_executable(job_orderby_tests orderby-tests.cpp) target_link_libraries(job_orderby_tests ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit) - install(TARGETS job_orderby_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine) + install( + TARGETS job_orderby_tests + DESTINATION ${ENGINE_BINDIR} + COMPONENT columnstore-engine + ) endif() - diff --git a/oam/oamcpp/CMakeLists.txt b/oam/oamcpp/CMakeLists.txt index 6c71af12e..51eee0694 100644 --- a/oam/oamcpp/CMakeLists.txt +++ b/oam/oamcpp/CMakeLists.txt @@ -6,7 +6,7 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(oamcpp_LIB_SRCS liboamcpp.cpp oamcache.cpp) -add_library(oamcpp SHARED ${oamcpp_LIB_SRCS}) +columnstore_library(oamcpp ${oamcpp_LIB_SRCS}) add_dependencies(oamcpp loggingcpp) diff --git a/utils/batchloader/CMakeLists.txt b/utils/batchloader/CMakeLists.txt index 6efc15fba..2e0896b45 100644 --- a/utils/batchloader/CMakeLists.txt +++ b/utils/batchloader/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -6,12 +5,10 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(batchloader_LIB_SRCS batchloader.cpp) -add_library(batchloader SHARED ${batchloader_LIB_SRCS}) +columnstore_library(batchloader ${batchloader_LIB_SRCS}) add_dependencies(batchloader loggingcpp) target_link_libraries(batchloader ${NETSNMP_LIBRARIES}) install(TARGETS batchloader DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - - diff --git a/utils/cacheutils/CMakeLists.txt b/utils/cacheutils/CMakeLists.txt index 2f6b5fe50..e10e13228 100644 --- a/utils/cacheutils/CMakeLists.txt +++ b/utils/cacheutils/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -6,9 +5,8 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(cacheutils_LIB_SRCS cacheutils.cpp) -add_library(cacheutils SHARED ${cacheutils_LIB_SRCS}) +columnstore_library(cacheutils ${cacheutils_LIB_SRCS}) add_dependencies(cacheutils loggingcpp) install(TARGETS cacheutils DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/utils/cloudio/CMakeLists.txt b/utils/cloudio/CMakeLists.txt index 57535719b..afbfff0e1 100755 --- a/utils/cloudio/CMakeLists.txt +++ b/utils/cloudio/CMakeLists.txt @@ -2,7 +2,7 @@ include_directories(${ENGINE_COMMON_INCLUDES} ${ENGINE_SRC_DIR}/storage-manager/ set(cloudio_LIB_SRCS SMComm.cpp SMDataFile.cpp SMFileFactory.cpp SMFileSystem.cpp SocketPool.cpp cloud_plugin.cpp ../../datatypes/mcs_datatype.cpp) -add_library(cloudio SHARED ${cloudio_LIB_SRCS}) +columnstore_library(cloudio ${cloudio_LIB_SRCS}) # IDBDataFile currently depends on cloudio, which is backward. # Once cloudio has been turned into a proper plugin for idbdatafile, @@ -26,4 +26,3 @@ target_link_libraries(end_to_end_test ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS} clou #target_link_libraries(cloudio_component_test cloudio) # Copy end_to_end_test dataFile to binary directory FILE(COPY testData DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) - diff --git a/utils/common/CMakeLists.txt b/utils/common/CMakeLists.txt index 17d78d476..2358590c7 100644 --- a/utils/common/CMakeLists.txt +++ b/utils/common/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) ########### next target ############### @@ -14,11 +13,10 @@ set(common_LIB_SRCS statistics.cpp string_prefixes.cpp) -add_library(common SHARED ${common_LIB_SRCS}) +columnstore_library(common ${common_LIB_SRCS}) target_link_libraries(common boost_filesystem) add_dependencies(common loggingcpp) install(TARGETS common DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/utils/compress/CMakeLists.txt b/utils/compress/CMakeLists.txt index 0e04d3cc5..4f2855c99 100644 --- a/utils/compress/CMakeLists.txt +++ b/utils/compress/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ${SNAPPY_INCLUDE_DIR} ) #hack for lz4 duplicate header @@ -11,7 +10,7 @@ set(compress_LIB_SRCS add_definitions(-DNDEBUG) -add_library(compress SHARED ${compress_LIB_SRCS}) +columnstore_library(compress ${compress_LIB_SRCS}) add_dependencies(compress loggingcpp external_boost) target_link_libraries(compress ${SNAPPY_LIBRARIES}) diff --git a/utils/configcpp/CMakeLists.txt b/utils/configcpp/CMakeLists.txt index f55f20a74..15dc8c1fb 100644 --- a/utils/configcpp/CMakeLists.txt +++ b/utils/configcpp/CMakeLists.txt @@ -1,14 +1,12 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) ########### next target ############### set(configcpp_LIB_SRCS configcpp.cpp xmlparser.cpp configstream.cpp) -add_library(configcpp SHARED ${configcpp_LIB_SRCS}) +columnstore_library(configcpp ${configcpp_LIB_SRCS}) add_dependencies(configcpp loggingcpp) target_compile_definitions(configcpp PUBLIC BOOST_NO_CXX11_SCOPED_ENUMS) install(TARGETS configcpp DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/utils/dataconvert/CMakeLists.txt b/utils/dataconvert/CMakeLists.txt index 3e37b3c0e..2b7e084fb 100644 --- a/utils/dataconvert/CMakeLists.txt +++ b/utils/dataconvert/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -6,7 +5,7 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(dataconvert_LIB_SRCS dataconvert.cpp) -add_library(dataconvert SHARED ${dataconvert_LIB_SRCS}) +columnstore_library(dataconvert ${dataconvert_LIB_SRCS}) add_dependencies(dataconvert loggingcpp) diff --git a/utils/ddlcleanup/CMakeLists.txt b/utils/ddlcleanup/CMakeLists.txt index 4ac17b51c..862331826 100644 --- a/utils/ddlcleanup/CMakeLists.txt +++ b/utils/ddlcleanup/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -6,11 +5,10 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(ddlcleanuputil_LIB_SRCS ddlcleanuputil.cpp) -add_library(ddlcleanuputil SHARED ${ddlcleanuputil_LIB_SRCS}) +columnstore_library(ddlcleanuputil ${ddlcleanuputil_LIB_SRCS}) add_dependencies(ddlcleanuputil loggingcpp) target_link_libraries(ddlcleanuputil ${NETSNMP_LIBRARIES}) install(TARGETS ddlcleanuputil DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/utils/funcexp/CMakeLists.txt b/utils/funcexp/CMakeLists.txt index 85c702676..d8e54ab88 100644 --- a/utils/funcexp/CMakeLists.txt +++ b/utils/funcexp/CMakeLists.txt @@ -1,8 +1,5 @@ include_directories(${ENGINE_COMMON_INCLUDES}) -# ########## next target ############### -# func_decode_oracle.cpp - set(funcexp_LIB_SRCS functor.cpp funcexp.cpp @@ -145,7 +142,7 @@ set(funcexp_LIB_SRCS sql_crypt.cpp ) -add_library(funcexp SHARED ${funcexp_LIB_SRCS}) +columnstore_library(funcexp ${funcexp_LIB_SRCS}) add_dependencies(funcexp loggingcpp) diff --git a/utils/idbdatafile/CMakeLists.txt b/utils/idbdatafile/CMakeLists.txt index 1793f23c0..8d184652a 100644 --- a/utils/idbdatafile/CMakeLists.txt +++ b/utils/idbdatafile/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ../cloudio) ########### next target ############### @@ -13,7 +12,7 @@ set(idbdatafile_LIB_SRCS PosixFileSystem.cpp UnbufferedFile.cpp) -add_library(idbdatafile SHARED ${idbdatafile_LIB_SRCS}) +columnstore_library(idbdatafile ${idbdatafile_LIB_SRCS}) target_link_libraries(idbdatafile ${NETSNMP_LIBRARIES} ${ENGINE_OAM_LIBS} boost_filesystem boost_system) diff --git a/utils/joiner/CMakeLists.txt b/utils/joiner/CMakeLists.txt index 66c2b5146..1892205eb 100644 --- a/utils/joiner/CMakeLists.txt +++ b/utils/joiner/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -6,10 +5,8 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(joiner_LIB_SRCS tuplejoiner.cpp joinpartition.cpp) -add_library(joiner SHARED ${joiner_LIB_SRCS}) +columnstore_library(joiner ${joiner_LIB_SRCS}) add_dependencies(joiner loggingcpp) install(TARGETS joiner DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - - diff --git a/utils/libmysql_client/CMakeLists.txt b/utils/libmysql_client/CMakeLists.txt index 41b724493..7503ddb21 100644 --- a/utils/libmysql_client/CMakeLists.txt +++ b/utils/libmysql_client/CMakeLists.txt @@ -9,10 +9,9 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(libmysql_client_LIB_SRCS libmysql_client.cpp) -add_library(libmysql_client SHARED ${libmysql_client_LIB_SRCS}) +columnstore_library(libmysql_client ${libmysql_client_LIB_SRCS}) target_link_libraries(libmysql_client ${MARIADB_CLIENT_LIBS}) add_dependencies(libmysql_client loggingcpp) install(TARGETS libmysql_client DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/utils/loggingcpp/CMakeLists.txt b/utils/loggingcpp/CMakeLists.txt index c217775ac..b951f4b2b 100644 --- a/utils/loggingcpp/CMakeLists.txt +++ b/utils/loggingcpp/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) ########### next target ############### @@ -18,7 +17,7 @@ ADD_CUSTOM_COMMAND( set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/messageids.h PROPERTIES GENERATED TRUE) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/errorids.h PROPERTIES GENERATED TRUE) -add_library(loggingcpp SHARED +columnstore_library(loggingcpp message.cpp messagelog.cpp logger.cpp @@ -34,4 +33,3 @@ add_dependencies(loggingcpp external_boost) install(TARGETS loggingcpp DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) install(FILES MessageFile.txt ErrorMessage.txt DESTINATION ${ENGINE_SYSCONFDIR}/columnstore COMPONENT columnstore-engine) - diff --git a/utils/querystats/CMakeLists.txt b/utils/querystats/CMakeLists.txt index 0056bf7fc..0a4c05240 100644 --- a/utils/querystats/CMakeLists.txt +++ b/utils/querystats/CMakeLists.txt @@ -9,9 +9,8 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(querystats_LIB_SRCS querystats.cpp) -add_library(querystats SHARED ${querystats_LIB_SRCS}) +columnstore_library(querystats ${querystats_LIB_SRCS}) add_dependencies(querystats loggingcpp) install(TARGETS querystats DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/utils/querytele/CMakeLists.txt b/utils/querytele/CMakeLists.txt index 6575bcafd..2ba5a743c 100644 --- a/utils/querytele/CMakeLists.txt +++ b/utils/querytele/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -12,10 +11,9 @@ set(querytele_LIB_SRCS QueryTeleService.cpp queryteleprotoimpl.cpp) -add_library(querytele SHARED ${querytele_LIB_SRCS}) +columnstore_library(querytele ${querytele_LIB_SRCS}) add_dependencies(querytele external_boost external_thrift) target_include_directories(querytele PRIVATE ${THRIFT_INCLUDE_DIRS}) target_link_libraries(querytele ${THRIFT_LIBRARY}) install(TARGETS querytele DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/utils/regr/CMakeLists.txt b/utils/regr/CMakeLists.txt index a4ed6cd0e..45ab3a5d3 100755 --- a/utils/regr/CMakeLists.txt +++ b/utils/regr/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ../../dbcon/mysql ) @@ -8,7 +7,7 @@ set(regr_LIB_SRCS regr_avgx.cpp regr_avgy.cpp regr_count.cpp regr_slope.cpp regr add_definitions(-DMYSQL_DYNAMIC_PLUGIN) -add_library(regr SHARED ${regr_LIB_SRCS} ) +columnstore_library(regr ${regr_LIB_SRCS} ) add_dependencies(regr loggingcpp) @@ -18,7 +17,7 @@ install(TARGETS regr DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) set(regr_mysql_LIB_SRCS regrmysql.cpp modamysql.cpp) -add_library(regr_mysql SHARED ${regr_mysql_LIB_SRCS}) +columnstore_library(regr_mysql ${regr_mysql_LIB_SRCS}) add_dependencies(regr_mysql external_boost) install(TARGETS regr_mysql DESTINATION ${MARIADB_PLUGINDIR} COMPONENT columnstore-engine) diff --git a/utils/rowgroup/CMakeLists.txt b/utils/rowgroup/CMakeLists.txt index dcdcd4766..2a20400b1 100644 --- a/utils/rowgroup/CMakeLists.txt +++ b/utils/rowgroup/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -8,7 +7,7 @@ set(rowgroup_LIB_SRCS rowaggregation.cpp rowgroup.cpp rowstorage.cpp) #librowgroup_la_CXXFLAGS = $(march_flags) $(AM_CXXFLAGS) -add_library(rowgroup SHARED ${rowgroup_LIB_SRCS}) +columnstore_library(rowgroup ${rowgroup_LIB_SRCS}) add_dependencies(rowgroup loggingcpp external_boost) diff --git a/utils/rwlock/CMakeLists.txt b/utils/rwlock/CMakeLists.txt index c4e401c7f..5858c0f84 100644 --- a/utils/rwlock/CMakeLists.txt +++ b/utils/rwlock/CMakeLists.txt @@ -1,14 +1,8 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) - - -########### next target ############### - set(rwlock_LIB_SRCS rwlock.cpp rwlock_local.cpp) -add_library(rwlock SHARED ${rwlock_LIB_SRCS}) +columnstore_library(rwlock ${rwlock_LIB_SRCS}) add_dependencies(rwlock external_boost) install(TARGETS rwlock DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/utils/startup/CMakeLists.txt b/utils/startup/CMakeLists.txt index 26d65e580..3a84c750e 100644 --- a/utils/startup/CMakeLists.txt +++ b/utils/startup/CMakeLists.txt @@ -1,11 +1,8 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) ADD_DEFINITIONS(-fPIC -DPIC) -add_library(idbboot STATIC installdir.cpp) +columnstore_library(idbboot installdir.cpp) add_dependencies(idbboot external_boost) INSTALL(TARGETS idbboot DESTINATION ${ENGINE_LIBDIR}) - - diff --git a/utils/threadpool/CMakeLists.txt b/utils/threadpool/CMakeLists.txt index 175e2a68a..c845c207c 100644 --- a/utils/threadpool/CMakeLists.txt +++ b/utils/threadpool/CMakeLists.txt @@ -1,11 +1,10 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) ########### next target ############### set(threadpool_LIB_SRCS weightedthreadpool.cpp threadpool.cpp prioritythreadpool.cpp fair_threadpool.cpp) -add_library(threadpool SHARED ${threadpool_LIB_SRCS}) +columnstore_library(threadpool ${threadpool_LIB_SRCS}) add_dependencies(threadpool loggingcpp external_boost) target_link_libraries(threadpool boost_chrono) install(TARGETS threadpool DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) diff --git a/utils/udfsdk/CMakeLists.txt b/utils/udfsdk/CMakeLists.txt index baac65ddd..53986d56f 100755 --- a/utils/udfsdk/CMakeLists.txt +++ b/utils/udfsdk/CMakeLists.txt @@ -1,5 +1,4 @@ include_directories(${ENGINE_COMMON_INCLUDES} ../../dbcon/mysql) -# ########## next target ############### set(udfsdk_LIB_SRCS udfsdk.cpp @@ -13,7 +12,7 @@ set(udfsdk_LIB_SRCS add_definitions(-DMYSQL_DYNAMIC_PLUGIN) -add_library(udfsdk SHARED ${udfsdk_LIB_SRCS}) +columnstore_library(udfsdk ${udfsdk_LIB_SRCS}) add_dependencies(udfsdk loggingcpp) diff --git a/utils/windowfunction/CMakeLists.txt b/utils/windowfunction/CMakeLists.txt index 218a43803..b322a83b5 100755 --- a/utils/windowfunction/CMakeLists.txt +++ b/utils/windowfunction/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -24,7 +23,7 @@ set(windowfunction_LIB_SRCS wf_sum_avg.cpp wf_udaf.cpp) -add_library(windowfunction SHARED ${windowfunction_LIB_SRCS}) +columnstore_library(windowfunction ${windowfunction_LIB_SRCS}) add_dependencies(windowfunction loggingcpp) diff --git a/versioning/BRM/CMakeLists.txt b/versioning/BRM/CMakeLists.txt index ac165d79e..d3c096e42 100644 --- a/versioning/BRM/CMakeLists.txt +++ b/versioning/BRM/CMakeLists.txt @@ -34,7 +34,7 @@ set(brm_LIB_SRCS vss.cpp ../../datatypes/mcs_datatype.cpp) -add_library(brm SHARED ${brm_LIB_SRCS}) +columnstore_library(brm ${brm_LIB_SRCS}) add_dependencies(brm loggingcpp) diff --git a/writeengine/bulk/CMakeLists.txt b/writeengine/bulk/CMakeLists.txt index 10d360cb7..4b722f5d7 100644 --- a/writeengine/bulk/CMakeLists.txt +++ b/writeengine/bulk/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ${S3API_DIR} ) link_directories(${CMAKE_BINARY_DIR}/lib) @@ -26,7 +25,7 @@ set(we_bulk_STAT_SRCS we_workers.cpp) ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64) -add_library(we_bulk STATIC ${we_bulk_STAT_SRCS}) +columnstore_library(we_bulk ${we_bulk_STAT_SRCS}) add_dependencies(we_bulk loggingcpp) @@ -43,4 +42,3 @@ add_dependencies(cpimport.bin marias3) target_link_libraries(cpimport.bin ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${ENGINE_WRITE_LIBS} ${S3API_DEPS} we_bulk we_xml) install(TARGETS cpimport.bin DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine) - diff --git a/writeengine/client/CMakeLists.txt b/writeengine/client/CMakeLists.txt index af843360c..8e2886980 100644 --- a/writeengine/client/CMakeLists.txt +++ b/writeengine/client/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -6,12 +5,10 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ) set(writeengineclient_LIB_SRCS we_clients.cpp we_ddlcommandclient.cpp we_dmlcommandclient.cpp) -add_library(writeengineclient SHARED ${writeengineclient_LIB_SRCS}) +columnstore_library(writeengineclient ${writeengineclient_LIB_SRCS}) add_dependencies(writeengineclient loggingcpp) target_link_libraries(writeengineclient ${NETSNMP_LIBRARIES}) install(TARGETS writeengineclient DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - - diff --git a/writeengine/redistribute/CMakeLists.txt b/writeengine/redistribute/CMakeLists.txt index 3de34bd9d..286f957e9 100644 --- a/writeengine/redistribute/CMakeLists.txt +++ b/writeengine/redistribute/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) ########### next target ############### @@ -9,7 +8,7 @@ set(writeengineredistribute_LIB_SRCS we_redistributecontrolthread.cpp we_redistributeworkerthread.cpp) -add_library(writeengineredistribute SHARED ${writeengineredistribute_LIB_SRCS}) +columnstore_library(writeengineredistribute ${writeengineredistribute_LIB_SRCS}) add_dependencies(writeengineredistribute loggingcpp) @@ -19,4 +18,3 @@ target_compile_definitions(writeengineredistribute PUBLIC BOOST_NO_CXX11_SCOPED_ install(TARGETS writeengineredistribute DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine) - diff --git a/writeengine/wrapper/CMakeLists.txt b/writeengine/wrapper/CMakeLists.txt index 6051d83c5..8d5f50d36 100644 --- a/writeengine/wrapper/CMakeLists.txt +++ b/writeengine/wrapper/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -37,7 +36,7 @@ set(writeengine_LIB_SRCS add_definitions(-D_FILE_OFFSET_BITS=64) -add_library(writeengine SHARED ${writeengine_LIB_SRCS}) +columnstore_library(writeengine ${writeengine_LIB_SRCS}) add_dependencies(writeengine loggingcpp) diff --git a/writeengine/xml/CMakeLists.txt b/writeengine/xml/CMakeLists.txt index bda4191d4..03626d43b 100644 --- a/writeengine/xml/CMakeLists.txt +++ b/writeengine/xml/CMakeLists.txt @@ -1,4 +1,3 @@ - include_directories( ${ENGINE_COMMON_INCLUDES} ) @@ -12,9 +11,8 @@ set(we_xml_STAT_SRCS add_definitions(-D_FILE_OFFSET_BITS=64) -add_library(we_xml STATIC ${we_xml_STAT_SRCS}) +columnstore_library(we_xml ${we_xml_STAT_SRCS}) add_dependencies(we_xml loggingcpp) INSTALL(TARGETS we_xml DESTINATION ${ENGINE_LIBDIR}) -