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

OSX 10.10 (preview) support #691

Closed
ghost opened this issue Aug 26, 2014 · 30 comments
Closed

OSX 10.10 (preview) support #691

ghost opened this issue Aug 26, 2014 · 30 comments

Comments

@ghost
Copy link

ghost commented Aug 26, 2014

Hey,

I'm trying to compile SFML (master) on a OS X 10.10 (Preview) iMac. CMake interrupts the process with the following message:

CMake Error at cmake/Config.cmake:58 (message): Unsupported version of OS X: 10.10

I'm not planning to use XCode 6 (Preview), but XCode 5 as already supported. It would be great if you guys enable support for OS X 10.10, since I can use SFML 2.1 (stable) with no problems on it.

The idea here is that I can compile it and help you with bug reports too.

Let me know if you need further info.

Thanks,
Hiram

@ghost
Copy link
Author

ghost commented Aug 26, 2014

BTW, I could try to "by pass" this check on Config.cmake file, but I think that OS X 10.10 is about to be released, and would be great to test it in advance.

@MarioLiebisch
Copy link
Member

That's a CMake issue and not really something anyone here can change (other than submitting a patch to CMake).

@mantognini
Copy link
Member

Yep, as @MarioLiebisch said, this is a Cmake-related issue. We can do nothing about it. Maybe try with a nightly build version of Cmake, they might have already fixed that..

SFML is planned, of course, to support 10.10 but I don't have access to any beta version so I can't help much before it's officially released. But if you spot something, drop us a line on the forum (preferably).

@LaurentGomila
Copy link
Member

Why do you guys say that it's a CMake issue? This error is triggered by SFML. And by the way, it shouldn't, because the condition for it is "if minor version is less than 7".

@texus
Copy link
Contributor

texus commented Aug 26, 2014

Isn't the problem just with the regex on line 56 of that file?
I could be wrong but it looks like it would only find the first number and puts a 1 instead of a 10 in the version variable.

@ghost
Copy link
Author

ghost commented Aug 26, 2014

@LaurentGomila, yeah. I think the minor version could be upgraded to, at least, 9 (10.9) which is the OS X current stable.

@MarioLiebisch, AFAK, Config.cmake is created/generated/maintained by the SFML developers. Am I wrong? I'm not very familiar with CMake yet, I don't know how their files are generated. I think the issue should be re-opened.

@ghost
Copy link
Author

ghost commented Aug 26, 2014

@texus, I recently tried to "by pass" that condition, but there was still other issues. I can't test that again right now, but would be a start changing the regex or bypassing it to see what happens.

@mantognini
Copy link
Member

Oupsi! 😊

You guys are probably right. The regex should be updated indeed!

@ghost
Copy link
Author

ghost commented Aug 26, 2014

NP! I wish I had to time to update the code myself and submit a pull
request, but I'm too busy making a GDD and a prototype of a game for a
competion that will begin in a few days. Anyway, let me know if I can help
with anything else.

2014-08-26 9:50 GMT-03:00 Marco Antognini notifications@github.com:

Oupsi! [image: 😊]

You guys are probably right. The regex should be updated indeed!


Reply to this email directly or view it on GitHub
#691 (comment).

@mantognini
Copy link
Member

Try replacing line 56 of cmake/Config.cmake with:

STRING(REGEX REPLACE "10\\.([0-9]+).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")

(Basically, this add a +.)

@ghost
Copy link
Author

ghost commented Aug 26, 2014

Worked like a charm @mantognini. Actually, the changes I made myself last week caused other problems, but must be something I did wrong. IMO, this could be validated by you guys and merged to the master. Thank you.

@MarioLiebisch
Copy link
Member

Meh, filename confused me. :)

@ghost
Copy link
Author

ghost commented Aug 26, 2014

BTW, while executing "make":

[ 47%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/OSX/WindowImplCocoa.mm.o
/Users/hiram/Development/SFML/src/SFML/Window/OSX/WindowImplCocoa.mm:228:32: error: 
      cannot initialize a parameter of type 'id<NSFileManagerDelegate>' with an
      rvalue of type 'SFApplicationDelegate *'
  ...[NSApp setDelegate:[[[SFApplicationDelegate alloc] init] autorelease]];
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/objc/NSObject.h:38:1: note: instance method 'autorelease' is
      assumed to return an instance of its receiver type ('SFApplicationDelegate
      *')
- (instancetype)autorelease OBJC_ARC_UNAVAILABLE;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:109:47: note: 
      passing argument to parameter 'delegate' here
@property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5, 2_0);
                                              ^
1 error generated.
make[2]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/OSX/WindowImplCocoa.mm.o] Error 1
make[1]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/all] Error 2
make: *** [all] Error 2

