diff --git a/.github/workflows/brew.sh b/.github/workflows/brew.sh index c0f9188..2c7376f 100644 --- a/.github/workflows/brew.sh +++ b/.github/workflows/brew.sh @@ -11,5 +11,5 @@ check_and_install() { } # Install packages if they don't exist -check_and_install postgresql # Check and install PostgreSQL +check_and_install postgresql # Check and install PostgreSQL (which includes libpq) check_and_install pkg-config # Check and install pkg-config \ No newline at end of file diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index af7fa68..822e713 100644 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -11,15 +11,13 @@ cd ./external/libpqxx mkdir -p build cd ./build -# Generate build system files using CMake -# '..' points to the libpqxx root directory containing CMakeLists.txt -cmake .. +# Expose paths so CMake finds libpq +export PATH="$(brew --prefix libpq)/bin:$PATH" +export PKG_CONFIG_PATH="$(brew --prefix libpq)/lib/pkgconfig:$PKG_CONFIG_PATH" +export PostgreSQL_ROOT="$(brew --prefix libpq)" -# Configure the build with specific C++ compiler flags: -# -std=c++20: Use C++20 standard -# -O3: Enable maximum optimization -# --enable-silent-rules: Reduce build output verbosity -./configure CXXFLAGS="-std=c++20 -O3" --enable-silent-rules +# 1. Generate build files (Passing your CXX flags directly to CMake instead of configure) +cmake .. -DCMAKE_CXX_STANDARD=20 -DCMAKE_BUILD_TYPE=Release -# Compile libpqxx using generated build files +# 2. Compile libpqxx make \ No newline at end of file diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index f5255b7..6897994 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -62,7 +62,7 @@ jobs: -derivedDataPath "${RUNNER_TEMP}/Build/DerivedData" HEADER_SEARCH_PATHS="./external/libpqxx/include/pqxx/internal ./external/libpqxx/include/ ./external/libpqxx/build/include/ ./external/" LIBRARY_SEARCH_PATHS="./external/libpqxx/src/ ./external/libpqxx/build/src/" - OTHER_LDFLAGS="-L./external/libpqxx/build/src -lpqxx -lpq -L/opt/homebrew/Cellar/pkgconf/2.3.0_1/lib -L/opt/homebrew/Cellar/pkgconf/2.3.0_1/lib/pkgconfig -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14 -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14/pgxs -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14/pkgconfig" + OTHER_LDFLAGS="-L./external/libpqxx/build/src -lpqxx -lpq -L$(brew --prefix pkgconf)/lib -L$(brew --prefix pkgconf)/lib/pkgconfig -L$(brew --prefix postgresql@18)/lib/postgresql -L$(brew --prefix postgresql@18)/lib/postgresql/pgxs -L$(brew --prefix postgresql@18)/lib/postgresql/pkgconfig" clean build test | xcpretty -r junit && exit ${PIPESTATUS[0]} - name: Convert coverage report to sonarqube format diff --git a/.gitignore b/.gitignore index 3846e40..797a47b 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,5 @@ TestResult xcuserdata/ xcuserstate/ TestResult.xcresult/ -sonarqube-generic-coverage.xml \ No newline at end of file +sonarqube-generic-coverage.xml +external/libpqxx \ No newline at end of file diff --git a/backtesting-engine-cpp.xcodeproj/project.pbxproj b/backtesting-engine-cpp.xcodeproj/project.pbxproj index 7a04891..e6f732a 100644 --- a/backtesting-engine-cpp.xcodeproj/project.pbxproj +++ b/backtesting-engine-cpp.xcodeproj/project.pbxproj @@ -3785,9 +3785,8 @@ ); INCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = ""; LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/external/libpqxx/src\"", - "$(SRCROOT)/build/external/libpqxx/src", - "/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14", + "\"$(SRCROOT)/external/libpqxx/build/src\"", + "/opt/homebrew/Cellar/postgresql@18/18.3/lib/postgresql", ); OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; @@ -3808,9 +3807,8 @@ ); INCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = ""; LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/external/libpqxx/src\"", - "$(SRCROOT)/build/external/libpqxx/src", - "/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14", + "\"$(SRCROOT)/external/libpqxx/build/src\"", + "/opt/homebrew/Cellar/postgresql@18/18.3/lib/postgresql", ); OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; @@ -3831,9 +3829,8 @@ "\"$(SRCROOT)/external/", ); LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/external/libpqxx/src\"", - "$(PROJECT_DIR)/build/external/libpqxx/src", - "/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14", + "\"$(SRCROOT)/external/libpqxx/build/src\"", + "/opt/homebrew/Cellar/postgresql@18/18.3/lib/postgresql", ); MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.mccaffers.tests; @@ -3854,9 +3851,8 @@ "\"$(SRCROOT)/external/", ); LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/external/libpqxx/src\"", - "$(PROJECT_DIR)/build/external/libpqxx/src", - "/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14", + "\"$(SRCROOT)/external/libpqxx/build/src\"", + "/opt/homebrew/Cellar/postgresql@18/18.3/lib/postgresql", ); MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.mccaffers.tests; diff --git a/backtesting-engine-cpp.xcodeproj/xcshareddata/xcschemes/source.xcscheme b/backtesting-engine-cpp.xcodeproj/xcshareddata/xcschemes/source.xcscheme index 758b0f2..4b7e568 100644 --- a/backtesting-engine-cpp.xcodeproj/xcshareddata/xcschemes/source.xcscheme +++ b/backtesting-engine-cpp.xcodeproj/xcshareddata/xcschemes/source.xcscheme @@ -58,7 +58,7 @@