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 2121 CXXFLAGS=-std=c++17 ./configure
2222 make
2323 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
2627
2728 # test install
2829 - run : cmake -S . -B build
Original file line number Diff line number Diff line change 11build
2- /test /pqxx
Original file line number Diff line number Diff line change @@ -106,8 +106,9 @@ To get started with development:
106106git clone https://github.com/pgvector/pgvector-cpp.git
107107cd pgvector-cpp
108108createdb 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
111112```
112113
113114To 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"
21#include < cassert>
32#include < optional>
3+ #include < pgvector/pqxx.hpp>
44#include < pqxx/pqxx>
55
66void setup (pqxx::connection &conn) {
You can’t perform that action at this time.
0 commit comments