Change libomqwt to shared library. #11103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts changes made in Build qwt as a static library. #9939 and Fix Windows CMake build. #9956.
It should be a shared library (a DLL on Windows at least) because it is used by both
libOMPlotLib.dll
andOMNoteBook.exe
. However,OMNoteBook.exe
links tolibOMPlotLib.dll
as well. CMake will add bothlibOMPlotLib.dll
andlibomqwt.a
to the linking commandline ofOMNoteBook.exe
and that causes duplicates on some configurations (e.g. usingclang
onOMDev
. Curiously the issue does not occur withgcc
onOMDev
).Another way to fix this problem would be to make the linking by
libOMPlotLib.dll
to staticlibomqwt.a
a PRIVATE link (in CMake terms.) However, that will require us to manually add the definitions and include directives needed to uselibomqwt.a
byOMNoteBook.exe
(think of it likeOMNoteBook.exe
uses bothlibOMPlotLib.dll
andlibomqwt.a
, not justlibOMPlotLib.dll
). So the most logical and straightforward fix is to makelibomqwt
a shared lib.