aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 52b78a2c72c920c29475263d397f34c21a25aa79 (plain)
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
cmake_minimum_required(VERSION 3.21)
add_subdirectory(discount/cmake)

project(msg C)

set(SRC
  src/config.c
  src/copy.c
  src/engine/contentfor.c
  src/engine/eachdo.c
  src/engine/engine.c
  src/engine/include.c
  src/filehandler.c
  src/lexer.c
  src/list.c
  src/main.c
  src/msg.c
  src/template.c
  src/util.c
)

set(C_COMPILE_OPTIONS
  # -O3
  # -O0

  -Wall
  -Wextra
  # -Werror

  -g3
  -glldb

  -std=c99

  -Wno-unused-result
  -Wno-unused-variable
)

add_executable(msg ${SRC})
target_include_directories(msg PRIVATE include)

target_include_directories(msg PRIVATE discount)
target_link_libraries(msg libmarkdown)

# The compiler isn't very happy with discount
target_compile_options(libmarkdown PRIVATE -w)
target_compile_options(mkd2html PRIVATE -w)
target_compile_options(makepage PRIVATE -w)
target_compile_options(markdown PRIVATE -w)
target_compile_options(common PRIVATE -w)

target_compile_options(msg PRIVATE
  $<$<COMPILE_LANGUAGE:C>: ${C_COMPILE_OPTIONS}>
)

install(TARGETS msg)