-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fixed some issues, preventing building project on a mac machine #37
Conversation
- Set up project languages manually to prevent compiler's wrong guess - Set up current platform explicitly for mac (both Intel and Apple Silicone) - Fixed a lot of warnings, mostly with PSA crypto documentation
CMakeLists.txt
Outdated
@@ -26,6 +26,17 @@ message("module path = ${CMAKE_MODULE_PATH}") | |||
file(GLOB source "source/*.cpp" "source/*.hpp" "source/*.h") | |||
if (APPLE) | |||
set(OBJCPP "source/AppleUtilities.h" "source/AppleUtilities.mm") | |||
# Detect whether we are on an Intel or ARM Mac | |||
execute_process(COMMAND uname -m RESULT_VARIABLE result OUTPUT_VARIABLE OSX_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
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.
We should not be setting CMAKE_OSX_ARCHITECTURES. What was the error that you were getting?
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.
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.
The issue is we want to make fat binaries (ARM + x86) in a single executable so that both intel and apple silicon macOS users can run it. Setting CMAKE_OSX_ARCHITECTURES
to a single architecture prevents creating fat binaries.
Instead of $(ARCHS_STANDARD)
, you can try setting it to "x86_64;arm64"
and see if that also resolves the issue.
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, I hadn't considered the possibility of fat binaries here. I gave it a try, and it worked. At least, the build was successful and it functioned properly on x64. I haven't been able to test it on ARM, as I haven't upgraded yet.
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 the work! Please see the above comments.
Also, have a question: Shouldn't this line be under the if(APPLE) as well? |
CMake ignores it on non-Apple platforms so there's no need. |
*Was forced to fix warnings because there is a -Werror flag enabled.
I'm not certain that the fixes is complete. Although with this fixes I can now build the app, the Info.plist within it is merely a placeholder (I assume it should be changed in the build process). The application only functions correctly after manual adjustments. Can anyone assist with this issue? Though, I'm not sure if this is entirely relevant to my PR.