From 216f170493c9bdb82eadcaaa539bc486a03b79c8 Mon Sep 17 00:00:00 2001 From: zwhzzz0821 <2831474076@qq.com> Date: Fri, 13 Dec 2024 16:43:12 +0800 Subject: [PATCH] fix bug in ubuntu --- cpp/src/CMakeLists.txt | 9 +++++---- cpp/third_party/antlr4-cpp-runtime-4/CMakeLists.txt | 1 - .../antlr4-cpp-runtime-4/runtime/src/RuleContext.h | 2 +- cpp/third_party/zlib-1.2.13/CMakeLists.txt | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index a72c0b055..5be2239a6 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -50,11 +50,12 @@ install(TARGETS tsfile LIBRARY DESTINATION ${LIBTSFILE_SDK_DIR}) set(SNAPPY_LIB_NAME "snappy") set(LZ4_LIB_NAME "LZ4") set(LZO_LIB_NAME "lzokay") +set(ZLIB_LIB_NAME "z") target_link_libraries(parser_obj antlr4_shared) -target_link_libraries(compress_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} zlibstatic antlr4_shared ) -target_link_libraries(common_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} zlibstatic antlr4_shared ) -target_link_libraries(read_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} zlibstatic antlr4_shared ) -target_link_libraries(write_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} zlibstatic antlr4_shared ) +target_link_libraries(compress_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} ${ZLIB_LIB_NAME} antlr4_shared ) +target_link_libraries(common_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} ${ZLIB_LIB_NAME} antlr4_shared ) +target_link_libraries(read_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} ${ZLIB_LIB_NAME} antlr4_shared ) +target_link_libraries(write_obj ${SNAPPY_LIB_NAME} ${LZ4_LIB_NAME} ${LZO_LIB_NAME} ${ZLIB_LIB_NAME} antlr4_shared ) # set(CMAKE_PREFIX_PATH ../../third-party/lz4-dev/lib) # set(LZ4_LIB_DIR ../../third-party/lz4-dev/lib) # find_library(my_lz4_lib NAMES lz4 PATHS ${LZ4_LIB_DIR} NO_DEFAULT_PATH REQUIRED) diff --git a/cpp/third_party/antlr4-cpp-runtime-4/CMakeLists.txt b/cpp/third_party/antlr4-cpp-runtime-4/CMakeLists.txt index 9e133d421..a2b404063 100644 --- a/cpp/third_party/antlr4-cpp-runtime-4/CMakeLists.txt +++ b/cpp/third_party/antlr4-cpp-runtime-4/CMakeLists.txt @@ -1,7 +1,6 @@ # -*- mode:cmake -*- cmake_minimum_required (VERSION 3.10) # 2.8 needed because of ExternalProject - # Detect build type, fallback to release and throw a warning if use didn't specify any if(NOT CMAKE_BUILD_TYPE) message(WARNING "Build type not set, falling back to Release mode. diff --git a/cpp/third_party/antlr4-cpp-runtime-4/runtime/src/RuleContext.h b/cpp/third_party/antlr4-cpp-runtime-4/runtime/src/RuleContext.h index 366280cd7..b7f7b0b9f 100755 --- a/cpp/third_party/antlr4-cpp-runtime-4/runtime/src/RuleContext.h +++ b/cpp/third_party/antlr4-cpp-runtime-4/runtime/src/RuleContext.h @@ -128,7 +128,7 @@ namespace antlr4 { virtual std::string toString(const std::vector &ruleNames, RuleContext *stop); - virtual bool operator == (const RuleContext &other) { return this == &other; } // Simple address comparison. + bool equal(const RuleContext &other) { return this == &other; } // Simple address comparison. private: void InitializeInstanceFields(); diff --git a/cpp/third_party/zlib-1.2.13/CMakeLists.txt b/cpp/third_party/zlib-1.2.13/CMakeLists.txt index 377fc5b44..23813dd45 100644 --- a/cpp/third_party/zlib-1.2.13/CMakeLists.txt +++ b/cpp/third_party/zlib-1.2.13/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.11) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) message("-- Configuring zlib") project(zlib C)