-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
118 lines (90 loc) · 2.84 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
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
cmake_minimum_required( VERSION 3.10 )
project( coding )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib" )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin" )
# exporting of llvm compiler_commands.json enabled
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
# setup compiler
add_compile_options( -g )
set( hwsvc_CXX_WARNING_FLAGS -Wall -Wextra -Wconversion -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wcast-qual -Wunused -Woverloaded-virtual -Wno-noexcept-type -Wpedantic )
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
set( hwsvc_CXX_WARNING_FLAGS ${hwsvc_CXX_WARNING_FLAGS} -Weverything -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-documentation -Wno-reserved-id-macro -Wno-switch-enum -Wno-weak-vtables -Wno-missing-prototypes -Wno-padded -Wno-missing-noreturn -Wno-exit-time-destructors -Wno-documentation-unknown-command -Wno-unused-template -Wno-undef -Wno-format-nonliteral -Wno-global-constructors)
else( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
set( hwsvc_CXX_WARNING_FLAGS ${hwsvc_CXX_WARNING_FLAGS} -Wnoexcept )
endif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
set( hwsvc_CXX_WARNING_FLAGS ${hwsvc_CXX_WARNING_FLAGS} -std=c++17 )
add_library( coding
STATIC
src/bit_buffer.cpp
src/compr_stats.cpp
src/data_block.cpp
src/fib_coding.cpp
src/freq_table.cpp
src/num_freq_table.cpp
src/num_freq_table_adapt.cpp
src/num_freq_table_alias.cpp
src/rans.cpp
src/common.h
src/bit_buffer.h
src/compr_stats.h
src/data_block.h
src/fib_coding.h
src/freq_table.h
src/num_freq_table.h
src/num_freq_table_adapt.h
src/num_freq_table_alias.h
src/rans.h )
target_include_directories( coding
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/src" )
target_compile_options( coding
PUBLIC
${hwsvc_CXX_WARNING_FLAGS} )
#target_link_libraries( ${HWSVC_MODULE_TARGET_NAME}
# PUBLIC
# ${HWSVC_MODULE_DEPENDENCIES} )
add_executable( base
tests/base_test.cpp )
target_compile_options( base
PUBLIC
${hwsvc_CXX_WARNING_FLAGS} )
target_link_libraries( base
PUBLIC
coding )
# ---
add_executable( rans
tests/rans_basic_test.cpp )
target_compile_options( rans
PUBLIC
${hwsvc_CXX_WARNING_FLAGS} )
target_link_libraries( rans
PUBLIC
coding )
# ---
add_executable( alias
tests/alias_test.cpp )
target_compile_options( alias
PUBLIC
${hwsvc_CXX_WARNING_FLAGS} )
target_link_libraries( alias
PUBLIC
coding )
# ---
add_executable( fib
tests/fib_test.cpp )
target_compile_options( fib
PUBLIC
${hwsvc_CXX_WARNING_FLAGS} )
target_link_libraries( fib
PUBLIC
coding )
# ---
add_executable( adapt
tests/adapt_test.cpp )
target_compile_options( adapt
PUBLIC
${hwsvc_CXX_WARNING_FLAGS} )
target_link_libraries( adapt
PUBLIC
coding )