-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
CMakeLists.txt
76 lines (67 loc) · 2.33 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
cmake_minimum_required(VERSION 3.0.0)
project (brotli4j)
find_package(Java REQUIRED COMPONENTS Development)
find_package(JNI REQUIRED)
if (JNI_FOUND)
message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}")
endif()
include_directories(${JNI_INCLUDE_DIRS})
SET (BROTLI_INCLUDE_DIRS "brotli/include" "brotli/common")
include_directories(${BROTLI_INCLUDE_DIRS})
SET (LIB_TYPE SHARED)
SET (CMAKE_JNI_TARGET TRUE)
SET (CMAKE_VERBOSE_MAKEFILE ON)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
SET (CMAKE_BUILD_TYPE Release)
endif()
message(STATUS "Build type is '${CMAKE_BUILD_TYPE}'")
SET (CMAKE_C_FLAGS "-flto")
SET (CMAKE_CXX_FLAGS "-Wall -flto")
SET (CMAKE_CXX_STANDARD 11)
SET (CMAKE_CXX_STANDARD_REQUIRED ON)
if(WIN32)
SET(STATIC_LIBRARY_CXX_FLAGS /MD)
add_compile_options(/EHsc)
string(REPLACE "/O2" "/Ox" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
else(WIN32)
SET(STATIC_LIBRARY_CXX_FLAGS)
endif()
add_library (brotli ${LIB_TYPE}
"brotli/common/constants.c"
"brotli/common/context.c"
"brotli/common/dictionary.c"
"brotli/common/platform.c"
"brotli/common/shared_dictionary.c"
"brotli/common/transform.c"
"brotli/dec/bit_reader.c"
"brotli/dec/decode.c"
"brotli/dec/huffman.c"
"brotli/dec/state.c"
"brotli/enc/backward_references.c"
"brotli/enc/backward_references_hq.c"
"brotli/enc/bit_cost.c"
"brotli/enc/block_splitter.c"
"brotli/enc/brotli_bit_stream.c"
"brotli/enc/cluster.c"
"brotli/enc/command.c"
"brotli/enc/compound_dictionary.c"
"brotli/enc/compress_fragment.c"
"brotli/enc/compress_fragment_two_pass.c"
"brotli/enc/dictionary_hash.c"
"brotli/enc/encode.c"
"brotli/enc/encoder_dict.c"
"brotli/enc/entropy_encode.c"
"brotli/enc/fast_log.c"
"brotli/enc/histogram.c"
"brotli/enc/literal_cost.c"
"brotli/enc/memory.c"
"brotli/enc/metablock.c"
"brotli/enc/static_dict.c"
"brotli/enc/utf8_util.c"
"brotli/tools/brotli.c"
"natives/src/main/cpp/common_jni.cc"
"natives/src/main/cpp/decoder_jni.cc"
"natives/src/main/cpp/encoder_jni.cc"
)
SET_TARGET_PROPERTIES (brotli PROPERTIES LINKER_LANGUAGE CXX)