-
Notifications
You must be signed in to change notification settings - Fork 485
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
Revamp CMake support #1118
base: master
Are you sure you want to change the base?
Revamp CMake support #1118
Conversation
Do you think we should wait for this before making SOCI 4.1.0 release or can we leave this change until a later 4.1.x? |
Well, it would probably be nice if 4.1 had this already, but it's more of a nice-to-have. So I guess you don't have to wait for this PR to be done. Unrelated to this PR, I would appreciate if #992 made it into 4.1 though :) |
7815446
to
c8d5da6
Compare
0b83bb8
to
e1e4433
Compare
e4b2e0d
to
39b9037
Compare
I think this is now ready for the next round of review |
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.
Sorry, there are just too many changes here for me to really review them :-( I've tried, but this is simply too overwhelming. I guess we'll just have to merge it without any meaningful review, which is not ideal, but I just don't see what else to do.
However I'd like to address the following issues before the merge:
- Keep the list of the CI builds as before instead of having both the matrix and the list.
- Use non-unity builds for at least some of the CI builds. Maybe use unity for static and normal for shared or vice versa or some mix, but we want to test both.
- Avoid adding an almost empty new file for the callbacks.
Also, I think docs/installation.md
may need to be updated.
Thanks again for your work on this!
- backend: valgrind | ||
name: Valgrind | ||
- backend: odbc | ||
# There are many leak reports under Ubuntu 22.04, see #1008. |
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.
Has #1008 been solved too?
strategy: | ||
fail-fast: false | ||
matrix: | ||
lib_type: [shared, static] |
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'm still not sure about this, the problem is that we now have both matrix
and include
and it just seems confusing. Listing all of the builds in include
before seemed more clear and it also allowed us to put the longer builds first, which was quite useful in practice.
Unless we really need to do it like this, I'd rather avoid changing this.
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.
So could we fix the DLL declaration and avoid adding this file?
option(SOCI_SHARED "Enable building SOCI as a shared library" ${SHARED_DEFAULT}) | ||
option(SOCI_TESTS "Enable building SOCI test cases" ${PROJECT_IS_TOP_LEVEL}) | ||
cmake_dependent_option(SOCI_LTO "Enable link time optimizations in release builds" ON "LTO_AVAILABLE" OFF) | ||
option(SOCI_VISIBILITY "Make all functions hidden by default - this exposes only explicitly exported functions" ON) |
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.
This is not very important, but I think we could drop this option and just always use hidden visibility if it's supported because I don't see any reason to ever disable this.
@@ -7,20 +7,28 @@ | |||
|
|||
# This is a very simple example of using SOCI in a CMake-based project. | |||
|
|||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) | |||
cmake_minimum_required(VERSION 3.23...3.31 FATAL_ERROR) |
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.
Is 3.23 really needed even for the examples (which don't use FILE_SET
)?
#ifdef SOCI_GCC_WARNING_SUPPRESS | ||
SOCI_GCC_WARNING_SUPPRESS(pedantic) | ||
#endif |
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 guess I should have also asked why... I don't think the warnings these pragmas suppressed have disappeared from the MySQL headers, so why did you need to remove them?
# Install previously built SOCI library on the system | ||
sudo make install | ||
|
||
# This example simulates SOCI sources being embedded in the project dir |
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 this should be done before make install
.
-DSOCI_TESTS=ON | ||
-DCMAKE_UNITY_BUILD=ON |
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.
So non-unity builds are not tested at all any more?
Sorry but I don't think it's a good idea. I don't have much experience with the unity builds but I can easily imagine some errors that don't happen with them but do happen in normal builds. We really ought to test normal builds — and, ideally, also a unity one.
if (NOT SOCI_ORACLE) | ||
return() | ||
endif() |
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.
Why is this needed? I.e. what would change if these lines were simply not present?
Fixes #1115
Fixes #1152
Fixes #1122
Fixes #1094
Fixes #1159
Fixes #644
Fixes #1005
Fixes #1111
Fixes #1015
Fixes #929
Fixes #843
Fixes #456
Fixes #394
Fixes #208