-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
34 lines (27 loc) · 937 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
# Copyright (c) 2021 Borislav Stanimirov
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
cmake_minimum_required(VERSION 3.10)
project(mscharconv)
add_library(mscharconv INTERFACE)
add_library(msstl::charconv ALIAS mscharconv)
target_include_directories(mscharconv INTERFACE include)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(dev_mode ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wconversion -Wsign-conversion")
endif()
else()
set(dev_mode OFF)
endif()
option(MSCHARCONV_BUILD_TESTS "mscharconv: build tests" ${dev_mode})
option(MSCHARCONV_BUILD_EXAMPLES "mscharconv: build examples" ${dev_mode})
if(MSCHARCONV_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
if(MSCHARCONV_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()