summaryrefslogtreecommitdiff
path: root/agbsum/CMakeLists.txt
blob: bdfdda9d0be413bbb35f146b5b9e95966800ad53 (plain) (blame)
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
cmake_minimum_required(
	VERSION
	3.21
)

set(
	CMAKE_C_STANDARD
	23
)

set(
	CMAKE_C_STANDARD_REQUIRED
)

add_executable(
	agbsum
	"src/calc.c"
	"src/chkparams.c"
	"src/exit.c"
	"src/help.c"
	"src/initdat.c"
	"src/main.c"
	"src/open.c"
	"src/pat.c"
	"src/rd.c"
)

target_include_directories(
	agbsum
	PRIVATE
	"include"
)

target_link_libraries(
	agbsum
	PRIVATE
	zap
)

if(
	"${CMAKE_C_COMPILER_ID}"
	MATCHES
	"Clang|GNU"
)
	target_compile_options(
		agbsum
		PRIVATE
		-Ofast
		-Wall
		-Wextra
		-fPIC
		-fdiagnostics-color=always
		-gdwarf-2 # Clang 16 uses a different format.
		-march=native
		-pedantic-errors
	)
endif()