forked from cassioneri/sort3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (41 loc) · 1.36 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
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2023 Cassio Neri <[email protected]>
#
# This code is a supplementary material to:
#
# Neri, C. "Shorter and faster than Sort3AlphaDev", to appear.
# Preprint: https://arxiv.org/abs/2307.14503.
cmake_minimum_required(VERSION 3.1)
project(sort3
VERSION 1.0
DESCRIPTION "Shorter and faster than Sort3AlphaDev"
LANGUAGES CXX
)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
set(CMAKE_CXX_STANDARD 17)
add_compile_options(-fno-pie)
add_link_options(-no-pie)
#---------------------------------------------------------------------------
# Google benchmark
#---------------------------------------------------------------------------
include(FetchContent)
FetchContent_Declare(
benchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.8.2
SOURCE_DIR ${CMAKE_BINARY_DIR}/tp/benchmark
)
set(BENCHMARK_ENABLE_TESTING off)
FetchContent_MakeAvailable(benchmark)
target_compile_definitions(benchmark PUBLIC -DBENCHMARK_STATIC_DEFINE)
#---------------------------------------------------------------------------
# Sort3
#---------------------------------------------------------------------------
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
add_executable(test
test.cpp
)
add_executable(bench
benchmark.cpp
)
target_link_libraries(bench benchmark benchmark_main)