Fix static build issues and allow user to choose which library do they want#18
Open
makise-homura wants to merge 3 commits intomartijnberger:masterfrom
Open
Fix static build issues and allow user to choose which library do they want#18makise-homura wants to merge 3 commits intomartijnberger:masterfrom
makise-homura wants to merge 3 commits intomartijnberger:masterfrom
Conversation
…specified in global BUILD_SHARED_LIBS
…none specified, rely on global BUILD_SHARED_LIBS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CMake does have a global
BUILD_SHARED_LIBSvariable which affects howadd_library()works. E.g., whenBUILD_SHARED_LIBS=ON(as it is usually on Windows, where you often link with shared Qt), there was no way to build clew statically, even ifBUILD_SHARED_LIBRARYis set toOFF(which should lead to building a static library, according to documentation).So, I did a fix that makes clew build like that:
BUILD_SHARED_LIBRARYorBUILD_STATIC_LIBRARYis set toON, this overrides globalBUILD_SHARED_LIBSand allows clew to be built either shared or static, regardless ofBUILD_SHARED_LIBS;OFF(this is now the default),BUILD_SHARED_LIBSis used to determine which type of library does user want;BUILD_SHARED_LIBRARYandBUILD_STATIC_LIBRARYtoONis treated as error.And also I removed this annoying "exported" message while building a shared library on WIN32, otherwise it really does not look like a warningless build.