-
Notifications
You must be signed in to change notification settings - Fork 86
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
Macos compile errors and warnings #313
Macos compile errors and warnings #313
Conversation
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 finding these compilation issues and making a PR to fix them!
We might want to fix the C++11 warning by updating the compilation flags instead. Do you have time to update the fix? If not, I'm ok with merging the PR and fixing later.
include/occa/core/base.hpp
Outdated
@@ -65,6 +65,9 @@ namespace occa { | |||
const void *src = NULL, | |||
const occa::properties &props = occa::properties()); | |||
|
|||
#pragma clang diagnostic push |
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.
Oh, maybe we're missing the proper C++11 flags when compiling the files
-std=c++11 -stdlib=libc++
@@ -366,7 +367,14 @@ namespace occa { | |||
|
|||
int getTID() { | |||
#if (OCCA_OS & (OCCA_LINUX_OS | OCCA_MACOS_OS)) | |||
return syscall(SYS_gettid); | |||
#if OCCA_OS == OCCA_MACOS_OS & (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12) |
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.
🔥 awesome, thanks for filing + fixing this warning!
Require C++11 or greater. Use target_compile_options to suppress the following warnings: * default template arguments for a function template are a C++11 extension [-Wc++11-extensions] * unused parameter 'XXX' [-Wunused-parameter]
This reverts commit feac737.
I've removed the pragmas, and instead used target_compile_features and target_compile_options to customise warning reporting. |
Looks good, thank you for making the changes so fast! |
Description
Cmake build on macOS 10.14.6 failed with:
This has been resolved by using mach_timebase_info_data_t instead.
A number of warnings were also emitted relating to C++11 extensions, e.g.
These have been silenced using pragmas.
Two deprecated functions, AbsoluteToNanoseconds and syscall, have been factored out: