summaryrefslogtreecommitdiffhomepage
path: root/doc/userconfig-you@Clang.cmake
blob: 2f9a9987c6eefc6915928004ae89396990e284ce (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
if(FLOORMAT_WITH-COVERAGE)
    set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "" FORCE)
    add_definitions(
        -fprofile-instr-generate
        -fcoverage-mapping
        -mllvm -runtime-counter-relocation=true
    )
    add_link_options(
        -fprofile-instr-generate
        -fcoverage-mapping
    )
endif()

add_compile_options(-emit-llvm)
sets(STRING
     CMAKE_C_FLAGS ""
     CMAKE_C_FLAGS_DEBUG "-O0 -g -glldb"
     CMAKE_C_FLAGS_RELEASE "-O2 -mtune=native"
)
sets(STRING
     CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}"
     CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}"
     CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}"
)

add_compile_options(-fdiagnostics-color=always)

# for building submodule dependencies
function(fm-userconfig-external-pre)
    add_compile_options(
        -Wno-ignored-attributes
        -Wno-unused-function
        -Wno-unused-but-set-variable
        -Wno-old-style-cast
    )
endfunction()

# for floormat sources only
function(fm-userconfig-src)
    add_compile_options(
        -Wall -Wextra -Wpedantic -Wno-old-style-cast -Wno-padded
    )
    add_compile_options(
        -Wall
        -Wextra
        -Wpedantic
        -Weverything
        -Wno-c++98-compat
        -Wno-c++20-compat
        -Wno-c++98-compat-pedantic
        -Wno-undefined-func-template
        -Wno-switch-enum
        -Wno-covered-switch-default
        -Wno-old-style-cast
        -Wno-global-constructors
        -Wno-exit-time-destructors
        -Wno-implicit-int-float-conversion
        -Wno-shadow-field-in-constructor
        -Wno-shadow
        -Wno-ctad-maybe-unsupported
        -Wno-documentation-unknown-command
        -Wno-documentation
        -Wno-ignored-attributes
        -Wno-reserved-identifier
    )
    add_compile_options(
        -Werror
        -Wno-error=float-equal
        -Wno-error=comma
        -Wno-error=unused-parameter
        -Wno-error=unused-private-field
        -Wno-error=alloca
    )
endfunction()

sets(BOOL
     SDL_SHARED             ON
     SDL_STATIC             OFF    # speed up linking

     CORRADE_BUILD_TESTS    TRUE
     MAGNUM_BUILD_TESTS     TRUE
)

if (FLOORMAT_WITH-COVERAGE OR CMAKE_CXX_BUILD_TYPE STREQUAL "RELEASE")
    sets(BOOL
         CORRADE_BUILD_TESTS    FALSE
         MAGNUM_BUILD_TESTS     FALSE
    )
endif()