aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/crcutil/ya.make
blob: 4e010a67a42d6dd8b029516178f4873cac98e61b (plain) (blame)
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
LIBRARY()

LICENSE(Apache-2.0)

VERSION(1.0)

LICENSE_TEXTS(.yandex_meta/licenses.list.txt)

OWNER( 
    g:contrib 
    g:cpp-contrib 
) 

NO_UTIL()

NO_COMPILER_WARNINGS()

NO_JOIN_SRC()

IF (GCC AND USE_LTO)
    CFLAGS(-DCRCUTIL_FORCE_ASM_CRC32C=1)
ENDIF()

IF (ARCH_I386 OR ARCH_X86_64)
    IF (OS_WINDOWS)
        SRCS(
            multiword_64_64_cl_i386_mmx.cc
        )
    ELSEIF (OS_ANDROID AND ARCH_I386)
        # 32-bit Android has some problems with register allocation, so we fall back to default implementation
    ELSE()
        IF (CLANG)
            CFLAGS(-DCRCUTIL_USE_MM_CRC32=1)
            IF (ARCH_I386)
                # clang doesn't support this as optimization attribute and has problems with register allocation
                SRC(
                    multiword_64_64_gcc_i386_mmx.cc
                    -fomit-frame-pointer
                )
            ELSE()
                SRCS(
                    multiword_64_64_gcc_i386_mmx.cc
                )
            ENDIF()
        ELSE()
            CFLAGS(
                -mcrc32
                -DCRCUTIL_USE_MM_CRC32=1
            )
        ENDIF()
        SRCS(
            multiword_128_64_gcc_amd64_sse2.cc
            multiword_64_64_gcc_amd64_asm.cc
        )
    ENDIF()
    IF (OS_WINDOWS)
        SRCS(
            crc32c_sse4.cc
        )
    ELSE()
        SRC_CPP_SSE4(crc32c_sse4.cc)
    ENDIF()
ENDIF()

SRCS(
    interface.cc
    multiword_64_64_intrinsic_i386_mmx.cc
)

END()