This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
/
CMakeLists.txt
159 lines (146 loc) · 4.48 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
151
152
153
154
155
156
157
158
cmake_minimum_required (VERSION 3.16.3)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()
project(optimization C CXX ASM)
include(CheckCXXCompilerFlag)
find_package(benchmark QUIET)
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
enable_language(ASM_MASM)
endif()
OPTION(ENABLE_WERROR "Build with -Werror" OFF)
set (CMAKE_CXX_STANDARD 11)
include(FetchContent)
FetchContent_Declare(
googletest
# GoogleTest 1.11.0
URL https://github.com/google/googletest/archive/refs/tags/release-1.11.0.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()
include_directories("common")
if(CMAKE_CXX_COMPILER_ID MATCHES Clang OR CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES AppleClang)
add_compile_options(-Wall -Winline -pedantic -march=haswell)
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-x$<SEMICOLON>assembler-with-cpp>)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES Clang OR CMAKE_CXX_COMPILER_ID MATCHES AppleClang)
add_compile_options(-Wno-unused-command-line-argument)
endif()
if (ENABLE_WERROR)
add_compile_options(-Werror)
endif()
enable_testing()
add_subdirectory(common)
add_subdirectory(chap5/ex15)
add_subdirectory(chap7/ex3)
add_subdirectory(chap7/ex4)
add_subdirectory(chap7/ex5)
add_subdirectory(chap7/ex6)
add_subdirectory(chap8/ex1)
add_subdirectory(chap8/ex2)
add_subdirectory(chap8/ex3)
add_subdirectory(chap8/ex4)
add_subdirectory(chap8/ex5)
add_subdirectory(chap8/ex6)
add_subdirectory(chap8/ex7)
add_subdirectory(chap8/ex9)
add_subdirectory(chap8/ex10)
add_subdirectory(chap8/ex11)
add_subdirectory(chap8/ex12)
add_subdirectory(chap15/ex1)
add_subdirectory(chap15/ex2)
add_subdirectory(chap15/ex3)
add_subdirectory(chap15/ex6)
add_subdirectory(chap15/ex7)
add_subdirectory(chap15/ex8)
add_subdirectory(chap15/ex9)
add_subdirectory(chap15/ex10)
add_subdirectory(chap15/ex12)
add_subdirectory(chap15/ex14)
add_subdirectory(chap15/ex16)
add_subdirectory(chap15/ex17)
add_subdirectory(chap15/ex18)
add_subdirectory(chap15/ex19)
add_subdirectory(chap15/ex20)
add_subdirectory(chap15/ex21)
add_subdirectory(chap15/ex22)
add_subdirectory(chap15/ex23)
add_subdirectory(chap15/ex24)
add_subdirectory(chap15/ex25)
add_subdirectory(chap15/ex26)
add_subdirectory(chap15/ex27)
add_subdirectory(chap15/ex28)
add_subdirectory(chap15/ex29)
add_subdirectory(chap15/ex30)
add_subdirectory(chap15/ex31)
add_subdirectory(chap15/ex34)
add_subdirectory(chap15/ex35)
add_subdirectory(chap15/ex36)
add_subdirectory(chap15/ex39)
add_subdirectory(chap15/ex41)
add_subdirectory(chap15/ex45)
add_subdirectory(chap15/ex46)
add_subdirectory(chap15/ex47)
add_subdirectory(chap15/ex48)
add_subdirectory(chap18/ex1)
add_subdirectory(chap18/ex2)
add_subdirectory(chap18/ex3)
add_subdirectory(chap18/ex4)
add_subdirectory(chap18/ex5)
add_subdirectory(chap18/ex6)
add_subdirectory(chap18/ex7)
add_subdirectory(chap18/ex8)
add_subdirectory(chap18/ex9)
add_subdirectory(chap18/ex10)
add_subdirectory(chap18/ex11)
add_subdirectory(chap18/ex12)
add_subdirectory(chap18/ex13)
add_subdirectory(chap18/ex14)
add_subdirectory(chap18/ex15)
add_subdirectory(chap18/ex16)
add_subdirectory(chap18/ex17)
add_subdirectory(chap18/ex18)
add_subdirectory(chap18/ex19)
add_subdirectory(chap18/ex20)
add_subdirectory(chap18/ex21)
add_subdirectory(chap18/ex22)
add_subdirectory(chap18/ex23)
add_subdirectory(chap18/ex24)
add_subdirectory(chap18/ex25)
add_subdirectory(chap18/ex26)
add_subdirectory(chap18/ex27)
add_subdirectory(chap18/ex28)
add_subdirectory(chap18/ex29)
add_subdirectory(chap18/ex30)
add_subdirectory(chap18/ex31)
add_subdirectory(chap18/ex32)
add_subdirectory(chap18/ex33)
add_subdirectory(chap18/ex34)
add_subdirectory(chap18/ex35)
add_subdirectory(chap19/ex1)
add_subdirectory(chap19/ex2)
add_subdirectory(chap19/ex3)
add_subdirectory(chap19/ex4)
add_subdirectory(chap19/ex5)
add_subdirectory(chap20/ex4)
add_subdirectory(chap20/ex5)
add_subdirectory(chap20/ex6)
add_subdirectory(chap20/ex7)
add_subdirectory(chap20/ex8)
add_subdirectory(chap20/ex10)
add_subdirectory(chap20/ex14)
add_subdirectory(chap20/ex16)
add_subdirectory(chap20/ex17)
add_subdirectory(chap20/ex18)
add_subdirectory(chap20/ex19)
add_subdirectory(chap20/ex20)
add_subdirectory(chap20/ex21)
add_subdirectory(chap20/ex22)
add_subdirectory(chap20/ex23)
add_subdirectory(chap20/ex24)
add_subdirectory(chap20/ex25)
add_subdirectory(chap20/ex27)