diff --git a/docs/building-the-aws-driver/BuildingAwsSdkCpp.md b/docs/building-the-aws-driver/BuildingAwsSdkCpp.md index 4754d91c2..c4e8c5a33 100644 --- a/docs/building-the-aws-driver/BuildingAwsSdkCpp.md +++ b/docs/building-the-aws-driver/BuildingAwsSdkCpp.md @@ -1,16 +1,19 @@ # Building the AWS SDK for C++ The driver supports AWS IAM and AWS Secrets Manager authentication by using [AWS SDK for C++](https://docs.aws.amazon.com/sdk-for-cpp/). The driver requires `aws-cpp-sdk-core`, `aws-cpp-sdk-rds`, and `aws-cpp-sdk-secretsmanager`. You can either build the SDK yourself directly from the source using the script under `scripts` folder or [download the libraries using a package manager](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/sdk-from-pm.html). The script will install the SDK under `aws_sdk/install` folder. The driver will look for SDK dependencies through `aws_sdk/install` folder and `CMAKE_PREFIX_PATH` environment variable. -> **_NOTE:_** On Winodws, depending on the use case, you may build the SDK as a static library or dynamic library. On Linux and macOS, you should always build the SDK as a dynamic library. +> **_NOTE:_** On Windows, depending on the use case, you may build the SDK as a static library or dynamic library. On Linux and macOS, you should always build the SDK as a dynamic library. ## Windows -If you want to build and run the driver unit tests, you need to build the SDK as static library, as the unit test binary will link every dependency statically. +### For release version unit tests or driver ``` -.\scripts\build_aws_sdk_win.ps1 x64 Debug OFF "Visual Studio 16 2019" +.\scripts\build_aws_sdk_win.ps1 x64 Release ON "Visual Studio 16 2019" ``` -If you want to build the driver DLL, you need to build the SDK as dynamic library, as the driver DLL will link the SDK dynamically. +### For debug version unit tests ``` -.\scripts\build_aws_sdk_win.ps1 x64 Release ON "Visual Studio 16 2019" +.\scripts\build_aws_sdk_win.ps1 x64 Debug ON "Visual Studio 16 2019" ``` +Note: +- Use ```Visual Studio 17 2022`` for Visual Studio 2022. + ## Linux/macOS ``` ./scripts/build_aws_sdk_unix.sh Release diff --git a/docs/testing-the-aws-driver/TestingTheAwsDriver.md b/docs/testing-the-aws-driver/TestingTheAwsDriver.md index acc407727..17caa4b69 100644 --- a/docs/testing-the-aws-driver/TestingTheAwsDriver.md +++ b/docs/testing-the-aws-driver/TestingTheAwsDriver.md @@ -2,16 +2,33 @@ ## Unit Tests 1. Build driver binaries with `ENABLE_UNIT_TESTS` command set to `TRUE`: - **Windows** + + Add AWS SDK dynamic libraries path to environment variable `path` so the dlls could be found when unit tests are running. + + - For release version unit tests, run the following command from repository root ``` cmake -S . -B build -G "Visual Studio 16 2019" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.0" -DMYSQLCLIENT_STATIC_LINKING=TRUE -DENABLE_UNIT_TESTS=TRUE cmake --build build --config Release ``` + - For debug version unit tests + + - Download MySQL debug binaries from [MySQL::Download MySQL Community Server](https://dev.mysql.com/downloads/mysql/). + + - Extract the `mysqlclient.lib` from debug binaries. Make sure to backup your release version of mysqlclient.lib in `MYSQL_DIR\lib`, e.g. `C:\Program Files\MySQL\MySQL Server 8.0\lib`. Replace release version `mysqlclient.lib` with debug version of `mysqlclient.lib`. + - Run the following command from repository root + + ``` + cmake -S . -B build -G "Visual Studio 16 2019" -DMYSQL_DIR="C:\Program Files\MySQL\MySQL Server 8.0" -DMYSQLCLIENT_STATIC_LINKING=TRUE -DENABLE_UNIT_TESTS=TRUE -DCMAKE_BUILD_TYPE=Debug + cmake --build build --config Debug + ``` - **MacOS** + - Run the following command from repository root ``` cmake -S . -B build -G "Unix Makefiles" -DMYSQLCLIENT_STATIC_LINKING=true -DODBC_INCLUDES=/usr/local/Cellar/libiodbc/3.52.15/include -DENABLE_UNIT_TESTS=TRUE cmake --build build --config Release ``` - **Linux** + - Run the following command from repository root ``` cmake -S . -B build -G "Unix Makefiles" -DMYSQLCLIENT_STATIC_LINKING=true -DWITH_UNIXODBC=1 -DENABLE_UNIT_TESTS=TRUE cmake --build build --config Release