Mercurial > hg > orthanc-databases
comparison Resources/CMake/PostgreSQLConfiguration.cmake @ 173:30d3f68631d2
support of mingw in postgresql
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 11 Dec 2020 14:50:51 +0100 |
parents | 8c7bb94adff7 |
children | 77a5d1a5ebfd |
comparison
equal
deleted
inserted
replaced
172:8c7bb94adff7 | 173:30d3f68631d2 |
---|---|
60 ## | 60 ## |
61 ## Platform-specific configuration | 61 ## Platform-specific configuration |
62 ## | 62 ## |
63 | 63 |
64 if (CMAKE_SYSTEM_NAME STREQUAL "Windows") | 64 if (CMAKE_SYSTEM_NAME STREQUAL "Windows") |
65 add_definitions( | |
66 -DEXEC_BACKEND | |
67 ) | |
68 | |
69 configure_file( | 65 configure_file( |
70 ${LIBPQ_SOURCES_DIR}/src/include/port/win32.h | 66 ${LIBPQ_SOURCES_DIR}/src/include/port/win32.h |
71 ${AUTOGENERATED_DIR}/pg_config_os.h | 67 ${AUTOGENERATED_DIR}/pg_config_os.h |
72 COPYONLY) | 68 COPYONLY) |
73 | 69 |
112 | 108 |
113 ## | 109 ## |
114 ## Generation of "pg_config.h" | 110 ## Generation of "pg_config.h" |
115 ## | 111 ## |
116 | 112 |
117 if (CMAKE_SYSTEM_NAME STREQUAL "Windows") | 113 set(PG_VERSION "\"${LIBPQ_MAJOR}.${LIBPQ_MINOR}\"") |
118 configure_file( | 114 math(EXPR PG_VERSION_NUM "${LIBPQ_MAJOR} * 10000 + ${LIBPQ_MINOR}") |
119 ${LIBPQ_SOURCES_DIR}/src/include/pg_config_ext.h.win32 | 115 |
120 ${AUTOGENERATED_DIR}/pg_config_ext.h | 116 include(${CMAKE_CURRENT_LIST_DIR}/../PostgreSQL/func_accept_args.cmake) |
121 COPYONLY) | 117 include(${CMAKE_CURRENT_LIST_DIR}/../PostgreSQL/CheckTypeAlignment.cmake) |
122 | 118 |
123 configure_file( | 119 check_include_file("execinfo.h" HAVE_EXECINFO_H) |
124 ${LIBPQ_SOURCES_DIR}/src/include/pg_config.h.win32 | 120 check_include_file("getopt.h" HAVE_GETOPT_H) |
125 ${AUTOGENERATED_DIR}/pg_config.h | 121 check_include_file("ifaddrs.h" HAVE_IFADDRS_H) |
126 COPYONLY) | 122 check_include_file("inttypes.h" HAVE_INTTYPES_H) |
127 | 123 check_include_file("langinfo.h" HAVE_LANGINFO_H) |
128 if (CMAKE_COMPILER_IS_GNUCXX) # MinGW | 124 check_include_file("memory.h" HAVE_MEMORY_H) |
129 add_definitions( | 125 check_include_file("netinet/tcp.h" HAVE_NETINET_TCP_H) |
130 -DPG_PRINTF_ATTRIBUTE=gnu_printf | 126 check_include_file("readline/history.h" HAVE_READLINE_HISTORY_H) |
131 -DHAVE_GETTIMEOFDAY | 127 check_include_file("readline/readline.h" HAVE_READLINE_READLINE_H) |
132 -DHAVE_LONG_LONG_INT_64 | 128 check_include_file("stdbool.h" HAVE_STDBOOL_H) |
133 -DHAVE_STRUCT_ADDRINFO | 129 check_include_file("stdlib.h" HAVE_STDLIB_H) |
134 -DHAVE_STRUCT_SOCKADDR_STORAGE | 130 check_include_file("string.h" HAVE_STRING_H) |
135 -DHAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY | 131 check_include_file("strings.h" HAVE_STRINGS_H) |
136 ) | 132 check_include_file("sys/epoll.h" HAVE_SYS_EPOLL_H) |
137 endif() | 133 check_include_file("sys/event.h" HAVE_SYS_EVENT_H) |
138 | 134 check_include_file("sys/ipc.h" HAVE_SYS_IPC_H) |
139 if (ENABLE_SSL) | 135 check_include_file("sys/prctl.h" HAVE_SYS_PRCTL_H) |
140 add_definitions( | 136 check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H) |
141 -DHAVE_LIBSSL=1 | 137 check_include_file("sys/select.h" HAVE_SYS_SELECT_H) |
142 -DUSE_OPENSSL=1 | 138 check_include_file("sys/sem.h" HAVE_SYS_SEM_H) |
143 ) | 139 check_include_file("sys/shm.h" HAVE_SYS_SHM_H) |
144 endif() | 140 check_include_file("sys/stat.h" HAVE_SYS_STAT_H) |
145 | 141 check_include_file("sys/termios.h" HAVE_SYS_TERMIOS_H) |
146 elseif(CROSS_COMPILING) | 142 check_include_file("sys/types.h" HAVE_SYS_TYPES_H) |
147 message(FATAL_ERROR "Cannot auto-generate the configuration file cross-compiling") | 143 check_include_file("sys/un.h" HAVE_SYS_UN_H) |
148 | 144 check_include_file("termios.h" HAVE_TERMIOS_H) |
145 check_include_file("unistd.h" HAVE_UNISTD_H) | |
146 check_include_file("wctype.h" HAVE_WCTYPE_H) | |
147 | |
148 check_type_size("long long int" SIZEOF_LONG_LONG_INT) | |
149 if (SIZEOF_LONG_LONG_INT EQUAL 8) | |
150 set(HAVE_LONG_LONG_INT_64 1) | |
151 set(PG_INT64_TYPE "long long int") | |
152 endif() | |
153 | |
154 check_type_size("long int" SIZEOF_LONG_INT) | |
155 if (SIZEOF_LONG_INT EQUAL 8) | |
156 set(HAVE_LONG_INT_64 1) | |
157 set(PG_INT64_TYPE "long int") | |
158 endif() | |
159 | |
160 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
161 set(ALIGNOF_DOUBLE 8) | |
162 set(ALIGNOF_INT 4) | |
163 set(ALIGNOF_LONG 4) | |
164 set(ALIGNOF_LONG_LONG_INT 8) | |
165 set(ALIGNOF_SHORT 2) | |
149 else() | 166 else() |
150 set(PG_VERSION "\"${LIBPQ_MAJOR}.${LIBPQ_MINOR}\"") | |
151 math(EXPR PG_VERSION_NUM "${LIBPQ_MAJOR} * 10000 + ${LIBPQ_MINOR}") | |
152 | |
153 include(${CMAKE_CURRENT_LIST_DIR}/../PostgreSQL/func_accept_args.cmake) | |
154 include(${CMAKE_CURRENT_LIST_DIR}/../PostgreSQL/CheckTypeAlignment.cmake) | |
155 | |
156 check_include_file("execinfo.h" HAVE_EXECINFO_H) | |
157 check_include_file("getopt.h" HAVE_GETOPT_H) | |
158 check_include_file("ifaddrs.h" HAVE_IFADDRS_H) | |
159 check_include_file("inttypes.h" HAVE_INTTYPES_H) | |
160 check_include_file("langinfo.h" HAVE_LANGINFO_H) | |
161 check_include_file("memory.h" HAVE_MEMORY_H) | |
162 check_include_file("netinet/tcp.h" HAVE_NETINET_TCP_H) | |
163 check_include_file("readline/history.h" HAVE_READLINE_HISTORY_H) | |
164 check_include_file("readline/readline.h" HAVE_READLINE_READLINE_H) | |
165 check_include_file("stdbool.h" HAVE_STDBOOL_H) | |
166 check_include_file("stdlib.h" HAVE_STDLIB_H) | |
167 check_include_file("string.h" HAVE_STRING_H) | |
168 check_include_file("strings.h" HAVE_STRINGS_H) | |
169 check_include_file("sys/epoll.h" HAVE_SYS_EPOLL_H) | |
170 check_include_file("sys/event.h" HAVE_SYS_EVENT_H) | |
171 check_include_file("sys/ipc.h" HAVE_SYS_IPC_H) | |
172 check_include_file("sys/prctl.h" HAVE_SYS_PRCTL_H) | |
173 check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H) | |
174 check_include_file("sys/select.h" HAVE_SYS_SELECT_H) | |
175 check_include_file("sys/sem.h" HAVE_SYS_SEM_H) | |
176 check_include_file("sys/shm.h" HAVE_SYS_SHM_H) | |
177 check_include_file("sys/stat.h" HAVE_SYS_STAT_H) | |
178 check_include_file("sys/termios.h" HAVE_SYS_TERMIOS_H) | |
179 check_include_file("sys/types.h" HAVE_SYS_TYPES_H) | |
180 check_include_file("sys/un.h" HAVE_SYS_UN_H) | |
181 check_include_file("termios.h" HAVE_TERMIOS_H) | |
182 check_include_file("unistd.h" HAVE_UNISTD_H) | |
183 check_include_file("wctype.h" HAVE_WCTYPE_H) | |
184 | |
185 check_type_size("long long int" SIZEOF_LONG_LONG_INT) | |
186 if (SIZEOF_LONG_LONG_INT EQUAL 8) | |
187 set(HAVE_LONG_LONG_INT_64 1) | |
188 set(PG_INT64_TYPE "long long int") | |
189 endif() | |
190 | |
191 check_type_size("long int" SIZEOF_LONG_INT) | |
192 if (SIZEOF_LONG_INT EQUAL 8) | |
193 set(HAVE_LONG_INT_64 1) | |
194 set(PG_INT64_TYPE "long int") | |
195 endif() | |
196 | |
197 if (CMAKE_COMPILER_IS_GNUCXX OR | |
198 "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | |
199 set(PG_PRINTF_ATTRIBUTE "gnu_printf") | |
200 set(pg_restrict "__restrict") | |
201 else() | |
202 set(pg_restrict "") | |
203 endif() | |
204 | |
205 check_type_alignment(double ALIGNOF_DOUBLE) | 167 check_type_alignment(double ALIGNOF_DOUBLE) |
206 check_type_alignment(int ALIGNOF_INT) | 168 check_type_alignment(int ALIGNOF_INT) |
207 check_type_alignment(long ALIGNOF_LONG) | 169 check_type_alignment(long ALIGNOF_LONG) |
208 check_type_alignment("long long int" ALIGNOF_LONG_LONG_INT) | 170 check_type_alignment("long long int" ALIGNOF_LONG_LONG_INT) |
209 check_type_alignment(short ALIGNOF_SHORT) | 171 check_type_alignment(short ALIGNOF_SHORT) |
210 | 172 endif() |
211 set(MAXIMUM_ALIGNOF ${ALIGNOF_LONG}) | 173 |
212 if (MAXIMUM_ALIGNOF LESS ALIGNOF_DOUBLE) | 174 set(MAXIMUM_ALIGNOF ${ALIGNOF_LONG}) |
213 set(MAXIMUM_ALIGNOF ${ALIGNOF_DOUBLE}) | 175 if (MAXIMUM_ALIGNOF LESS ALIGNOF_DOUBLE) |
214 endif() | 176 set(MAXIMUM_ALIGNOF ${ALIGNOF_DOUBLE}) |
215 if (HAVE_LONG_LONG_INT_64 AND (MAXIMUM_ALIGNOF LESS HAVE_LONG_LONG_INT_64)) | 177 endif() |
216 set(MAXIMUM_ALIGNOF ${HAVE_LONG_LONG_INT_64}) | 178 if (HAVE_LONG_LONG_INT_64 AND (MAXIMUM_ALIGNOF LESS HAVE_LONG_LONG_INT_64)) |
217 endif() | 179 set(MAXIMUM_ALIGNOF ${HAVE_LONG_LONG_INT_64}) |
218 | 180 endif() |
219 set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h;netdb.h") | 181 |
220 check_type_size("struct addrinfo" HAVE_STRUCT_ADDRINFO) | 182 if (CMAKE_COMPILER_IS_GNUCXX OR |
221 check_type_size("struct sockaddr_storage" HAVE_STRUCT_SOCKADDR_STORAGE) | 183 "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
222 check_struct_has_member("struct sockaddr_storage" ss_family | 184 set(PG_PRINTF_ATTRIBUTE "gnu_printf") |
223 "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) | 185 set(pg_restrict "__restrict") |
224 check_function_exists(unsetenv HAVE_UNSETENV) | 186 else() |
225 check_function_exists(strchrnul HAVE_STRCHRNUL) | 187 set(pg_restrict "") |
226 check_function_exists(random HAVE_RANDOM) | 188 endif() |
227 check_function_exists(srandom HAVE_SRANDOM) | 189 |
228 | 190 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
229 # Hardcoded stuff from "./configure" of libpq | 191 set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;winsock2.h;ws2tcpip.h") |
230 set(MEMSET_LOOP_LIMIT 1024) | 192 else() |
231 set(BLCKSZ 8192) | 193 set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;sys/socket.h;netdb.h") |
232 set(XLOG_BLCKSZ 8192) | 194 endif() |
233 set(DEF_PGPORT 5432) | 195 |
234 set(DEF_PGPORT_STR "\"${DEF_PGPORT}\"") | 196 check_type_size("struct addrinfo" HAVE_STRUCT_ADDRINFO) |
235 set(PG_KRB_SRVNAM "\"postgres\"") | 197 check_type_size("struct sockaddr_storage" HAVE_STRUCT_SOCKADDR_STORAGE) |
236 | 198 check_struct_has_member("struct sockaddr_storage" ss_family |
237 # Assume that zlib and openssl are always present | 199 "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) |
238 set(HAVE_LIBZ 1) | 200 |
239 set(HAVE_LIBSSL 1) | 201 check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R) |
240 set(HAVE_OPENSSL_INIT_SSL 1) | 202 check_function_exists(getopt HAVE_GETOPT) |
241 set(USE_OPENSSL 1) | 203 check_function_exists(getopt_long HAVE_GETOPT_LONG) |
242 set(USE_OPENSSL_RANDOM 1) | 204 check_function_exists(getpwuid_r HAVE_GETPWUID_R) |
243 | 205 check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) |
244 PrepareCMakeConfigurationFile( | 206 check_function_exists(random HAVE_RANDOM) |
245 ${LIBPQ_SOURCES_DIR}/src/include/pg_config_ext.h.in | 207 check_function_exists(srandom HAVE_SRANDOM) |
246 ${AUTOGENERATED_DIR}/pg_config_ext.h.in) | 208 check_function_exists(strchrnul HAVE_STRCHRNUL) |
247 | 209 check_function_exists(strerror HAVE_STRERROR) |
248 PrepareCMakeConfigurationFile( | 210 check_function_exists(strerror_r HAVE_STRERROR_R) |
249 ${LIBPQ_SOURCES_DIR}/src/include/pg_config.h.in | 211 check_function_exists(unsetenv HAVE_UNSETENV) |
250 ${AUTOGENERATED_DIR}/pg_config.h.in) | 212 |
251 | 213 check_c_source_compiles(" |
252 configure_file( | 214 #include <sys/time.h> |
253 ${AUTOGENERATED_DIR}/pg_config_ext.h.in | 215 int main(void){ |
254 ${AUTOGENERATED_DIR}/pg_config_ext.h) | 216 struct timeval *tp; |
255 | 217 struct timezone *tzp; |
256 configure_file( | 218 gettimeofday(tp,tzp); |
257 ${AUTOGENERATED_DIR}/pg_config.h.in | 219 return 0; |
258 ${AUTOGENERATED_DIR}/pg_config.h) | 220 } |
259 | 221 " GETTIMEOFDAY_2ARG) |
260 endif() | 222 |
223 if(NOT GETTIMEOFDAY_2ARG) | |
224 set(GETTIMEOFDAY_1ARG 1) | |
225 endif(NOT GETTIMEOFDAY_2ARG) | |
226 | |
227 check_c_source_compiles(" | |
228 #include <time.h> | |
229 int main(void){ | |
230 int res; | |
231 #ifndef __CYGWIN__ | |
232 res = timezone / 60; | |
233 #else | |
234 res = _timezone / 60; | |
235 #endif | |
236 return 0; | |
237 } | |
238 " HAVE_INT_TIMEZONE) | |
239 | |
240 # Hardcoded stuff from "./configure" of libpq | |
241 set(MEMSET_LOOP_LIMIT 1024) | |
242 set(BLCKSZ 8192) | |
243 set(XLOG_BLCKSZ 8192) | |
244 set(DEF_PGPORT 5432) | |
245 set(DEF_PGPORT_STR "\"${DEF_PGPORT}\"") | |
246 set(PG_KRB_SRVNAM "\"postgres\"") | |
247 | |
248 # Assume that zlib and openssl are always present | |
249 set(HAVE_LIBZ 1) | |
250 set(HAVE_LIBSSL 1) | |
251 set(HAVE_OPENSSL_INIT_SSL 1) | |
252 set(USE_OPENSSL 1) | |
253 set(USE_OPENSSL_RANDOM 1) | |
254 | |
255 PrepareCMakeConfigurationFile( | |
256 ${LIBPQ_SOURCES_DIR}/src/include/pg_config_ext.h.in | |
257 ${AUTOGENERATED_DIR}/pg_config_ext.h.in) | |
258 | |
259 PrepareCMakeConfigurationFile( | |
260 ${LIBPQ_SOURCES_DIR}/src/include/pg_config.h.in | |
261 ${AUTOGENERATED_DIR}/pg_config.h.in) | |
262 | |
263 configure_file( | |
264 ${AUTOGENERATED_DIR}/pg_config_ext.h.in | |
265 ${AUTOGENERATED_DIR}/pg_config_ext.h) | |
266 | |
267 configure_file( | |
268 ${AUTOGENERATED_DIR}/pg_config.h.in | |
269 ${AUTOGENERATED_DIR}/pg_config.h) | |
261 | 270 |
262 | 271 |
263 | 272 |
264 ## | 273 ## |
265 ## Generic configuration | 274 ## Generic configuration |
314 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/libpq-events.c | 323 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/libpq-events.c |
315 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/pqexpbuffer.c | 324 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/pqexpbuffer.c |
316 ${LIBPQ_SOURCES_DIR}/src/port/chklocale.c | 325 ${LIBPQ_SOURCES_DIR}/src/port/chklocale.c |
317 ${LIBPQ_SOURCES_DIR}/src/port/explicit_bzero.c | 326 ${LIBPQ_SOURCES_DIR}/src/port/explicit_bzero.c |
318 ${LIBPQ_SOURCES_DIR}/src/port/getaddrinfo.c | 327 ${LIBPQ_SOURCES_DIR}/src/port/getaddrinfo.c |
328 ${LIBPQ_SOURCES_DIR}/src/port/getpeereid.c | |
319 ${LIBPQ_SOURCES_DIR}/src/port/inet_net_ntop.c | 329 ${LIBPQ_SOURCES_DIR}/src/port/inet_net_ntop.c |
320 ${LIBPQ_SOURCES_DIR}/src/port/noblock.c | 330 ${LIBPQ_SOURCES_DIR}/src/port/noblock.c |
321 ${LIBPQ_SOURCES_DIR}/src/port/pg_strong_random.c | 331 ${LIBPQ_SOURCES_DIR}/src/port/pg_strong_random.c |
322 ${LIBPQ_SOURCES_DIR}/src/port/pgstrcasecmp.c | 332 ${LIBPQ_SOURCES_DIR}/src/port/pgstrcasecmp.c |
323 ${LIBPQ_SOURCES_DIR}/src/port/pqsignal.c | 333 ${LIBPQ_SOURCES_DIR}/src/port/pqsignal.c |
324 ${LIBPQ_SOURCES_DIR}/src/port/snprintf.c | 334 ${LIBPQ_SOURCES_DIR}/src/port/snprintf.c |
325 ${LIBPQ_SOURCES_DIR}/src/port/strerror.c | 335 ${LIBPQ_SOURCES_DIR}/src/port/strerror.c |
336 ${LIBPQ_SOURCES_DIR}/src/port/strlcpy.c | |
326 ${LIBPQ_SOURCES_DIR}/src/port/thread.c | 337 ${LIBPQ_SOURCES_DIR}/src/port/thread.c |
327 ) | 338 ) |
328 | 339 |
329 if (CMAKE_SYSTEM_NAME STREQUAL "Linux") | 340 if (CMAKE_SYSTEM_NAME STREQUAL "Windows") |
330 LIST(APPEND LIBPQ_SOURCES | |
331 ${LIBPQ_SOURCES_DIR}/src/port/strlcpy.c | |
332 ) | |
333 | |
334 elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows") | |
335 link_libraries(secur32) | 341 link_libraries(secur32) |
336 | 342 |
337 include_directories( | 343 include_directories( |
338 ${LIBPQ_SOURCES_DIR}/src/include/port/win32 | 344 ${LIBPQ_SOURCES_DIR}/src/include/port/win32 |
339 ${LIBPQ_SOURCES_DIR}/src/port | 345 ${LIBPQ_SOURCES_DIR}/src/port |
340 ) | 346 ) |
341 | 347 |
342 LIST(APPEND LIBPQ_SOURCES | 348 LIST(APPEND LIBPQ_SOURCES |
343 # libpgport C files that are needed if identified by configure | 349 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/pthread-win32.c |
344 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/win32.c | 350 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/win32.c |
345 ${LIBPQ_SOURCES_DIR}/src/port/crypt.c | 351 ${LIBPQ_SOURCES_DIR}/src/port/dirmod.c |
346 ${LIBPQ_SOURCES_DIR}/src/port/inet_aton.c | 352 ${LIBPQ_SOURCES_DIR}/src/port/inet_aton.c |
347 ${LIBPQ_SOURCES_DIR}/src/port/open.c | 353 ${LIBPQ_SOURCES_DIR}/src/port/open.c |
348 ${LIBPQ_SOURCES_DIR}/src/port/pgsleep.c | 354 ${LIBPQ_SOURCES_DIR}/src/port/pgsleep.c |
349 ${LIBPQ_SOURCES_DIR}/src/port/snprintf.c | 355 ${LIBPQ_SOURCES_DIR}/src/port/system.c |
350 ${LIBPQ_SOURCES_DIR}/src/port/system.c | 356 ${LIBPQ_SOURCES_DIR}/src/port/win32error.c |
351 ${LIBPQ_SOURCES_DIR}/src/port/win32setlocale.c | 357 ${LIBPQ_SOURCES_DIR}/src/port/win32setlocale.c |
352 ${LIBPQ_SOURCES_DIR}/src/port/getaddrinfo.c | |
353 ${LIBPQ_SOURCES_DIR}/src/port/strlcpy.c | |
354 ) | 358 ) |
359 | |
360 if (MSVC) | |
361 include_directories( | |
362 ${LIBPQ_SOURCES_DIR}/src/include/port/win32_msvc | |
363 ) | |
355 | 364 |
356 if (CMAKE_COMPILER_IS_GNUCXX OR | 365 LIST(APPEND LIBPQ_SOURCES |
357 (MSVC AND MSVC_VERSION GREATER 1800)) | 366 ${LIBPQ_SOURCES_DIR}/src/port/dirent.c |
358 # Starting Visual Studio 2013 (version 1800), it is necessary to also add "win32error.c" | 367 ) |
359 LIST(APPEND LIBPQ_SOURCES ${LIBPQ_SOURCES_DIR}/src/port/win32error.c) | |
360 endif() | 368 endif() |
361 | |
362 if (MSVC) | |
363 LIST(APPEND LIBPQ_SOURCES ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/pthread-win32.c) | |
364 endif() | |
365 endif() | |
366 | |
367 if (CMAKE_COMPILER_IS_GNUCXX AND | |
368 NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") | |
369 LIST(APPEND LIBPQ_SOURCES | |
370 ${LIBPQ_SOURCES_DIR}/src/port/getpeereid.c | |
371 ) | |
372 | |
373 elseif (MSVC) | |
374 include_directories( | |
375 ${LIBPQ_SOURCES_DIR}/src/include/port/win32_msvc | |
376 ) | |
377 | |
378 LIST(APPEND LIBPQ_SOURCES | |
379 ${LIBPQ_SOURCES_DIR}/src/port/dirent.c | |
380 ${LIBPQ_SOURCES_DIR}/src/port/dirmod.c | |
381 ) | |
382 endif() | 369 endif() |
383 | 370 |
384 source_group(ThirdParty\\PostgreSQL REGULAR_EXPRESSION ${LIBPQ_SOURCES_DIR}/.*) | 371 source_group(ThirdParty\\PostgreSQL REGULAR_EXPRESSION ${LIBPQ_SOURCES_DIR}/.*) |
385 | 372 |
386 else() | 373 else() |