This repository was archived by the owner on Sep 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,7 @@ peloton_default_properties(peloton-proto)
32
32
33
33
# --[ Libpg_query library
34
34
35
- add_custom_target (libpg_query ALL
36
- COMMAND ${CMAKE_MAKE_PROGRAM}
37
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} /third_party/libpg_query/
38
- COMMENT "Original libpg makefile target" )
35
+ add_subdirectory (${PROJECT_SOURCE_DIR} /third_party/libpg_query/ libpg_query.a )
39
36
40
37
41
38
##################################################################################
@@ -46,9 +43,8 @@ add_custom_target(libpg_query ALL
46
43
peloton_pickup_peloton_sources (${PROJECT_SOURCE_DIR} )
47
44
48
45
add_library (peloton SHARED ${srcs} )
49
- add_dependencies (peloton libpg_query )
50
- target_link_libraries (peloton ${Peloton_LINKER_LIBS}
51
- ${PROJECT_SOURCE_DIR} /third_party/libpg_query/libpg_query.a )
46
+
47
+ target_link_libraries (peloton PUBLIC ${Peloton_LINKER_LIBS} peloton-proto PRIVATE pg_query )
52
48
53
49
peloton_default_properties (peloton )
54
50
set_target_properties (peloton PROPERTIES
Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 2.8.7 )
2
+
3
+ # ---[ Peloton project
4
+ project (pg_query CXX C )
5
+
6
+ # this code imitates the Makefile in /third_party/libpg_query/
7
+ file (GLOB_RECURSE pg_query_srcs ${CMAKE_CURRENT_SOURCE_DIR} /src/*.c )
8
+ list (REMOVE_ITEM pg_query_srcs
9
+ "${CMAKE_CURRENT_SOURCE_DIR} /src/pg_query_fingerprint_defs.c"
10
+ "${CMAKE_CURRENT_SOURCE_DIR} /src/pg_query_fingerprint_conds.c"
11
+ "${CMAKE_CURRENT_SOURCE_DIR} /src/pg_query_json_defs.c"
12
+ "${CMAKE_CURRENT_SOURCE_DIR} /src/pg_query_json_conds.c"
13
+ "${CMAKE_CURRENT_SOURCE_DIR} /src/postgres/guc-file.c"
14
+ "${CMAKE_CURRENT_SOURCE_DIR} /src/postgres/scan.c"
15
+ "${CMAKE_CURRENT_SOURCE_DIR} /src/pg_query_json_helper.c" )
16
+
17
+ include_directories (. )
18
+ include_directories (${CMAKE_CURRENT_SOURCE_DIR} /src/postgres/include )
19
+
20
+ add_library (pg_query STATIC ${pg_query_srcs} )
21
+
22
+ set_target_properties (pg_query PROPERTIES LINKER_LANGUAGE C )
23
+ set_target_properties (pg_query PROPERTIES POSITION_INDEPENDENT_CODE ON )
You can’t perform that action at this time.
0 commit comments