summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: fd1839b3c86017774bd3efc4fcc9e2c382ed70e9 (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
cmake_minimum_required(VERSION 3.25)

project(aplwc
	VERSION 0.0.1
	LANGUAGES C
)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(common INTERFACE)
target_include_directories(common INTERFACE
	"src"
)
target_compile_options(common INTERFACE
	$<$<CONFIG:Debug>:
		-Wall
		-Wextra
		-Wpedantic
		-Werror
		-fsanitize=address,undefined
	>
)
target_link_options(common INTERFACE
	$<$<CONFIG:Debug>:
		-fsanitize=address,undefined
	>
)

add_library(aplwc
	src/errors.c
	src/libmain.c
	src/malloc.c
)
target_link_libraries(aplwc PRIVATE common)

add_executable(aplwc-repl
	src/main.c
)
target_link_libraries(aplwc-repl PRIVATE common aplwc)