-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
52 lines (42 loc) · 940 Bytes
/
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
cmake_minimum_required(VERSION 3.15)
project(
jacson
VERSION 0.2.1
LANGUAGES C
)
set(CMAKE_C_STANDARD 99)
add_compile_options(
-Wall
-Wextra
-Wno-unused-result
-Wno-implicit-fallthrough
)
if (OPTIMIZE)
add_compile_options(-O2)
add_link_options(-s)
else()
add_compile_options(-Og -ggdb)
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
if(CMAKE_EXPORT_COMPILE_COMMANDS)
set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES
${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
endif()
add_library(jacson
src/jacson.c
src/parser.c
src/jvalue.c
src/lexer.c
src/str.c
src/query.c
src/validator.c
)
target_include_directories(jacson PRIVATE "./include")
if (TRACE)
target_compile_definitions(jacson PUBLIC __JCSN_TRACE__)
endif()
add_executable(test
test/test.c
)
target_include_directories(test PRIVATE "./include")
target_link_libraries(test PRIVATE jacson)