-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (71 loc) · 3.25 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
#
# MIT License
#
# Copyright (c) 2022 Jan Möller
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
cmake_minimum_required(VERSION 3.20)
project(constexpr_random)
add_library(constexpr_random
include/crand/concepts/random_number_distribution.hpp
include/crand/concepts/uniform_random_bit_generator.hpp
include/crand/distributions/bernoulli_distribution.hpp
include/crand/distributions/detail/uniform_int_distribution_details.hpp
include/crand/distributions/normal_distribution.hpp
include/crand/distributions/uniform_int_distribution.hpp
include/crand/distributions/uniform_real_distribution.hpp
include/crand/engines/detail/tiny_splitmix64.hpp
include/crand/engines/detail/xorshift_engine_details.hpp
include/crand/engines/detail/xoshiro256_starstar_details.hpp
include/crand/engines/splitmix64_engine.hpp
include/crand/engines/xorshift_engine.hpp
include/crand/engines/xoshiro256_starstar_engine.hpp
)
target_include_directories(constexpr_random PUBLIC include/)
set_target_properties(constexpr_random PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(constexpr_random PROPERTIES
CXX_STANDARD 23
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
include(FetchContent)
fetchcontent_declare(
Bugspray
GIT_REPOSITORY https://github.com/jan-moeller/bugspray.git
GIT_TAG v0.1.0
)
fetchcontent_makeavailable(Bugspray)
add_executable(constexpr_random-tests
test/distributions/test_bernoulli_distribution.cpp
test/distributions/test_normal_distribution.cpp
test/distributions/test_uniform_int_distribution.cpp
test/distributions/test_uniform_real_distribution.cpp
test/engines/helper_check_uniformness.hpp
test/engines/test_splitmix64_engine.cpp
test/engines/test_xorshift_engine.cpp
test/engines/test_xoshiro256_starstar_engine.cpp
)
target_link_libraries(constexpr_random-tests PUBLIC bugspray-with-main constexpr_random)
set_target_properties(constexpr_random-tests PROPERTIES
CXX_STANDARD 23
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
set_target_properties(constexpr_random-tests PROPERTIES COMPILE_FLAGS -fconstexpr-ops-limit=4294967296)