-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
31 lines (22 loc) · 1008 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
PROJECT(JSNC LANGUAGES C VERSION 0.0.0)
SET(JSNC_LIBRARY_NAME jsnc)
SET(JSNC_EXECUTABLE_NAME jsnc-bin)
INCLUDE_DIRECTORIES(include/)
SET(PROJECT_SOURCE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src)
ENABLE_TESTING()
ADD_SUBDIRECTORY(test)
ADD_LIBRARY(${JSNC_LIBRARY_NAME}
${PROJECT_SOURCE_SOURCE_DIR}/compiler/source_memory.c
${PROJECT_SOURCE_SOURCE_DIR}/compiler/source.c
)
ADD_EXECUTABLE(${JSNC_EXECUTABLE_NAME}
${PROJECT_SOURCE_SOURCE_DIR}/jsnc.c
)
SET_TARGET_PROPERTIES(
${JSNC_LIBRARY_NAME} PROPERTIES C_STANDARD 11 SOVERSION ${PROJECT_VERSION_MAJOR})
SET_TARGET_PROPERTIES(${JSNC_EXECUTABLE_NAME} PROPERTIES C_STANDARD 11)
TARGET_LINK_LIBRARIES(${JSNC_EXECUTABLE_NAME} ${JSNC_LIBRARY_NAME})
SET(JSNC_COMPILE_OPTIONS -Wall -Wextra -Wpedantic -Werror -Wno-sometimes-uninitialized -Wno-sign-compare)
TARGET_COMPILE_OPTIONS(${JSNC_LIBRARY_NAME} PRIVATE ${JSNC_COMPILE_OPTIONS})
TARGET_COMPILE_OPTIONS(${JSNC_EXECUTABLE_NAME} PRIVATE ${JSNC_COMPILE_OPTIONS})