-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nanodbc] Allow specifing the ODBC version for nanodbc #17974
[nanodbc] Allow specifing the ODBC version for nanodbc #17974
Conversation
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS | ||
-DNANODBC_DISABLE_EXAMPLES=ON | ||
-DNANODBC_DISABLE_TESTS=ON | ||
-DNANODBC_ENABLE_UNICODE=OFF | ||
${NANODBC_ODBC_VERSION} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't pass this in directly as an option because nanodbc's cmake file only checks to see if NANODBC_ODBC_VERSION
is defined -- unlike an option which can be either ON/OFF. See: https://github.com/nanodbc/nanodbc/blob/master/CMakeLists.txt#L78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the value of NANODBC_ODBC_VERSION is passed on to the compilation:
And how is it specified for building port nanodbc? Would I need to modify the triplet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my original comment wasn't clear enough. Yes, it is passed to the compilation, but I'm talking about embedding the option directly, i.e.
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DNANODBC_DISABLE_EXAMPLES=ON
-DNANODBC_DISABLE_TESTS=ON
-DNANODBC_ENABLE_UNICODE=OFF
-DNANODBC_ODBC_VERSION=${NANODBC_ODBC_VERSION}
)
I made this comment to make it clear I intentionally didn't do it this way.
As for your second question, that's correct, you could add a line to the triplet file, and that's what I did on my machine (another work-around without adding this patch would be setting the flag as part of VCPKG_CXX_FLAGS
but this patch is more appropriate IMO).
Depends on #17983. |
This patch adds the option to specify an ODBC version directly to the nanodbc library, which up to this point has been looking for ODBC versions itself (see here). It only passes in the
NANODBC_ODBC_VERSION
option to nanodbc's cmake script if this flag has been set by the user.What does your PR fix?
See the following comment on what this PR is fixing: SQL_OV_ODBC3_80 issue on Ubuntu 16.04 with unixODBC 2.3.1 nanodbc/nanodbc#114 (comment)
I experienced this issue on a CentOS box with unixODBC 2.3.1. In summary: unixODBC 2.3.1 reports an incorrect ODBC version which nanodbc picks up, but should be overridden with the version passed in through
NANODBC_ODBC_VERSION
.Which triplets are supported/not supported? Have you updated the CI baseline?
Not sure I need to update the baseline file; please let me know if I do.
Does your PR follow the maintainer guide?
Yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?Yes