summaryrefslogtreecommitdiff
path: root/source/luametatex/cmake/mp.cmake
blob: 1d064101db54087813149308bfa909c6bcab6595 (plain)
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
43
44
45
46
47
48
49
50
set(mp_sources

    source/mp/mpc/mp.c
    source/mp/mpc/mpstrings.c
    source/mp/mpc/mpmath.c
    source/mp/mpc/mpmathdouble.c
    source/mp/mpc/mpmathbinary.c
    source/mp/mpc/mpmathdecimal.c

    source/libraries/decnumber/decContext.c
    source/libraries/decnumber/decNumber.c

    source/libraries/avl/avl.c

    source/lua/lmtmplib.c

    source/luarest/lmtxdecimallib.c

)

add_library(mp STATIC ${mp_sources})

target_include_directories(mp PRIVATE
    .
    source/.
    source/mp/mpc
    source/luacore/lua54/src
    source/libraries/avl
    source/libraries/decnumber
    source/utilities
    source/libraries/mimalloc/include
)

target_compile_definitions(mp PUBLIC
    DECUSE64=1
  # DECCHECK=1
  # DECBUFFER=512
    DECNUMDIGITS=1000
)

if (NOT MSVC)
    target_compile_options(mp PRIVATE
        -Wno-unused-parameter
        -Wno-sign-compare
        -Wno-cast-qual
        -Wno-cast-align
        # for decnumber with lto
        -fno-strict-aliasing
)
endif()