Fix linux build

This commit is contained in:
Hannemit 2020-02-03 15:17:41 +00:00
parent 6b3d4b8172
commit e33f9fad97
2 changed files with 84 additions and 1 deletions

View File

@ -11,6 +11,47 @@ index f5f0ad7..3dca82e 100644
set(LIB_NAME_STATIC ${LIB_NAME}_static) set(LIB_NAME_STATIC ${LIB_NAME}_static)
else() else()
set(LIB_NAME_STATIC ${LIB_NAME}) set(LIB_NAME_STATIC ${LIB_NAME})
diff --git a/cpp/cmake_modules/FindLz4.cmake b/cpp/cmake_modules/FindLz4.cmake
index 8410916..a196b25 100644
--- a/cpp/cmake_modules/FindLz4.cmake
+++ b/cpp/cmake_modules/FindLz4.cmake
@@ -19,14 +19,16 @@ if(MSVC AND NOT DEFINED LZ4_MSVC_STATIC_LIB_SUFFIX)
set(LZ4_MSVC_STATIC_LIB_SUFFIX "_static")
endif()
-set(LZ4_STATIC_LIB_SUFFIX "${LZ4_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ set(LZ4_LIB_NAME_DEBUG_SUFFIX d)
+endif()
-set(LZ4_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}lz4${LZ4_STATIC_LIB_SUFFIX})
+set(LZ4_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}lz4${LZ4_MSVC_STATIC_LIB_SUFFIX}${LZ4_LIB_NAME_DEBUG_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
if(LZ4_ROOT)
find_library(
LZ4_LIB
- NAMES lz4 ${LZ4_STATIC_LIB_NAME} lib${LZ4_STATIC_LIB_NAME}
+ NAMES lz4${LZ4_LIB_NAME_DEBUG_SUFFIX} ${LZ4_STATIC_LIB_NAME} lib${LZ4_STATIC_LIB_NAME}
"${CMAKE_SHARED_LIBRARY_PREFIX}lz4_static${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATHS ${LZ4_ROOT}
PATH_SUFFIXES ${LIB_PATH_SUFFIXES}
@@ -43,14 +45,14 @@ else()
set(LZ4_INCLUDE_DIR "${LZ4_PC_INCLUDEDIR}")
list(APPEND LZ4_PC_LIBRARY_DIRS "${LZ4_PC_LIBDIR}")
- find_library(LZ4_LIB lz4
+ find_library(LZ4_LIB lz4${LZ4_LIB_NAME_DEBUG_SUFFIX} ${LZ4_STATIC_LIB_NAME} lib${LZ4_STATIC_LIB_NAME}
PATHS ${LZ4_PC_LIBRARY_DIRS}
NO_DEFAULT_PATH
PATH_SUFFIXES ${LIB_PATH_SUFFIXES})
else()
find_library(
LZ4_LIB
- NAMES lz4 ${LZ4_STATIC_LIB_NAME} lib${LZ4_STATIC_LIB_NAME}
+ NAMES lz4${LZ4_LIB_NAME_DEBUG_SUFFIX} ${LZ4_STATIC_LIB_NAME} lib${LZ4_STATIC_LIB_NAME}
"${CMAKE_SHARED_LIBRARY_PREFIX}lz4_static${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATH_SUFFIXES ${LIB_PATH_SUFFIXES})
find_path(LZ4_INCLUDE_DIR NAMES lz4.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES})
diff --git a/cpp/cmake_modules/FindThrift.cmake b/cpp/cmake_modules/FindThrift.cmake diff --git a/cpp/cmake_modules/FindThrift.cmake b/cpp/cmake_modules/FindThrift.cmake
index f9d6296..82b8d22 100644 index f9d6296..82b8d22 100644
--- a/cpp/cmake_modules/FindThrift.cmake --- a/cpp/cmake_modules/FindThrift.cmake
@ -46,6 +87,48 @@ index f9d6296..82b8d22 100644
PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib") PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib")
find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h PATH_SUFFIXES "include") find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h PATH_SUFFIXES "include")
find_program(THRIFT_COMPILER thrift PATH_SUFFIXES "bin") find_program(THRIFT_COMPILER thrift PATH_SUFFIXES "bin")
diff --git a/cpp/cmake_modules/FindZSTD.cmake b/cpp/cmake_modules/FindZSTD.cmake
index 8e47086..d7ce559 100644
--- a/cpp/cmake_modules/FindZSTD.cmake
+++ b/cpp/cmake_modules/FindZSTD.cmake
@@ -19,14 +19,18 @@ if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX)
set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static")
endif()
-set(ZSTD_STATIC_LIB_SUFFIX "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ set(ZSTD_LIB_NAME_DEBUG_SUFFIX d)
+endif()
+
+set(ZSTD_STATIC_LIB_SUFFIX "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${ZSTD_LIB_NAME_DEBUG_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(ZSTD_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX})
# First, find via if specified ZTD_ROOT
if(ZSTD_ROOT)
message(STATUS "Using ZSTD_ROOT: ${ZSTD_ROOT}")
find_library(ZSTD_LIB
- NAMES zstd "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}"
+ NAMES zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}"
"${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATHS ${ZSTD_ROOT}
PATH_SUFFIXES ${LIB_PATH_SUFFIXES}
@@ -44,14 +48,14 @@ else()
set(ZSTD_INCLUDE_DIR "${ZSTD_PC_INCLUDEDIR}")
list(APPEND ZSTD_PC_LIBRARY_DIRS "${ZSTD_PC_LIBDIR}")
- find_library(ZSTD_LIB zstd
+ find_library(ZSTD_LIB zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX}
PATHS ${ZSTD_PC_LIBRARY_DIRS}
NO_DEFAULT_PATH
PATH_SUFFIXES ${LIB_PATH_SUFFIXES})
# Third, check all other CMake paths
else()
find_library(ZSTD_LIB
- NAMES zstd "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}"
+ NAMES zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}"
"${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATH_SUFFIXES ${LIB_PATH_SUFFIXES})
find_path(ZSTD_INCLUDE_DIR NAMES zstd.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES})
diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake
index 75b33c2..80cac9a 100644 index 75b33c2..80cac9a 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake --- a/cpp/cmake_modules/SetupCxxFlags.cmake

View File

@ -55,4 +55,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake)
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/arrow RENAME copyright) file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/arrow RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)