forked from emil-e/rapidcheck
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
78 lines (69 loc) · 2.11 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
cmake_minimum_required(VERSION 2.8.12)
project(rapidcheck)
enable_testing()
option(RC_ENABLE_TESTS "Build RapidCheck tests" OFF)
option(RC_ENABLE_EXAMPLES "Build RapidCheck examples" OFF)
if(MSVC)
# /bigobj - some object files become very large so we need this
# /wd4503 - truncation of decorated name, not much we can do about it so
# disable it
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /wd4503 /WX")
# /RTC* is incompatible with /O2 needed for Random.cpp to speed it up
string(REGEX REPLACE "/RTC(su|[1su])" ""
CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wno-missing-braces -std=c++11")
endif()
add_library(rapidcheck
src/BeforeMinimalTestCase.cpp
src/Check.cpp
src/Classify.cpp
src/GenerationFailure.cpp
src/Log.cpp
src/Random.cpp
src/Show.cpp
src/detail/Any.cpp
src/detail/Assertions.cpp
src/detail/Base64.cpp
src/detail/Configuration.cpp
src/detail/DefaultTestListener.cpp
src/detail/FrequencyMap.cpp
src/detail/ImplicitParam.cpp
src/detail/LogTestListener.cpp
src/detail/MapParser.cpp
src/detail/MulticastTestListener.cpp
src/detail/ParseException.cpp
src/detail/Platform.cpp
src/detail/Property.cpp
src/detail/PropertyContext.cpp
src/detail/ReproduceListener.cpp
src/detail/Results.cpp
src/detail/Serialization.cpp
src/detail/StringSerialization.cpp
src/detail/TestMetadata.cpp
src/detail/TestParams.cpp
src/detail/Testing.cpp
src/gen/Numeric.cpp
src/gen/Text.cpp
src/gen/detail/ExecHandler.cpp
src/gen/detail/GenerationHandler.cpp
src/gen/detail/Recipe.cpp
src/gen/detail/ScaleInteger.cpp
)
# Random is used a LOT so it should preferrably be really fast.
if(MSVC)
set_property(SOURCE src/Random.cpp
APPEND_STRING PROPERTY COMPILE_FLAGS " /O2")
else()
set_property(SOURCE src/Random.cpp
APPEND_STRING PROPERTY COMPILE_FLAGS " -O3")
endif()
target_include_directories(rapidcheck PUBLIC include)
add_subdirectory(ext)
if (RC_ENABLE_TESTS)
add_subdirectory(test)
endif()
if (RC_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()
add_subdirectory(extras)