-
Notifications
You must be signed in to change notification settings - Fork 34
Allow turning shared library building off #758
Allow turning shared library building off #758
Conversation
In 4791f0d (Rework static/shared variants into a configure-time build-switch (tango-controls#688), 2020-05-28) the option TANGO_BUILD_SHARED was added to select a shared or static library. Internally BUILD_SHARED_LIBS was already set to the same value. Switching to BUILD_SHARED_LIBS and dropping TANGO_BUILD_SHARED allows us to replace a specialized option with the default one [1]. [1]: https://cmake.org/cmake/help/v3.18/command/add_library.html#command:add_library
It does not make sense to check if(A) ... elseif(A) ... endif() so let's change the elseif to an else.
This is confusing and legacy according to [1]: Per legacy, the else() and endif() commands admit an optional <condition> argument. If used, it must be a verbatim repeat of the argument of the opening if command. [1]: https://cmake.org/cmake/help/v3.18/command/if.html#command:if
Remove trailing whitespace and empty lines at the front and back of the files.
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.
Thanks for this change! I added one comment regarding the tests, could you please have a look?
Maybe we should have a CI job for static build on Linux? |
In af72afb (Generate static library and fix compilation definitions (tango-controls#17) (tango-controls#437), 2018-05-15) support was added for building a static library next to the dynamic one. As most users want to have only either library we use the newly introduced option BUILD_SHARED_LIBS to build either one. This also solves issues when cross-compiling where you might not have shared libraries for the target architecture.
ec13356
to
998a008
Compare
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.
LGTM.
As for the backport, I do not have any opinion here. Maybe just ask the users if they need this.
Hello,
|
@JeanLucPons CI passes, and it has a new job with static configuration, see 1.
|
Unfortunately I cannot update the compiler. The toolchain has been built by a manufacturer for a specific hardware and cannot be updated. I tried to use -DCMAKE_CXX_STANDARD=11 and the cmake ended successfully. However the make wants to build MMX although it was disabled (-DTANGO_JPEG_MMX=OFF).
|
Hi @JeanLucPons, let me clarify a few points here:
|
OK thanks. |
@JeanLucPons Will make a backport PR available. |
@JeanLucPons See #763 for the backport PR. |
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.
Looks good to me.
Thanks!
Close #740.