-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
22 lines (19 loc) · 1019 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
cmake_minimum_required(VERSION 3.8)
cmake_policy(SET CMP0042 NEW)
project (node-jsonnet)
file(GLOB SOURCE_FILES "src/*.cpp")
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB} libjsonnet)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_JS_INC})
target_compile_definitions(${PROJECT_NAME} PRIVATE "NAPI_VERSION=6" "NODE_ADDON_API_DISABLE_DEPRECATED")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(${PROJECT_NAME} PRIVATE "-Wall" "-Wextra" "-pedantic")
endif()
if(DEFINED ENV{NODE_JSONNET_ENABLE_COVERAGE})
target_link_options(${PROJECT_NAME} PRIVATE --coverage)
target_compile_options(${PROJECT_NAME} PRIVATE --coverage)
endif()
set(BUILD_TESTS OFF CACHE BOOL "Disable jsonnet tests")
add_subdirectory(third_party/jsonnet EXCLUDE_FROM_ALL)