File tree Expand file tree Collapse file tree 5 files changed +25
-6
lines changed Expand file tree Collapse file tree 5 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 21
21
CXXFLAGS=-std=c++17 ./configure
22
22
make
23
23
sudo make install
24
- - run : g++ -std=c++17 -Wall -Wextra -Werror -o test/pqxx test/pqxx_test.cpp -lpqxx -lpq
25
- - run : test/pqxx
24
+ - run : cmake -S test -B test/build
25
+ - run : cmake --build test/build
26
+ - run : test/build/pqxx_test
26
27
27
28
# test install
28
29
- run : cmake -S . -B build
Original file line number Diff line number Diff line change 1
1
build
2
- /test /pqxx
Original file line number Diff line number Diff line change @@ -106,8 +106,9 @@ To get started with development:
106
106
git clone https://github.com/pgvector/pgvector-cpp.git
107
107
cd pgvector-cpp
108
108
createdb pgvector_cpp_test
109
- g++ -std=c++17 -Wall -Wextra -Wno-unknown-attributes -Werror -o test/pqxx test/pqxx_test.cpp -lpqxx -lpq
110
- test/pqxx
109
+ cmake -S test -B test/build
110
+ cmake --build test/build
111
+ test/build/pqxx_test
111
112
```
112
113
113
114
To run an example:
Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.18 )
2
+
3
+ project (test )
4
+
5
+ set (CMAKE_CXX_STANDARD 17 )
6
+
7
+ set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unknown-attributes -Werror" )
8
+ set (SKIP_BUILD_TEST ON )
9
+
10
+ include (FetchContent )
11
+
12
+ FetchContent_Declare (libpqxx GIT_REPOSITORY https://github.com/jtv/libpqxx.git GIT_TAG 7.10.0 )
13
+ FetchContent_MakeAvailable (libpqxx )
14
+
15
+ add_subdirectory ("${PROJECT_SOURCE_DIR} /.." pgvector )
16
+
17
+ add_executable (pqxx_test pqxx_test.cpp )
18
+ target_link_libraries (pqxx_test PRIVATE libpqxx::pqxx pgvector::pgvector )
Original file line number Diff line number Diff line change 1
- #include " ../include/pgvector/pqxx.hpp"
2
1
#include < cassert>
3
2
#include < optional>
3
+ #include < pgvector/pqxx.hpp>
4
4
#include < pqxx/pqxx>
5
5
6
6
void setup (pqxx::connection &conn) {
You can’t perform that action at this time.
0 commit comments