Skip to content
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

Refactor CMakeLists - separation of libraries #1767

Merged
merged 55 commits into from
Nov 27, 2022
Merged

Conversation

pawel-soja
Copy link
Contributor

@pawel-soja pawel-soja commented Nov 21, 2022

Split the libraries into separate folders and create CMakeLists for each of them.

@pawel-soja
Copy link
Contributor Author

@knro Do we care about UNITY_BUILD? I see that it has not been tested for a long time and bugs fly. I am also not convinced that UNITY_BUILD is needed with the current capabilities of compilers and multi-threading of compilation.

@pawel-soja
Copy link
Contributor Author

@knro Do we care about UNITY_BUILD? I see that it has not been tested for a long time and bugs fly. I am also not convinced that UNITY_BUILD is needed with the current capabilities of compilers and multi-threading of compilation.

@knro I repeat the question, can I remove all UNITY_BUILD?

IF (UNITY_BUILD)

@knro
Copy link
Contributor

knro commented Nov 22, 2022

Sorry, sure go ahead.

@pawel-soja pawel-soja marked this pull request as ready for review November 24, 2022 22:06
@pawel-soja pawel-soja requested a review from knro November 24, 2022 22:06
@pawel-soja pawel-soja changed the title Refactor/cmake drivers Refactor CMakeLists - separation of libraries Nov 24, 2022
@pawel-soja
Copy link
Contributor Author

pawel-soja commented Nov 25, 2022

There are 2 options for building:

OPTION(INDI_BUILD_SHARED "Build shared library" ON)
OPTION(INDI_BUILD_STATIC "Build static library" ON)

By default, they are enabled and the following libraries are created:

libindiAlignmentClient.a
libindiAlignmentDriver.so -> libindiAlignmentDriver.so.1
libindiAlignmentDriver.so.1 -> libindiAlignmentDriver.so.1.9.9
libindiAlignmentDriver.so.1.9.9

libindiclientqt.a
libindiclientqt.so -> libindiclientqt.so.1
libindiclientqt.so.1 -> libindiclientqt.so.1.9.9
libindiclientqt.so.1.9.9

libindiclient.a
libindiclient.so -> libindiclient.so.1
libindiclient.so.1 -> libindiclient.so.1.9.9
libindiclient.so.1.9.9

libindidriver.a
libindidriver.so -> libindidriver.so.1
libindidriver.so.1 -> libindidriver.so.1.9.9
libindidriver.so.1.9.9

libindilx200.so -> libindilx200.so.1
libindilx200.so.1 -> libindilx200.so.1.9.9
libindilx200.so.1.9.9

Shared libraries have been added.
The static libraries have been left with the same name as before.

For the library libindilx200 I did not add a static library so as not to obscure the name. Because static libraries can take precedence when linking.

I suggest for the future to make static libraries have static in the name for easier selection when linking.
In the Indi version 2.0.0 I will make such libraries appear by default, so that there will be time for a smooth transition in, for example, KStars.

@pawel-soja pawel-soja removed the request for review from knro November 25, 2022 00:02
@pawel-soja pawel-soja marked this pull request as draft November 25, 2022 00:02
@pawel-soja pawel-soja marked this pull request as ready for review November 25, 2022 10:32
@pawel-soja
Copy link
Contributor Author

@knro Ready for review.
In this pull request additionally downgraded version for CMakeLists to 3.13 and added Debian Buster for CI.

@pawel-soja pawel-soja requested a review from knro November 25, 2022 10:32
@knro knro added this to the 2.0.0 milestone Nov 27, 2022
@knro knro self-assigned this Nov 27, 2022
@knro knro modified the milestones: 2.0.0, 1.9.9 Nov 27, 2022
@knro knro merged commit eb7da5e into master Nov 27, 2022
@knro knro deleted the refactor/cmake-drivers branch November 27, 2022 10:19
@knro
Copy link
Contributor

knro commented Nov 30, 2022

Looks like this causes our Launchpad debian builds to fail. Can you please check? We need an urgent fix.

@pawel-soja
Copy link
Contributor Author

I think I have reproduced the problem. I'll analyze what's going on right now. Later, I will also add a package build to CI for the future.

@pawel-soja
Copy link
Contributor Author

indiclient.so never built before, when I added options to build static and shared libraries, by default the shared library is additionally built. From what I can see, other libraries in INDI Core want to link it instead of static.

@pawel-soja
Copy link
Contributor Author

Fixed: #1776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants