aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/parser/pg_wrapper/ya.make
blob: cf31405febde62424031a0428f9329438c4a3ef2 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
LIBRARY()

PROVIDES(
    yql_pg_runtime
)

CXXFLAGS(-DMKQL_DISABLE_CODEGEN)

YQL_LAST_ABI_VERSION()

ADDINCL(
    contrib/libs/lz4
    yql/essentials/parser/pg_wrapper/postgresql/src/backend/bootstrap
    yql/essentials/parser/pg_wrapper/postgresql/src/backend/parser
    yql/essentials/parser/pg_wrapper/postgresql/src/backend/replication
    yql/essentials/parser/pg_wrapper/postgresql/src/backend/replication/logical
    yql/essentials/parser/pg_wrapper/postgresql/src/backend/utils/adt
    yql/essentials/parser/pg_wrapper/postgresql/src/backend/utils/misc
    yql/essentials/parser/pg_wrapper/postgresql/src/backend/utils/sort
    yql/essentials/parser/pg_wrapper/postgresql/src/common
    yql/essentials/parser/pg_wrapper/postgresql/src/include
    yql/essentials/parser/pg_wrapper/postgresql/src/port
)

IF (NOT BUILD_POSTGRES_ONLY)
SRCS(
    arena_ctx.cpp
    arrow.cpp
    arrow_impl.cpp
    conversion.cpp
    parser.cpp
    thread_inits.c
    comp_factory.cpp
    type_cache.cpp
    pg_aggs.cpp
    read_table.cpp
    recovery.cpp
    superuser.cpp
    config.cpp
    cost_mocks.cpp
    syscache.cpp
    pg_utils_wrappers.cpp
    utils.cpp
    ctors.cpp
)
ENDIF()

IF (ARCH_X86_64)
    CFLAGS(
        -DHAVE__GET_CPUID=1
        -DUSE_SSE42_CRC32C_WITH_RUNTIME_CHECK=1
    )
    SRCS(
        postgresql/src/port/pg_crc32c_sse42.c
        postgresql/src/port/pg_crc32c_sse42_choose.c
    )
ENDIF()

INCLUDE(pg_sources.inc)

IF (NOT BUILD_POSTGRES_ONLY)
INCLUDE(pg_kernel_sources.inc)
ENDIF()

IF (NOT OS_WINDOWS AND NOT SANITIZER_TYPE AND NOT BUILD_TYPE == "DEBUG")
IF (NOT BUILD_POSTGRES_ONLY)
USE_LLVM_BC14()
INCLUDE(pg_bc.all.inc)
ENDIF()
ELSE()
CFLAGS(-DUSE_SLOW_PG_KERNELS)
ENDIF()

IF (BUILD_TYPE == "DEBUG")
CFLAGS(-DDISABLE_COMPLEX_MACRO)
ENDIF()

PEERDIR(
    library/cpp/resource
    library/cpp/yson
    yql/essentials/core
    yql/essentials/minikql/arrow
    yql/essentials/minikql/computation
    yql/essentials/parser/pg_catalog
    yql/essentials/parser/pg_wrapper/interface
    yql/essentials/providers/common/codec
    yql/essentials/public/issue
    yql/essentials/public/udf
    yql/essentials/utils
    yql/essentials/public/decimal
    yql/essentials/public/result_format
    yql/essentials/types/binary_json
    yql/essentials/types/dynumber
    yql/essentials/types/uuid

    contrib/libs/icu
    contrib/libs/libc_compat
    contrib/libs/libxml
    contrib/libs/lz4
    contrib/libs/openssl
)

INCLUDE(cflags.inc)

IF (OS_LINUX)
    SRCS(
        postgresql/src/port/strlcat.c
        postgresql/src/port/strlcpy.c
    )
ENDIF()

IF (OS_LINUX OR OS_DARWIN)
    SRCS(
        postgresql/src/backend/port/posix_sema.c
        postgresql/src/backend/port/sysv_shmem.c
    )
ELSEIF (OS_WINDOWS)
    ADDINCL(
        yql/essentials/parser/pg_wrapper/postgresql/src/include
        yql/essentials/parser/pg_wrapper/postgresql/src/include/port/win32
        yql/essentials/parser/pg_wrapper/postgresql/src/include/port/win32_msvc
    )
    SRCS(
        postgresql/src/backend/port/win32/crashdump.c
        postgresql/src/backend/port/win32/signal.c
        postgresql/src/backend/port/win32/socket.c
        postgresql/src/backend/port/win32/timer.c
        postgresql/src/backend/port/win32_sema.c
        postgresql/src/backend/port/win32_shmem.c
        postgresql/src/port/dirmod.c
        postgresql/src/port/getopt.c
        postgresql/src/port/inet_aton.c
        postgresql/src/port/kill.c
        postgresql/src/port/open.c
        postgresql/src/port/pwritev.c
        postgresql/src/port/system.c
        postgresql/src/port/win32common.c
        postgresql/src/port/win32dlopen.c
        postgresql/src/port/win32env.c
        postgresql/src/port/win32error.c
        postgresql/src/port/win32fseek.c
        postgresql/src/port/win32gai_strerror.c
        postgresql/src/port/win32gettimeofday.c
        postgresql/src/port/win32getrusage.c
        postgresql/src/port/win32ntdll.c
        postgresql/src/port/win32pread.c
        postgresql/src/port/win32pwrite.c
        postgresql/src/port/win32security.c
        postgresql/src/port/win32setlocale.c
        postgresql/src/port/win32stat.c
    )
ENDIF()

# Service files must be listed as dependencies to be included in export
FILES(
    copy_src.py
    copy_src.sh
    generate_kernels.py
    source.patch
    vars.txt
    verify.sh
)

END()

RECURSE(
    interface
)

RECURSE_FOR_TESTS(
    ut
    test
)