But nothing to do with the Config.cmake. I may open another issue later. Thanks

@LaurentGomila
Copy link
Member

@ghost
Copy link
Author

ghost commented Aug 26, 2014

Simple and Fast Development Team. :-) I appreaciate your quick response. I'll stop just demanding "quick fixes" and try to contribute more pragmatically to SFML. Keep up the great work!

@mantognini
Copy link
Member

@LaurentGomila, yes that's the same line but I'm really confused.. I don't understand what's about this NSFileManagerDelegate here.. It's supposed to be NSApplicationDelegate. Or did they change something in 10.10 regarding application delegate?

@hiramgeeks can you try to apply the fix mentioned on the Laurent's link and tell me if it change something at all.

@ghost
Copy link
Author

ghost commented Aug 26, 2014

Yeah, I let you know soon.

@ghost
Copy link
Author

ghost commented Aug 26, 2014

Actually, just replacing the line 228 (former 219) doesn't solve the problem:

[ 15%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/OSX/WindowImplCocoa.mm.o
/Users/hiram/Development/SFML/src/SFML/Window/OSX/WindowImplCocoa.mm:228:32: error: 
      cannot initialize a parameter of type 'id<NSFileManagerDelegate>' with an
      rvalue of type 'SFApplicationDelegate *'
            [NSApp setDelegate:[[SFApplicationDelegate alloc] init]];
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/objc/NSObject.h:60:1: note: instance method 'init' is assumed to
      return an instance of its receiver type ('SFApplicationDelegate *')
- (instancetype)init;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:109:47: note: 
      passing argument to parameter 'delegate' here
@property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5, 2_0);
                                              ^
1 error generated.
make[2]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/OSX/WindowImplCocoa.mm.o] Error 1
make[1]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/all] Error 2
make: *** [all] Error 2

@ghost
Copy link
Author

ghost commented Aug 26, 2014

@mantognini couldn't it just return an (id) on init instead of (instancetype)?

@LaurentGomila
Copy link
Member

After a bit of Googling, it seems to be a known issue when porting to OS X 10.10. Maybe we can find the clean solution by searching a little more.

@LaurentGomila
Copy link
Member

Apparently, it would be enough to replace NSApp with [NSApplication sharedApplication] in this line.

@ghost
Copy link
Author

ghost commented Aug 26, 2014

Let me give it a try

@ghost
Copy link
Author

ghost commented Aug 26, 2014

Yeah, it was enough! Everything compiled now.

@ghost
Copy link
Author

ghost commented Aug 26, 2014

A popular saying here in Brazil: "we killed two rabbits with a single hit". Two issues resolved.

@ghost
Copy link
Author

ghost commented Aug 26, 2014

@LaurentGomila, would it be convenient if I submit a pull request for those issues or you can change that on your side?

@mantognini
Copy link
Member

That was an interesting bug that they introduced there. ^^'

Anyway, I have other modifications to the same file so I'll apply that one too. The fix won't come until next week or so, though.

@LaurentGomila
Copy link
Member

That's great.

@hiramgeeks, thanks a lot for your help on this issue.

@ghost
Copy link
Author

ghost commented Aug 26, 2014

@mantognini yeah, developing for iOS, I noticed Apple changing the API more drastically since last year. Noticeable from iOS 7 and OS X 10.9. Really strange bug, but understandable. Mr. Jobs is not there anymore yelling to make things work as before. LOL

@LaurentGomila my honor, sir. u r welcome

@eXpl0it3r
Copy link
Member

@mantognini Have you already pushed the other modification? If so can you link it?

@mantognini
Copy link
Member

@eXpl0it3r No, it's not yet implemented. I'll do it either later tonight or on Monday.

@mantognini mantognini self-assigned this Sep 20, 2014
@mantognini mantognini added this to the 2.2 milestone Sep 20, 2014
LaurentGomila referenced this issue Sep 22, 2014
Note: this only fix the compilation process. SFML was not thoroughly
tested on this OS yet.
@ghost ghost unassigned mantognini Apr 30, 2015
@mantognini mantognini self-assigned this Feb 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants