forked from luben/zstd-jni
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
18 lines (18 loc) · 777 Bytes
/
CMakeLists.txt
File metadata and controls
18 lines (18 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
cmake_minimum_required(VERSION 3.5)
include(CheckCCompilerFlag)
project(zstd-jni C ASM)
file(STRINGS "version" NATIVE_VERSION)
find_package(JNI)
include_directories("src/main/native" "src/main/native/common" "src/main/native/compress" "src/main/native/decompress" "src/main/native/dictBuilder" "src/main/native/legacy")
if (JNI_FOUND)
include_directories(${JNI_INCLUDE_DIRS})
endif (JNI_FOUND)
file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/*.[cS]")
add_library(zstd-jni-${NATIVE_VERSION} SHARED ${SOURCES})
add_definitions("-DZSTD_MULTITHREAD=1")
add_definitions("-DZSTD_LEGACY_SUPPORT=4")
CHECK_C_COMPILER_FLAG(-Oz COMPILER_SUPPORTS_OZ)
if(COMPILER_SUPPORTS_OZ)
add_definitions("-Oz")
endif()
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,max-page-size=16384")