forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
128 lines (112 loc) · 4.35 KB
/
Copy pathCMakeLists.txt
File metadata and controls
128 lines (112 loc) · 4.35 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
project(System.IO.Compression.Native)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "Binary directory isn't being correctly set before calling Cmake. Tree must be built in separate directory from source.")
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if (GEN_SHARED_LIB)
include (GenerateExportHeader)
endif()
if($ENV{__BuildArch} STREQUAL x86 OR $ENV{__BuildArch} STREQUAL x64)
set(NATIVECOMPRESSION_SOURCES
zlib-intel/adler32.c
zlib-intel/compress.c
zlib-intel/crc_folding.c
zlib-intel/crc32.c
zlib-intel/deflate_medium.c
zlib-intel/deflate_quick.c
zlib-intel/deflate.c
zlib-intel/inffast.c
zlib-intel/inflate.c
zlib-intel/inftrees.c
zlib-intel/match.c
zlib-intel/slide_sse.c
zlib-intel/trees.c
zlib-intel/x86.c
zlib-intel/zutil.c
)
else()
set(NATIVECOMPRESSION_SOURCES
zlib/adler32.c
zlib/compress.c
zlib/crc32.c
zlib/deflate.c
zlib/inffast.c
zlib/inflate.c
zlib/inftrees.c
zlib/trees.c
zlib/zutil.c
)
endif()
set (NATIVECOMPRESSION_SOURCES
${NATIVECOMPRESSION_SOURCES}
../../AnyOS/zlib/pal_zlib.c
../../AnyOS/brotli/common/constants.c
../../AnyOS/brotli/common/context.c
../../AnyOS/brotli/common/dictionary.c
../../AnyOS/brotli/common/platform.c
../../AnyOS/brotli/common/transform.c
../../AnyOS/brotli/dec/bit_reader.c
../../AnyOS/brotli/dec/decode.c
../../AnyOS/brotli/dec/huffman.c
../../AnyOS/brotli/dec/state.c
../../AnyOS/brotli/enc/backward_references.c
../../AnyOS/brotli/enc/backward_references_hq.c
../../AnyOS/brotli/enc/bit_cost.c
../../AnyOS/brotli/enc/block_splitter.c
../../AnyOS/brotli/enc/brotli_bit_stream.c
../../AnyOS/brotli/enc/cluster.c
../../AnyOS/brotli/enc/command.c
../../AnyOS/brotli/enc/compress_fragment.c
../../AnyOS/brotli/enc/compress_fragment_two_pass.c
../../AnyOS/brotli/enc/dictionary_hash.c
../../AnyOS/brotli/enc/encode.c
../../AnyOS/brotli/enc/encoder_dict.c
../../AnyOS/brotli/enc/entropy_encode.c
../../AnyOS/brotli/enc/fast_log.c
../../AnyOS/brotli/enc/histogram.c
../../AnyOS/brotli/enc/literal_cost.c
../../AnyOS/brotli/enc/memory.c
../../AnyOS/brotli/enc/metablock.c
../../AnyOS/brotli/enc/static_dict.c
../../AnyOS/brotli/enc/utf8_util.c
)
#Include Brotli include files
include_directories("../../AnyOS/brotli/include")
if (GEN_SHARED_LIB)
add_library(System.IO.Compression.Native
SHARED
${NATIVECOMPRESSION_SOURCES}
System.IO.Compression.Native.def
# This will add versioning to the library
${CMAKE_REPO_ROOT}/artifacts/obj/NativeVersion.rc
)
endif()
if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER)
set(NATIVECOMPRESSION_SOURCES ${NATIVECOMPRESSION_SOURCES} ../../AnyOS/System.IO.Compression.Native/entrypoints.c)
endif()
add_library(System.IO.Compression.Native-static
STATIC
${NATIVECOMPRESSION_SOURCES}
)
SET_TARGET_PROPERTIES(System.IO.Compression.Native-static PROPERTIES OUTPUT_NAME System.IO.Compression.Native)
# Allow specification of arguments that should be passed to the linker
if (GEN_SHARED_LIB)
SET_TARGET_PROPERTIES(System.IO.Compression.Native PROPERTIES LINK_OPTIONS "${__LinkArgs};${__SharedLinkArgs}")
endif()
SET_TARGET_PROPERTIES(System.IO.Compression.Native-static PROPERTIES STATIC_LIBRARY_OPTIONS "${__LinkArgs}")
# Allow specification of libraries that should be linked against
if (GEN_SHARED_LIB)
target_link_libraries(System.IO.Compression.Native ${__LinkLibraries})
endif()
target_link_libraries(System.IO.Compression.Native-static ${__LinkLibraries})
if (GEN_SHARED_LIB)
GENERATE_EXPORT_HEADER( System.IO.Compression.Native
BASE_NAME System.IO.Compression.Native
EXPORT_MACRO_NAME System.IO.Compression.Native_EXPORT
EXPORT_FILE_NAME System.IO.Compression.Native_Export.h
STATIC_DEFINE System.IO.Compression.Native_BUILT_AS_STATIC
)
install (TARGETS System.IO.Compression.Native DESTINATION .)
install (FILES $<TARGET_PDB_FILE:System.IO.Compression.Native> DESTINATION .)
endif()
install (TARGETS System.IO.Compression.Native-static DESTINATION ${STATIC_LIB_DESTINATION})