Skip to content
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

Build doesn't work on arm64 / M1 #2234

Open
nside opened this issue Apr 3, 2021 · 0 comments
Open

Build doesn't work on arm64 / M1 #2234

nside opened this issue Apr 3, 2021 · 0 comments

Comments

@nside
Copy link
Contributor

nside commented Apr 3, 2021

I had to change the following to build on arm64

diff --git a/proj/cmake/platform_macosx.cmake b/proj/cmake/platform_macosx.cmake
index db8005ae3..fa164282f 100644
--- a/proj/cmake/platform_macosx.cmake
+++ b/proj/cmake/platform_macosx.cmake
@@ -152,7 +152,7 @@ if( NOT ( "Xcode" STREQUAL "${CMAKE_GENERATOR}" ) )
                message(STATUS "Found libtool - ${CMAKE_LIBTOOL}")
                get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
                foreach(lang ${languages})
-                       set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "${CMAKE_LIBTOOL} -static -arch_only x86_64 -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
+                       set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "${CMAKE_LIBTOOL} -static -arch_only arm64 -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
                endforeach()
        endif()
 endif()
diff --git a/src/cinder/System.cpp b/src/cinder/System.cpp
index 36bec8727..128d77b71 100644
--- a/src/cinder/System.cpp
+++ b/src/cinder/System.cpp
@@ -455,7 +455,7 @@ int System::getOsMajorVersion()
                instance()->mOSMajorVersion = [[sysVerComponents firstObject] intValue];
 #elif defined( CINDER_MAC )
                if( [[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)] ) {
-                       ShadowOSVersion version = ((ShadowOSVersion(*)(id, SEL))objc_msgSend_stret)([NSProcessInfo processInfo], @selector(operatingSystemVersion));
+                       ShadowOSVersion version = ((ShadowOSVersion(*)(id, SEL))objc_msgSend)([NSProcessInfo processInfo], @selector(operatingSystemVersion));
                        instance()->mOSMajorVersion = (int32_t)version.majorVersion;
                } else {
        #pragma clang diagnostic push
@@ -487,7 +487,7 @@ int System::getOsMinorVersion()
                instance()->mOSMinorVersion = [[sysVerComponents objectAtIndex:1] intValue];
 #elif defined( CINDER_MAC )
                if( [[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)] ) {
-                       ShadowOSVersion version = ((ShadowOSVersion(*)(id, SEL))objc_msgSend_stret)([NSProcessInfo processInfo], @selector(operatingSystemVersion));
+                       ShadowOSVersion version = ((ShadowOSVersion(*)(id, SEL))objc_msgSend)([NSProcessInfo processInfo], @selector(operatingSystemVersion));
                        instance()->mOSMinorVersion = (int32_t)version.minorVersion;
                } else {
        #pragma clang diagnostic push
@@ -522,7 +522,7 @@ int System::getOsBugFixVersion()
                        instance()->mOSBugFixVersion = 0;
 #elif defined( CINDER_MAC )
                if( [[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)] ) {
-                       ShadowOSVersion version = ((ShadowOSVersion(*)(id, SEL))objc_msgSend_stret)([NSProcessInfo processInfo], @selector(operatingSystemVersion));
+                       ShadowOSVersion version = ((ShadowOSVersion(*)(id, SEL))objc_msgSend)([NSProcessInfo processInfo], @selector(operatingSystemVersion));
                        instance()->mOSBugFixVersion = (int32_t)version.patchVersion;
                } else {
        #pragma clang diagnostic push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant