File: CMakeLists.txt

package info (click to toggle)
dragonbox 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,148 kB
  • sloc: cpp: 8,752; ansic: 1,522; makefile: 18
file content (42 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download | duplicates (2)
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
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

project(dragonbox_common LANGUAGES CXX)

include(FetchContent)
if (NOT TARGET dragonbox)
    FetchContent_Declare(dragonbox SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")
    FetchContent_MakeAvailable(dragonbox)
endif()

set(dragonbox_common_headers
        include/big_uint.h
	include/continued_fractions.h
	include/rational_continued_fractions.h
	include/best_rational_approx.h
	include/good_rational_approx.h
        include/random_float.h)

set(dragonbox_common_sources source/big_uint.cpp)

add_library(dragonbox_common STATIC
        ${dragonbox_common_headers}
        ${dragonbox_common_sources})
add_library(dragonbox::common ALIAS dragonbox_common)

target_include_directories(dragonbox_common
        PUBLIC
        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)

target_compile_features(dragonbox_common PUBLIC cxx_std_17)

target_link_libraries(dragonbox_common PUBLIC dragonbox::dragonbox)

# ---- MSVC Specifics ----
if (MSVC)
    # No need to not generate PDB
    # /permissive- should be the default
    # The compilation will fail without /experimental:newLambdaProcessor
    target_compile_options(dragonbox_common PUBLIC
              /Zi /permissive-
              $<$<NOT:$<CXX_COMPILER_ID:Clang>>:/experimental:newLambdaProcessor>)
endif()