summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..fd1839b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,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)