-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
150 lines (130 loc) · 5.31 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
SET(CMAKE_VERBOSE_MAKEFILE ON)
#CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)
PROJECT("cppproptest" VERSION 1.0)
#SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
SET(CMAKE_CXX_FLAGS_RELEASE "")
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time")
SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wimplicit-int-conversion -Werror=unused-local-typedefs -Wsign-compare")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v -stdlib=libc++ -std=c++14")
#SET(CMAKE_CXX_FLAGS "-Werror -Weverything -Wno-thread-safety-analysis -Wunreachable-code-loop-increment -Wno-error=deprecated -Wno-c++98-compat -Wno-shadow-uncaptured-local -Wno-shadow -Wno-c++98-compat-pedantic")
#SET(CMAKE_CXX_FLAGS "-Werror -Weverything -Wno-thread-safety-analysis -Wunreachable-code-loop-increment -Wno-error=deprecated -Wno-c++98-compat -Wno-shadow-uncaptured-local -Wno-shadow -Wno-c++98-compat-pedantic -Wno-inconsistent-missing-destructor-override -Wno-exit-time-destructors -Wno-sign-conversion -Wno-double-promotion -Wno-implicit-int-conversion -Wno-weak-vtables -Wno-shorten-64-to-32 -Wno-extra-semi -Wno-deprecated -Wno-undef -Wno-undefined-reinterpret-cast -Wno-redundant-parens -Wno-missing-noreturn -Wno-zero-as-null-pointer-constant -Wno-shift-sign-overflow -Wno-newline-eof -Wno-missing-prototypes -Wno-padded -Wno-global-constructors -Wno-unused-parameter -Wno-c++17-extensions -Wno-sign-compare -Wno-covered-switch-default -Wno-format-nonliteral -Wno-used-but-marked-unused -Wno-unused-template -Wno-switch-enum -Wno-unused-member-function -Wno-old-style-cast -Wno-unused-variable -Wno-unreachable-code -Wno-implicit-float-conversion -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-exception-parameter -Wno-unused-local-typedef")
#SET(CMAKE_CXX_LDFLAGS "${CMAKE_CXX_LDFLAGS} -lc++")
#SET(CMAKE_CXX_FLAGS "-Werror -Wignored-qualifiers -Wimplicit-fallthrough -Wunused-variable -Wcast-qual -Wunused-local-typedefs -Wunused-function -Wmissing-field-initializers -Wunused-parameter -Warray-bounds -Wextra-semi -Wshadow")
add_subdirectory("proptest")
add_subdirectory("googletest")
include_directories(. googletest/googletest/include googletest/googlemock/include/)
### library
SET(proptest_sources
proptest/generator/bool.cpp
proptest/generator/integral.cpp
proptest/generator/floating.cpp
proptest/generator/string.cpp
proptest/generator/utf8string.cpp
proptest/generator/utf16string.cpp
proptest/generator/cesu8string.cpp
proptest/generator/util.cpp
proptest/generator/unicode.cpp
proptest/shrinker/bool.cpp
proptest/shrinker/floating.cpp
proptest/shrinker/string.cpp
proptest/shrinker/listlike.cpp
proptest/combinator/intervals.cpp
proptest/util/fork.cpp
proptest/util/utf8string.cpp
proptest/util/utf16string.cpp
proptest/util/cesu8string.cpp
proptest/util/unicode.cpp
proptest/util/printing.cpp
proptest/util/bitmap.cpp
proptest/Stream.cpp
proptest/Shrinkable.cpp
proptest/Property.cpp
proptest/PropertyContext.cpp
proptest/Random.cpp
proptest/assert.cpp
)
ADD_LIBRARY(proptest
SHARED
${proptest_sources}
#NO_PACKAGE
)
set_target_properties(proptest PROPERTIES
COMPILE_FLAGS "-DPROPTEST_DLL -DPROTEST_DLL_EXPORTS")
TARGET_LINK_LIBRARIES(proptest
PRIVATE
)
#TARGET_PRECOMPILE_HEADERS(proptest
# PUBLIC
# proptest.hpp
# PRIVATE
#)
### tests
SET(proptest_testsources
proptest/test/testbase.cpp
proptest/test/test_gen.cpp
proptest/test/test_property.cpp
proptest/test/test_primitive.cpp
proptest/test/test_combinator.cpp
proptest/test/test_combinator2.cpp
proptest/test/test_shrinkable.cpp
proptest/test/test_mock.cpp
proptest/test/test_util.cpp
proptest/test/test_state_class.cpp
proptest/test/test_state_func.cpp
proptest/test/test_concurrency_class.cpp
proptest/test/test_concurrency_class2.cpp
proptest/test/test_concurrency_func.cpp
proptest/test/test_stream.cpp
proptest/test/test_fork.cpp
)
ADD_EXECUTABLE(test_proptest
${proptest_testsources}
)
TARGET_LINK_LIBRARIES(test_proptest
PRIVATE
proptest
gtest_main
gmock_main
)
ADD_TEST(NAME proptest_gtest COMMAND test_proptest)
### compile
SET(compile_sources
proptest/test/compile/unicode.cpp
proptest/test/compile/property.cpp
proptest/test/compile/printing.cpp
proptest/test/compile/just.cpp
proptest/test/compile/lazy.cpp
proptest/test/compile/filter.cpp
proptest/test/compile/derive.cpp
proptest/test/compile/aggregate.cpp
proptest/test/compile/accumulate.cpp
proptest/test/compile/oneof.cpp
proptest/test/compile/elementof.cpp
proptest/test/compile/integral.cpp
proptest/test/compile/floating.cpp
proptest/test/compile/vector.cpp
proptest/test/compile/map.cpp
proptest/test/compile/flatmap.cpp
proptest/test/compile/string.cpp
proptest/test/compile/pair.cpp
proptest/test/compile/tuple.cpp
proptest/test/compile/shrinkable.cpp
proptest/test/compile/stream.cpp
proptest/test/compile/example.cpp
proptest/test/compile/arbitrary.cpp
proptest/test/compile/container.cpp
)
ADD_EXECUTABLE(compile_proptest
EXCLUDE_FROM_ALL
${compile_sources}
)
TARGET_LINK_LIBRARIES(compile_proptest
PRIVATE
proptest
gtest_main
)
ADD_TEST(compile_proptest_gtest
EXCLUDE_FROM_ALL
compile_proptest)