-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
66 lines (56 loc) · 1.96 KB
/
CMakeLists.txt
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
#
# CMakeList for PHP PDO Driver for Snowflake
#
cmake_minimum_required(VERSION 2.8)
project(pdo_snowflake)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_C_FLAGS
"-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DPHP_ATOM_INC -D HAVE_CONFIG_H -fPIC -DPIC")
# coverage
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -std=c99 -Werror -g -O0 -ggdb -fprofile-arcs -ftest-coverage -fPIC")
if (UNIX AND NOT APPLE)
set(LINUX TRUE)
endif ()
# PHP home: dev env not used in TravisCI
set(PHP_HOME $ENV{PHP_HOME})
message("PHP is located at " $ENV{PHP_HOME})
set(SOURCE_FILES
snowflake_rbtree.c
snowflake_rbtree.h
snowflake_treemap.c
snowflake_treemap.h
snowflake_arraylist.c
snowflake_arraylist.h
snowflake_paramstore.c
snowflake_paramstore.h
snowflake_driver.c
snowflake_stmt.c
php_pdo_snowflake_int.h
php_pdo_snowflake.h
pdo_snowflake.c)
# set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
include_directories(
include
libsnowflakeclient/include
${PHP_HOME}/include/php
${PHP_HOME}/include/php/main
${PHP_HOME}/include/php/TSRM
${PHP_HOME}/include/php/Zend
${PHP_HOME}/include/php/ext
${PHP_HOME}/include/php/ext/date/lib
)
add_library(pdo_snowflake SHARED ${SOURCE_FILES})
SET_TARGET_PROPERTIES(pdo_snowflake PROPERTIES PREFIX "")
set_target_properties(pdo_snowflake PROPERTIES LINK_FLAGS "-Wl,-E")
target_link_libraries(pdo_snowflake
-fPIC
-L ${CMAKE_CURRENT_SOURCE_DIR}/libsnowflakeclient/lib
-lsnowflakeclient
-Wl,--whole-archive
${CMAKE_CURRENT_SOURCE_DIR}/libsnowflakeclient/deps-build/linux/curl/lib/libcurl.a
${CMAKE_CURRENT_SOURCE_DIR}/libsnowflakeclient/deps-build/linux/openssl/lib/libssl.a
${CMAKE_CURRENT_SOURCE_DIR}/libsnowflakeclient/deps-build/linux/openssl/lib/libcrypto.a
-Wl,--no-whole-archive
-fprofile-arcs
-Wl,-soname -Wl,pdo_snowflake.so)