feat: update build system to v4

This commit is contained in:
ToruNiina
2024-06-15 19:14:44 +09:00
parent c47ff10a64
commit 3f9e3ce5d2
4 changed files with 381 additions and 80 deletions

View File

@@ -1,87 +1,55 @@
cmake_minimum_required(VERSION 3.5)
enable_testing()
cmake_minimum_required(VERSION 3.22)
project(toml11 LANGUAGES CXX VERSION 4.0.0)
project(toml11 VERSION 3.8.1)
include(CMakeDependentOption)
include(CTest)
option(toml11_BUILD_TEST "Build toml tests" OFF)
option(toml11_INSTALL "Install CMake targets during install step." ON)
option(toml11_TEST_WITH_ASAN "use LLVM address sanitizer" OFF)
option(toml11_TEST_WITH_UBSAN "use LLVM undefined behavior sanitizer" OFF)
option(TOML11_PRECOMPILE "precompile toml11 library" OFF)
option(TOML11_USE_UNRELEASED_TOML_FEATURES
"use features in toml-lang/toml master while testing" OFF)
cmake_dependent_option(TOML11_INSTALL "install toml11 library" ON
"${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}" OFF)
cmake_dependent_option(TOML11_BUILD_EXAMPLES "build toml11 examples" OFF
"${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}" OFF)
cmake_dependent_option(TOML11_BUILD_TESTS "build toml11 unit tests" OFF
"${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}; ${BUILD_TESTING}" OFF)
cmake_dependent_option(TOML11_BUILD_TOML_TESTS "build toml11 toml-test encoder & decoder" OFF
"${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}" OFF)
cmake_dependent_option(TOML11_TEST_WITH_ASAN "build toml11 unit tests with asan" OFF
"${TOML11_BUILD_TESTS}" OFF)
cmake_dependent_option(TOML11_TEST_WITH_UBSAN "build toml11 unit tests with ubsan" OFF
"${TOML11_BUILD_TESTS}" OFF)
if(MSVC)
# add_definitions("/Zc:__cplusplus") # define __cplusplus value correctly
add_definitions("/utf-8") # enable to use u8"" literal
if(MSVC_VERSION LESS 1910)
message(STATUS "MSVC < 1910. DEFINE_CONVERSION_NON_INTRUSIVE is disabled")
add_definitions(-DTOML11_WITHOUT_DEFINE_NON_INTRUSIVE)
elseif(MSVC_VERSION LESS 1920)
add_definitions("/experimental:preprocessor") # MSVC 2017
else()
add_definitions("/Zc:preprocessor") # MSVC 2019
if(${TOML11_TEST_WITH_ASAN} AND ${TOML11_TEST_WITH_UBSAN})
message(FATAL_ERROR "trying to build tests with BOTH asan and ubsan")
endif()
include(GNUInstallDirs)
set(TOML11_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/toml11)
set(TOML11_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR})
set(TOML11_CONFIG_DIR ${CMAKE_CURRENT_BINARY_DIR}/cmake)
set(TOML11_CONFIG ${TOML11_CONFIG_DIR}/toml11Config.cmake)
set(TOML11_CONFIG_VERSION ${TOML11_CONFIG_DIR}/toml11ConfigVersion.cmake)
# root project?
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
if(NOT DEFINED CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
if(NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(${TOML11_BUILD_TESTS})
add_subdirectory(tests)
endif()
if(${TOML11_BUILD_EXAMPLES})
add_subdirectory(examples)
endif()
endif()
# Set some common directories
include(GNUInstallDirs)
set(toml11_install_cmake_dir ${CMAKE_INSTALL_LIBDIR}/cmake/toml11)
set(toml11_install_include_dir ${CMAKE_INSTALL_INCLUDEDIR})
set(toml11_config_dir ${CMAKE_CURRENT_BINARY_DIR}/cmake/)
set(toml11_config ${toml11_config_dir}/toml11Config.cmake)
set(toml11_config_version ${toml11_config_dir}/toml11ConfigVersion.cmake)
add_library(toml11 INTERFACE)
target_include_directories(toml11 INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${toml11_install_include_dir}>
)
add_library(toml11::toml11 ALIAS toml11)
# Write config and version config files
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${toml11_config_version}
VERSION ${toml11_VERSION}
COMPATIBILITY SameMajorVersion
)
if (toml11_INSTALL)
configure_package_config_file(
cmake/toml11Config.cmake.in
${toml11_config}
INSTALL_DESTINATION ${toml11_install_cmake_dir}
PATH_VARS toml11_install_cmake_dir
)
# Install config files
install(FILES ${toml11_config} ${toml11_config_version}
DESTINATION ${toml11_install_cmake_dir}
)
# Install header files
install(
FILES toml.hpp
DESTINATION "${toml11_install_include_dir}"
)
install(
DIRECTORY "toml"
DESTINATION "${toml11_install_include_dir}"
FILES_MATCHING PATTERN "*.hpp"
)
# Export targets and install them
install(TARGETS toml11
EXPORT toml11Targets
)
install(EXPORT toml11Targets
FILE toml11Targets.cmake
DESTINATION ${toml11_install_cmake_dir}
NAMESPACE toml11::
)
endif()
if (toml11_BUILD_TEST)
add_subdirectory(tests)
endif ()
add_subdirectory(src)

View File

@@ -1,2 +1,3 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/toml11Targets.cmake")
set_and_check(TOML11_INCLUDE_DIR "@PACKAGE_TOML11_INSTALL_INCLUDE_DIR@/")

146
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,146 @@
set(TOML11_FWD_HEADERS
${PROJECT_SOURCE_DIR}/include/toml11/fwd/color_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/comments_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/datetime_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/error_info_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/format_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/literal_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/location_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/region_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/scanner_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/source_location_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/syntax_fwd.hpp
${PROJECT_SOURCE_DIR}/include/toml11/fwd/value_t_fwd.hpp
)
set(TOML11_IMPL_HEADERS
${PROJECT_SOURCE_DIR}/include/toml11/impl/color_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/comments_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/datetime_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/error_info_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/format_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/literal_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/location_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/region_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/scanner_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/source_location_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/syntax_impl.hpp
${PROJECT_SOURCE_DIR}/include/toml11/impl/value_t_impl.hpp
)
set(TOML11_MAIN_HEADERS
${PROJECT_SOURCE_DIR}/include/toml11/color.hpp
${PROJECT_SOURCE_DIR}/include/toml11/comments.hpp
${PROJECT_SOURCE_DIR}/include/toml11/compat.hpp
${PROJECT_SOURCE_DIR}/include/toml11/context.hpp
${PROJECT_SOURCE_DIR}/include/toml11/conversion.hpp
${PROJECT_SOURCE_DIR}/include/toml11/datetime.hpp
${PROJECT_SOURCE_DIR}/include/toml11/error_info.hpp
${PROJECT_SOURCE_DIR}/include/toml11/exception.hpp
${PROJECT_SOURCE_DIR}/include/toml11/find.hpp
${PROJECT_SOURCE_DIR}/include/toml11/format.hpp
${PROJECT_SOURCE_DIR}/include/toml11/from.hpp
${PROJECT_SOURCE_DIR}/include/toml11/get.hpp
${PROJECT_SOURCE_DIR}/include/toml11/into.hpp
${PROJECT_SOURCE_DIR}/include/toml11/literal.hpp
${PROJECT_SOURCE_DIR}/include/toml11/location.hpp
${PROJECT_SOURCE_DIR}/include/toml11/ordered_map.hpp
${PROJECT_SOURCE_DIR}/include/toml11/parser.hpp
${PROJECT_SOURCE_DIR}/include/toml11/region.hpp
${PROJECT_SOURCE_DIR}/include/toml11/result.hpp
${PROJECT_SOURCE_DIR}/include/toml11/scanner.hpp
${PROJECT_SOURCE_DIR}/include/toml11/serializer.hpp
${PROJECT_SOURCE_DIR}/include/toml11/skip.hpp
${PROJECT_SOURCE_DIR}/include/toml11/source_location.hpp
${PROJECT_SOURCE_DIR}/include/toml11/spec.hpp
${PROJECT_SOURCE_DIR}/include/toml11/storage.hpp
${PROJECT_SOURCE_DIR}/include/toml11/syntax.hpp
${PROJECT_SOURCE_DIR}/include/toml11/traits.hpp
${PROJECT_SOURCE_DIR}/include/toml11/types.hpp
${PROJECT_SOURCE_DIR}/include/toml11/utility.hpp
${PROJECT_SOURCE_DIR}/include/toml11/value.hpp
${PROJECT_SOURCE_DIR}/include/toml11/value_t.hpp
${PROJECT_SOURCE_DIR}/include/toml11/version.hpp
${PROJECT_SOURCE_DIR}/include/toml11/visit.hpp
)
set(TOML11_ROOT_HEADER
${PROJECT_SOURCE_DIR}/include/toml.hpp
)
if(TOML11_PRECOMPILE)
add_library(toml11
${TOML11_FWD_HEADERS}
${TOML11_IMPL_HEADERS}
${TOML11_MAIN_HEADERS}
${TOML11_ROOT_HEADER}
color.cpp
context.cpp
comments.cpp
datetime.cpp
error_info.cpp
format.cpp
literal.cpp
location.cpp
parser.cpp
region.cpp
scanner.cpp
serializer.cpp
skip.cpp
source_location.cpp
syntax.cpp
types.cpp
value_t.cpp
)
target_compile_definitions(toml11 PUBLIC -DTOML11_COMPILE_SOURCES)
target_include_directories(toml11 PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
else()
add_library(toml11 INTERFACE)
target_include_directories(toml11 INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
endif()
if(TOML11_INSTALL)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(${TOML11_CONFIG_VERSION}
VERSION ${toml11_VERSION}
COMPATIBILITY SameMajorVersion
)
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/toml11Config.cmake.in
${TOML11_CONFIG}
INSTALL_DESTINATION ${TOML11_INSTALL_CMAKE_DIR}
PATH_VARS TOML11_INSTALL_CMAKE_DIR TOML11_INSTALL_INCLUDE_DIR
)
install(FILES ${TOML11_CONFIG} ${TOML11_CONFIG_VERSION}
DESTINATION ${TOML11_INSTALL_CMAKE_DIR})
install(FILES ${TOML11_ROOT_HEADER}
DESTINATION ${TOML11_INSTALL_INCLUDE_DIR}
)
install(FILES ${TOML11_MAIN_HEADERS}
DESTINATION ${TOML11_INSTALL_INCLUDE_DIR}/toml11
)
install(FILES ${TOML11_FWD_HEADERS}
DESTINATION ${TOML11_INSTALL_INCLUDE_DIR}/toml11/fwd
)
install(FILES ${TOML11_IMPL_HEADERS}
DESTINATION ${TOML11_INSTALL_INCLUDE_DIR}/toml11/impl
)
install(TARGETS toml11 EXPORT toml11Targets)
install(EXPORT toml11Targets
FILE toml11Targets.cmake
DESTINATION ${TOML11_INSTALL_CMAKE_DIR}
NAMESPACE toml11::
)
endif()
add_library(toml11::toml11 ALIAS toml11)

186
tests/CMakeLists.txt Normal file
View File

@@ -0,0 +1,186 @@
set(TOML11_TEST_NAMES
test_comments
test_datetime
test_find
test_find_or
test_format_integer
test_format_floating
test_format_table
test_get
test_get_or
test_location
test_literal
test_parse_null
test_parse_boolean
test_parse_integer
test_parse_floating
test_parse_string
test_parse_datetime
test_parse_array
test_parse_inline_table
test_parse_table_keys
test_parse_table
test_result
test_scanner
test_syntax_boolean
test_syntax_integer
test_syntax_floating
test_syntax_string
test_syntax_datetime
test_syntax_key
test_syntax_comment
test_spec
test_storage
test_traits
test_types
test_utility
test_user_defined_conversion
test_value
test_visit
)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Wall" COMPILER_SUPPORTS_WALL)
check_cxx_compiler_flag("-Wextra" COMPILER_SUPPORTS_WEXTRA)
check_cxx_compiler_flag("-Wpedantic" COMPILER_SUPPORTS_WPEDANTIC)
check_cxx_compiler_flag("-Werror" COMPILER_SUPPORTS_WERROR)
check_cxx_compiler_flag("-Wsign-conversion" COMPILER_SUPPORTS_WSIGN_CONVERSION)
check_cxx_compiler_flag("-Wconversion" COMPILER_SUPPORTS_WCONVERSION)
check_cxx_compiler_flag("-Wduplicated-cond" COMPILER_SUPPORTS_WDUPLICATED_COND)
check_cxx_compiler_flag("-Wduplicated-branches" COMPILER_SUPPORTS_WDUPLICATED_BRANCHES)
check_cxx_compiler_flag("-Wlogical-op" COMPILER_SUPPORTS_WLOGICAL_OP)
check_cxx_compiler_flag("-Wdouble-promotion" COMPILER_SUPPORTS_WDOUBLE_PROMOTION)
check_cxx_compiler_flag("-Wrange-loop-analysis" COMPILER_SUPPORTS_WRANGE_LOOP_ANALYSIS)
check_cxx_compiler_flag("-Wundef" COMPILER_SUPPORTS_WUNDEF)
check_cxx_compiler_flag("-Wshadow" COMPILER_SUPPORTS_WSHADOW)
if(BUILD_TESTING)
add_library(toml11_test_utility STATIC utility.cpp)
target_include_directories(toml11_test_utility
PRIVATE ${PROJECT_SOURCE_DIR}/tests/extlib/doctest/doctest/
)
target_link_libraries(toml11_test_utility PUBLIC toml11)
foreach(TEST_NAME ${TOML11_TEST_NAMES})
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)
target_include_directories(${TEST_NAME}
PRIVATE ${PROJECT_SOURCE_DIR}/tests/extlib/doctest/doctest/
)
target_link_libraries(${TEST_NAME} PUBLIC toml11 toml11_test_utility)
target_compile_options(${TEST_NAME} PRIVATE
-Wfatal-errors
$<$<BOOL:${COMPILER_SUPPORTS_WALL}>: -Wall >
$<$<BOOL:${COMPILER_SUPPORTS_WEXTRA}>: -Wextra >
$<$<BOOL:${COMPILER_SUPPORTS_WPEDANTIC}>: -Wpedantic >
$<$<BOOL:${COMPILER_SUPPORTS_WSIGN_CONVERSION}>: -Wsign-conversion >
$<$<BOOL:${COMPILER_SUPPORTS_WCONVERSION}>: -Wconversion >
$<$<BOOL:${COMPILER_SUPPORTS_WDUPLICATED_COND}>: -Wduplicated-cond >
$<$<BOOL:${COMPILER_SUPPORTS_WDUPLICATED_BRANCHES}>: -Wduplicated-branches>
$<$<BOOL:${COMPILER_SUPPORTS_WLOGICAL_OP}>: -Wlogical-op >
$<$<BOOL:${COMPILER_SUPPORTS_WDOUBLE_PROMOTION}>: -Wdouble-promotion >
$<$<BOOL:${COMPILER_SUPPORTS_WRANGE_LOOP_ANALYSIS}>: -Wrange-loop-analysis>
$<$<BOOL:${COMPILER_SUPPORTS_WUNDEF}>: -Wundef >
$<$<BOOL:${COMPILER_SUPPORTS_WSHADOW}>: -Wshadow >
$<$<BOOL:${TOML11_TEST_WITH_ASAN}>: -fsanitize=address >
$<$<BOOL:${TOML11_TEST_WITH_UBSAN}>: -fsanitize=undefined >
)
target_link_options(${TEST_NAME} PRIVATE
$<$<BOOL:${TOML11_TEST_WITH_ASAN}>: -fsanitize=address >
$<$<BOOL:${TOML11_TEST_WITH_UBSAN}>: -fsanitize=undefined >
)
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
endforeach(TEST_NAME)
endif(BUILD_TESTING)
# =============================================================================
# toml-test encoder/decoder
if(TOML11_BUILD_TOML_TESTS)
add_executable(toml11_decoder to_json.cpp)
target_include_directories(toml11_decoder
PRIVATE ${PROJECT_SOURCE_DIR}/tests/extlib/doctest/doctest/
PRIVATE ${PROJECT_SOURCE_DIR}/tests/extlib/json/include/
)
target_link_libraries(toml11_decoder PRIVATE toml11)
target_compile_options(toml11_decoder PRIVATE
-Wfatal-errors
$<$<BOOL:${COMPILER_SUPPORTS_WALL}>: -Wall >
$<$<BOOL:${COMPILER_SUPPORTS_WEXTRA}>: -Wextra >
$<$<BOOL:${COMPILER_SUPPORTS_WPEDANTIC}>: -Wpedantic >
$<$<BOOL:${COMPILER_SUPPORTS_WSIGN_CONVERSION}>: -Wsign-conversion >
$<$<BOOL:${COMPILER_SUPPORTS_WCONVERSION}>: -Wconversion >
$<$<BOOL:${COMPILER_SUPPORTS_WDUPLICATED_COND}>: -Wduplicated-cond >
$<$<BOOL:${COMPILER_SUPPORTS_WDUPLICATED_BRANCHES}>: -Wduplicated-branches>
$<$<BOOL:${COMPILER_SUPPORTS_WLOGICAL_OP}>: -Wlogical-op >
$<$<BOOL:${COMPILER_SUPPORTS_WDOUBLE_PROMOTION}>: -Wdouble-promotion >
$<$<BOOL:${COMPILER_SUPPORTS_WRANGE_LOOP_ANALYSIS}>: -Wrange-loop-analysis>
$<$<BOOL:${COMPILER_SUPPORTS_WUNDEF}>: -Wundef >
$<$<BOOL:${COMPILER_SUPPORTS_WSHADOW}>: -Wshadow >
$<$<BOOL:${TOML11_TEST_WITH_ASAN}>: -fsanitize=address >
$<$<BOOL:${TOML11_TEST_WITH_UBSAN}>: -fsanitize=undefined >
)
target_link_options(toml11_decoder PRIVATE
$<$<BOOL:${TOML11_TEST_WITH_ASAN}>: -fsanitize=address >
$<$<BOOL:${TOML11_TEST_WITH_UBSAN}>: -fsanitize=undefined >
)
add_executable(toml11_decoder_v1_1_0 to_json.cpp)
target_include_directories(toml11_decoder_v1_1_0
PRIVATE ${PROJECT_SOURCE_DIR}/tests/extlib/doctest/doctest/
PRIVATE ${PROJECT_SOURCE_DIR}/tests/extlib/json/include/
)
target_compile_definitions(toml11_decoder_v1_1_0 PRIVATE -DTOML11_TO_JSON_USE_V1_1_0)
target_link_libraries(toml11_decoder_v1_1_0 PRIVATE toml11)
target_compile_options(toml11_decoder_v1_1_0 PRIVATE
-Wfatal-errors
$<$<BOOL:${COMPILER_SUPPORTS_WALL}>: -Wall >
$<$<BOOL:${COMPILER_SUPPORTS_WEXTRA}>: -Wextra >
$<$<BOOL:${COMPILER_SUPPORTS_WPEDANTIC}>: -Wpedantic >
$<$<BOOL:${COMPILER_SUPPORTS_WSIGN_CONVERSION}>: -Wsign-conversion >
$<$<BOOL:${COMPILER_SUPPORTS_WCONVERSION}>: -Wconversion >
$<$<BOOL:${COMPILER_SUPPORTS_WDUPLICATED_COND}>: -Wduplicated-cond >
$<$<BOOL:${COMPILER_SUPPORTS_WDUPLICATED_BRANCHES}>: -Wduplicated-branches>
$<$<BOOL:${COMPILER_SUPPORTS_WLOGICAL_OP}>: -Wlogical-op >
$<$<BOOL:${COMPILER_SUPPORTS_WDOUBLE_PROMOTION}>: -Wdouble-promotion >
$<$<BOOL:${COMPILER_SUPPORTS_WRANGE_LOOP_ANALYSIS}>: -Wrange-loop-analysis>
$<$<BOOL:${COMPILER_SUPPORTS_WUNDEF}>: -Wundef >
$<$<BOOL:${COMPILER_SUPPORTS_WSHADOW}>: -Wshadow >
$<$<BOOL:${TOML11_TEST_WITH_ASAN}>: -fsanitize=address >
$<$<BOOL:${TOML11_TEST_WITH_UBSAN}>: -fsanitize=undefined >
)
target_link_options(toml11_decoder_v1_1_0 PRIVATE
$<$<BOOL:${TOML11_TEST_WITH_ASAN}>: -fsanitize=address >
$<$<BOOL:${TOML11_TEST_WITH_UBSAN}>: -fsanitize=undefined >
)
add_executable(toml11_encoder to_toml.cpp)
target_include_directories(toml11_encoder
PRIVATE ${PROJECT_SOURCE_DIR}/tests/extlib/doctest/doctest/
PRIVATE ${PROJECT_SOURCE_DIR}/tests/extlib/json/include/
)
target_link_libraries(toml11_encoder PRIVATE toml11)
target_compile_options(toml11_encoder PRIVATE
-Wfatal-errors
$<$<BOOL:${COMPILER_SUPPORTS_WALL}>: -Wall >
$<$<BOOL:${COMPILER_SUPPORTS_WEXTRA}>: -Wextra >
$<$<BOOL:${COMPILER_SUPPORTS_WPEDANTIC}>: -Wpedantic >
$<$<BOOL:${COMPILER_SUPPORTS_WSIGN_CONVERSION}>: -Wsign-conversion >
$<$<BOOL:${COMPILER_SUPPORTS_WCONVERSION}>: -Wconversion >
$<$<BOOL:${COMPILER_SUPPORTS_WDUPLICATED_COND}>: -Wduplicated-cond >
$<$<BOOL:${COMPILER_SUPPORTS_WDUPLICATED_BRANCHES}>: -Wduplicated-branches>
$<$<BOOL:${COMPILER_SUPPORTS_WLOGICAL_OP}>: -Wlogical-op >
$<$<BOOL:${COMPILER_SUPPORTS_WDOUBLE_PROMOTION}>: -Wdouble-promotion >
$<$<BOOL:${COMPILER_SUPPORTS_WRANGE_LOOP_ANALYSIS}>: -Wrange-loop-analysis>
$<$<BOOL:${COMPILER_SUPPORTS_WUNDEF}>: -Wundef >
$<$<BOOL:${COMPILER_SUPPORTS_WSHADOW}>: -Wshadow >
$<$<BOOL:${TOML11_TEST_WITH_ASAN}>: -fsanitize=address >
$<$<BOOL:${TOML11_TEST_WITH_UBSAN}>: -fsanitize=undefined >
)
target_link_options(toml11_encoder PRIVATE
$<$<BOOL:${TOML11_TEST_WITH_ASAN}>: -fsanitize=address >
$<$<BOOL:${TOML11_TEST_WITH_UBSAN}>: -fsanitize=undefined >
)
endif(TOML11_BUILD_TOML_TESTS)