macOS build fails
Closed this issue · 2 comments
bsekura commented
I'm having trouble building master version on macOS. Below, please find build console output with details.
macOS Big Sur 11.0.1 x64
Xcode: Version 12.2 (12B45b)
cmake: 3.19.0 (installed with brew)
rust: stable-x86_64-apple-darwin unchanged - rustc 1.48.0 (7eac88abb 2020-11-16)
NOTE: building glfw itself from C sources works fine.
build log:
~/d/r/glfw-sys ❯❯❯ cargo build
Compiling cc v1.0.63
Compiling cmake v0.1.45
Compiling glfw-sys v3.3.2 (/Users/****/dev/rust/glfw-sys)
error: failed to run custom build command for `glfw-sys v3.3.2 (/Users/****/dev/rust/glfw-sys)`
Caused by:
process didn't exit successfully: `/Users/****/dev/rust/glfw-sys/target/debug/build/glfw-sys-20233538ca53220e/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/Users/****/dev/rust/glfw-sys/." "-DGLFW_BUILD_EXAMPLES=OFF" "-DGLFW_BUILD_TESTS=OFF" "-DGLFW_BUILD_DOCS=OFF" "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_PREFIX=/Users/****/dev/rust/glfw-sys/target/debug/build/glfw-sys-6dba737d4383ecf4/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Using Cocoa for window creation
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/****/dev/rust/glfw-sys/target/debug/build/glfw-sys-6dba737d4383ecf4/out/build
running: "cmake" "--build" "." "--target" "install" "--config" "Debug" "--"
Scanning dependencies of target glfw
[ 18%] Building C object src/CMakeFiles/glfw.dir/input.c.o
[ 18%] Building C object src/CMakeFiles/glfw.dir/context.c.o
[ 18%] Building C object src/CMakeFiles/glfw.dir/init.c.o
[ 31%] Building C object src/CMakeFiles/glfw.dir/monitor.c.o
[ 31%] Building C object src/CMakeFiles/glfw.dir/vulkan.c.o
[ 37%] Building C object src/CMakeFiles/glfw.dir/window.c.o
[ 43%] Building C object src/CMakeFiles/glfw.dir/cocoa_init.m.o
[ 50%] Building C object src/CMakeFiles/glfw.dir/cocoa_joystick.m.o
[ 56%] Building C object src/CMakeFiles/glfw.dir/cocoa_window.m.o
[ 68%] Building C object src/CMakeFiles/glfw.dir/cocoa_monitor.m.o
[ 68%] Building C object src/CMakeFiles/glfw.dir/cocoa_time.c.o
[ 75%] Building C object src/CMakeFiles/glfw.dir/posix_thread.c.o
[ 87%] Building C object src/CMakeFiles/glfw.dir/nsgl_context.m.o
[ 87%] Building C object src/CMakeFiles/glfw.dir/egl_context.c.o
[ 93%] Building C object src/CMakeFiles/glfw.dir/osmesa_context.c.o
--- stderr
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_ASM_COMPILER
CMAKE_ASM_FLAGS
CMAKE_CXX_COMPILER
CMAKE_CXX_FLAGS
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:36:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:50:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:81:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:115:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:79:5: error: use of undeclared identifier 'NSString'; did you mean 'cString'?
NSString* appName = nil;
^~~~~~~~
cString
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/OpenScripting.framework/Headers/ASRegistry.h:212:3: note: 'cString' declared here
cString = cStringClass /* old name for cStringClass - can't be used in .r files*/
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:36:8: error: unknown type name 'NSUInteger'
static NSUInteger getStyleMask(_GLFWwindow* window)
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:219:10: error: use of undeclared identifier 'NSScreen'
for (NSScreen* screen in [NSScreen screens])
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:79:15: error: use of undeclared identifier 'appName'; did you mean 'pName'?
NSString* appName = nil;
^~~~~~~
pName
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:219:20: error: use of undeclared identifier 'screen'; did you mean 'strlen'?
for (NSScreen* screen in [NSScreen screens])
^~~~~~
strlen
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h:478:3/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/string.h::82 :note9: : 'pName' declared herenote
: 'strlen' declared here
size_t strlen(const char *__s);
^
pName = 'pnam' /* 0x706e616d */
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:219:48: error: expected ';' in 'for' statement specifier
for (NSScreen* screen in [NSScreen screens])
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:79:23: error: expression is not assignable
NSString* appName = nil;
~~~~~~~~~~~~~~~~~ ^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:38:5: error: use of undeclared identifier 'NSUInteger'
NSUInteger styleMask = NSWindowStyleMaskMiniaturizable;
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:80:5: error: use of undeclared identifier 'NSDictionary'; did you mean 'UseDictionary'?
NSDictionary* bundleInfo = [[NSBundle mainBundle] infoDictionary];
^~~~~~~~~~~~
UseDictionary
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:41:9: error: use of undeclared identifier 'styleMask'
styleMask |= NSWindowStyleMaskBorderless;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h:1504:1: note: 'UseDictionary' declared here
UseDictionary(
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:80:5: warning: 'UseDictionary' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
NSDictionary* bundleInfo = [[NSBundle mainBundle] infoDictionary];
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h:1504:1: note: 'UseDictionary' has been explicitly marked deprecated here
UseDictionary(
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:221:9: error: use of undeclared identifier 'NSNumber'
NSNumber* displayID = [screen deviceDescription][@"NSScreenNumber"];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:221:19: error: use of undeclared identifier 'displayID'
NSNumber* displayID = [screen deviceDescription][@"NSScreenNumber"];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:221:31: error: expected expression
NSNumber* displayID = [screen deviceDescription][@"NSScreenNumber"];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:226:59: error: expected expression
if (monitor->ns.unitNumber == CGDisplayUnitNumber([displayID unsignedIntValue]))
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:80:19: error: use of undeclared identifier 'bundleInfo'
NSDictionary* bundleInfo = [[NSBundle mainBundle] infoDictionary];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:80:32: error: expected expression
NSDictionary* bundleInfo = [[NSBundle mainBundle] infoDictionary];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:228:34: error: use of undeclared identifier 'screen'; did you mean 'strlen'?
monitor->ns.screen = screen;
^~~~~~
strlen
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/string.h:82:9: note: 'strlen' declared here
size_t strlen(const char *__s);
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:443:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:458:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:478:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:499:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:539:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:550:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/cocoa_monitor.m:579:5: error: expected expression
@autoreleasepool {
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:81:5: error: use of undeclared identifier 'NSString'; did you mean 'cString'?
NSString* nameKeys[] =
^~~~~~~~
cString
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/OpenScripting.framework/Headers/ASRegistry.h:212:3: note: 'cString' declared here
cString = cStringClass /* old name for cStringClass - can't be used in .r files*/
^
15 errors generated.
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:81:24: error: expected expression
NSString* nameKeys[] =
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:81:15: error: use of undeclared identifier 'nameKeys'
NSString* nameKeys[] =
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:82:5: error: expected expression
{
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:90:29: error: use of undeclared identifier 'nameKeys'
for (i = 0; i < sizeof(nameKeys) / sizeof(nameKeys[0]); i++)
^
make[2]: *** [src/CMakeFiles/glfw.dir/cocoa_monitor.m.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:205:5: error: use of undeclared identifier 'NSOpenGLPixelFormatAttribute'
NSOpenGLPixelFormatAttribute attribs[40];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:90:48: error: use of undeclared identifier 'nameKeys'
for (i = 0; i < sizeof(nameKeys) / sizeof(nameKeys[0]); i++)
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:208:5: error: use of undeclared identifier 'attribs'
addAttrib(NSOpenGLPFAAccelerated);
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:200:36: note: expanded from macro 'addAttrib'
assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:208:5: error: use of undeclared identifier 'attribs'
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:200:54: note: expanded from macro 'addAttrib'
assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:208:5: error: use of undeclared identifier 'attribs'
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:201:5: note: expanded from macro 'addAttrib'
attribs[index++] = a; \
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:92:30: error: use of undeclared identifier 'nameKeys'
id name = bundleInfo[nameKeys[i]];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:92:19: error: use of undeclared identifier 'bundleInfo'
id name = bundleInfo[nameKeys[i]];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:94:13: error: expected expression
[name isKindOfClass:[NSString class]] &&
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:97:13: error: use of undeclared identifier 'appName'
appName = name;
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:41:22: error: use of undeclared identifier 'NSWindowStyleMaskBorderless'
styleMask |= NSWindowStyleMaskBorderless;
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:102:10: error: use of undeclared identifier 'appName'; did you mean 'pName'?
if (!appName)
^~~~~~~
pName
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h:478:3: note: 'pName' declared here
pName = 'pnam' /* 0x706e616d */
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:106:13: error: use of undeclared identifier 'appName'
appName = @(*progname);
^
/Users/****/dev/rust/glfw-sys/src/cocoa_init.m:106:23: error: expected expression
appName = @(*progname);
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:44:9: error: use of undeclared identifier 'styleMask'
styleMask |= NSWindowStyleMaskTitled |
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make[2]: *** [src/CMakeFiles/glfw.dir/cocoa_init.m.o] Error 1
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:208:15: error: use of undeclared identifier 'NSOpenGLPFAAccelerated'
addAttrib(NSOpenGLPFAAccelerated);
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:209:5: error: use of undeclared identifier 'attribs'
addAttrib(NSOpenGLPFAClosestPolicy);
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:200:36: note: expanded from macro 'addAttrib'
assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:209:5: error: use of undeclared identifier 'attribs'
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:200:54: note: expanded from macro 'addAttrib'
assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:209:5: error: use of undeclared identifier 'attribs'
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:201:5: note: expanded from macro 'addAttrib'
attribs[index++] = a; \
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:209:15: error: use of undeclared identifier 'NSOpenGLPFAClosestPolicy'
addAttrib(NSOpenGLPFAClosestPolicy);
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:213:9: error: use of undeclared identifier 'attribs'
addAttrib(NSOpenGLPFAAllowOfflineRenderers);
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:200:36: note: expanded from macro 'addAttrib'
assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:213:9: error: use of undeclared identifier 'attribs'
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:200:54: note: expanded from macro 'addAttrib'
assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:213:9: error: use of undeclared identifier 'attribs'
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:201:/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:44:22: error5: note: expanded from macro 'addAttrib'
: attribs[index++] = a; \use of undeclared identifier 'NSWindowStyleMaskTitled'
^
styleMask |= NSWindowStyleMaskTitled |
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:45:22: error: use of undeclared identifier 'NSWindowStyleMaskClosable'
NSWindowStyleMaskClosable;
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:48:13: error: use of undeclared identifier 'styleMask'
styleMask |= NSWindowStyleMaskResizable;
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:213:19: error: use of undeclared identifier 'NSOpenGLPFAAllowOfflineRenderers'
addAttrib(NSOpenGLPFAAllowOfflineRenderers);
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:218:9: error: use of undeclared identifier 'attribs'
addAttrib(kCGLPFASupportsAutomaticGraphicsSwitching);
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:200:36: note: expanded from macro 'addAttrib'
assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:48:26: error: use of undeclared identifier 'NSWindowStyleMaskResizable'
styleMask |= NSWindowStyleMaskResizable;
^
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:218:9: error: use of undeclared identifier 'attribs'
/Users/****/dev/rust/glfw-sys/src/nsgl_context.m:200:54: note: expanded from macro 'addAttrib'
assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:51:12: error: use of undeclared identifier 'styleMask'
return styleMask;
^
20 errors generated.
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:58:11: error: unknown type name 'NSPoint'; did you mean 'NXPoint'?
const NSPoint pos = [window->ns.object mouseLocationOutsideOfEventStream];
^~~~~~~
NXPoint
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h:69:3: note: 'NXPoint' declared here
} NXPoint;
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:58:25: error: expected expression
const NSPoint pos = [window->ns.object mouseLocationOutsideOfEventStream];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:59:12: error: expected expression
return [window->ns.view mouse:pos inRect:[window->ns.view frame]];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:68:9: error: expected expression
[NSCursor hide];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:79:9: error: expected expression
[NSCursor unhide];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:93:13: error: expected expression
[(NSCursor*) window->cursor->ns.object set];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:95:13: error: expected expression
[[NSCursor arrowCursor] set];
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:133:11: error: unknown type name 'NSRect'
const NSRect frame = NSMakeRect(bounds.origin.x,
^
/Users/****/dev/rust/glfw-sys/src/cocoa_window.m:133:26: error: implicit declaration of function 'NSMakeRect' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
const NSRect frame = NSMakeRect(bounds.origin.x,
^
make[2]: *** [src/CMakeFiles/glfw.dir/nsgl_context.m.o] Error 1
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/CMakeFiles/glfw.dir/cocoa_window.m.o] Error 1
make[1]: *** [src/CMakeFiles/glfw.dir/all] Error 2
make: *** [all] Error 2
thread 'main' panicked at '
command did not execute successfully, got: exit code: 2
build script failed, must exit now', /Users/****/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
bsekura commented
Closing, as cmake update seems to have fixed the issue.
igorjakus commented
what was wrong with cmake? i'm having simillar issue