-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fixes for building with clang. #140
Conversation
Hi @marsupial, we ask that all contributors sign a CLA before we can accept their changes. Once we receive a signed CLA we can have a look at merging your pull requests in. You can find the necessary info at the top of this page: http://openusd.org/docs/Contributing-to-USD.html Also, our convention is for the 'master' branch to contain only released changes and to have all new changes to go into the 'dev' branch. Could you change the base branch of your pull requests to the 'dev' branch instead? https://github.com/blog/2224-change-the-base-branch-of-a-pull-request Thank you! |
ebe3342
to
6dfd5fa
Compare
@@ -42,8 +42,14 @@ endif() | |||
_disable_warning("deprecated") | |||
_disable_warning("deprecated-declarations") | |||
|
|||
# Suppress unused typedef warnings emanating from boost. | |||
_disable_warning("unused-local-typedefs") | |||
# Suppress unused typedef warnings eminating from boost. |
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.
@marsupial: Hi, are the version checks here because -no-unused-local-typedefs was introduced in clang 3.6? If so, would this be better expressed as "... OR NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6" (and similar for the AppleClang version check)?
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.
Ah, and there's a typo that was introduced here -- it should be "emanating" not "eminating".
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 fixed the typo.
Perhaps I'm not understanding it right, but the other request seems a more confusing logic.
Instead of if (!clang || clang > 3.5)
, you'd like if (!clang || !(clang < 3.6))
?
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 what I'm really trying to get at is I think the check ought to be if (!clang || clang >= 3.6), since no-unused-local-typedefs was introduced in 3.6. The check for (clang > 3.5) allows 3.5.x to pass, which I don't think is correct.
Unfortunately, cmake doesn't provide a VERSION_GREATER_OR_EQUAL, so "NOT ... VERSION_LESS 3.6" was the most succinct alternative.
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.
Changed.
Fixes for building with clang.
…udios#140) * Fix warning on glBindTextures * Fix build break with custom install path * Fix build break on Linux with clang11
Description of Change(s)
Use constructor/destructor attributes to add to ELF's .init .fini sections.
Enable pause instruction on Intel CPU built with clang.
Only add -Wno-unused-local-typedefs if clang version is > 3.5.
Fixes Issue(s)
ARCH_CONSTRUCTOR/ARCH_DESTRUCTOR not being called when built with clang on Linux.
ArchThreadPause doing nothing built with clang.
Tons of warning related to -Wno-unused-local-typedefs not being understood.