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

Mac OS 10.9 SDK compatibility #994

Merged
merged 4 commits into from
Dec 24, 2013
Merged

Mac OS 10.9 SDK compatibility #994

merged 4 commits into from
Dec 24, 2013

Conversation

mortuosplango
Copy link
Contributor

  • detect Mac OS 10.9 SDK
  • set -DMACOS_10_9 flag and MACOS_10_9 variable
  • use accelerate toolkit instead of vecKit
  • langsource/GC: fix header path

Don't know if that's too much for one patch or if the naming should be changed.

- detect Mac OS 10.9 SDK
- set -DMACOS_10_9 flag and MACOS_10_9 variable
- use accelerate toolkit instead of vecKit
- langsource/GC: fix header path
@joshpar
Copy link
Member

joshpar commented Nov 11, 2013

YYYYESSSS!
Josh
On Nov 11, 2013, at 3:00 PM, Holger notifications@github.com wrote:

detect Mac OS 10.9 SDK
set -DMACOS_10_9 flag and MACOS_10_9 variable
use accelerate toolkit instead of vecKit
langsource/GC: fix header path
Don't know if that's too much for one patch or if the naming should be changed.

You can merge this Pull Request by running

git pull https://github.com/mortuosplango/supercollider master
Or view, comment on, or merge it at:

#994

Commit Summary

Mac OS 10.9 SDK compatibility
File Changes

M CMakeLists.txt (6)
M common/SC_fftlib.cpp (4)
M lang/LangSource/GC.cpp (4)
M server/plugins/CMakeLists.txt (4)
M server/plugins/FFT_UGens.cpp (6)
M server/scsynth/CMakeLists.txt (4)
M server/supernova/CMakeLists.txt (7)
Patch Links:

https://github.com/supercollider/supercollider/pull/994.patch
https://github.com/supercollider/supercollider/pull/994.diff


/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono
*/

@timblechmann
Copy link
Contributor

adding conditionals for individual osx versions is a bad idea in terms of long-term maintenance.

@danstowell
Copy link
Member

Re tim's comment, maybe a slight tweak so that the "Accelerate" stuff is default, and the "vecLib" stuff (i.e. the legacy version) comes in for a flag such as MACOS_BEFORE_10_9...? That would presumably make it work correctly for 10.10. (Though the api will have changed again by then :)

@timblechmann
Copy link
Contributor

i'd not spend too much time on older osx versions/frameworks: afaict apple's policy is to keep source compatibility for 3 osx versions. veclib has been deprecated in favor of accelerate some time ago, and at one point it had been removed. so i'd remove all references to veclib now.

of course there is the 'just in case' argument that someone will want to compile on 10.4 or 10.5 or 10.6, though people will run into other toolchain issues. and tbo trying to keep the code compatible with all of apple's API changes is a wonderful way to waste developer time. side note: apple's current dev tools only provide the sdks for 10.8 and 10.9. side note 2: sdk != minimum os version

- don't try to detect 10.9 SDK as 10.10 will come some day
- vecLib is deprecated since 10.7 SDK
@mortuosplango
Copy link
Contributor Author

re Dan: Changed it to be the default and an option instead of a detection thingy. Probably should be actually tested against a 10.7 SDK, don't have one.

re Tim: I'd try to keep it compiling on 10.6 at least, as I think that a lot of people still use it and will continue using it. Also you'd need someone to compile it for you if you'd want to have libscsynth or some other special wishes on 10.6... But I see your point.

@danstowell
Copy link
Member

Thanks, looks better to me - but my opinion is not so important as the actual Mac building people.

@timblechmann
Copy link
Contributor

sc/master won't compile for 10.6 anymore. setting a minimum required version of less than 10.7 (no matter which sdk you use) will cause a linker error.

@mortuosplango
Copy link
Contributor Author

Ah, ok, didn't know that. The README_OS_X needs updating then...

@muellmusik
Copy link
Contributor

Yes, I think officially supporting a couple of prior versions at the most is reasonable. In the past interested parties used to maintain forks for older OSs, which I think is fair enough given limited dev resources.

@danstowell
Copy link
Member

Does a Mac person want to pres the MERGE PULL REQUEST button?

@joshpar
Copy link
Member

joshpar commented Nov 27, 2013

I was able to apply the merge and build on 10.9!
Josh

/*
Josh Parmenter
www.realizedsound.net/josh
*/

On Nov 27, 2013, at 4:52 AM, danstowell notifications@github.com wrote:

Does a Mac person want to pres the MERGE PULL REQUEST button?


Reply to this email directly or view it on GitHub.

@joshpar
Copy link
Member

joshpar commented Nov 27, 2013

Forgot one thing... It would probably be best if someone on 10.7 or 10.8 tested as well.

/*
Josh Parmenter
www.realizedsound.net/josh
*/

On Nov 27, 2013, at 4:52 AM, danstowell notifications@github.com wrote:

Does a Mac person want to pres the MERGE PULL REQUEST button?


Reply to this email directly or view it on GitHub.

@bagong
Copy link
Contributor

bagong commented Nov 30, 2013

I was able to apply the merge and build on 10.9!
Josh

I too. But in order to build successfully with Qt, it seems one has either to use SDK 10.8 or a pre-release Qt 4.8.6. If one builds with SDK 10.9, the option to switch off App Nap from the GetInfo menu becomes unavailable (and setting it via defaults write ... becomes uneffective) - and then sclang goes to sleep after a short while if no gui is in the foreground.

@snickell
Copy link
Contributor

Disabling app nap should be pretty simple, something like:

diff --git a/QtCollider/QcApplication.cpp b/QtCollider/QcApplication.cpp
index caad6a7..7b7f9e6 100644
--- a/QtCollider/QcApplication.cpp
+++ b/QtCollider/QcApplication.cpp
@@ -33,6 +33,10 @@
 #include <QKeyEvent>
 #include <QIcon>

+#ifdef Q_WS_MAC
+# include "hacks/hacks_mac.hpp"
+#endif
+
 extern bool compiledOK;
 extern const char * gIdeName;

@@ -76,6 +80,12 @@ QcApplication::QcApplication( int & argc, char ** argv )
     icon.addFile(":/icons/sc-cube-16");
     setWindowIcon(icon);
   }
+  
+#ifdef Q_WS_MAC
+  // On Mac, we may need to disable "App Nap", so we aren't put to sleep unexpectedly
+  QtCollider::Mac::disableAppNap();
+#endif
+  

   _handleCmdPeriod = strcmp(gIdeName, "scapp") != 0;
 }
diff --git a/QtCollider/hacks/hacks_mac.hpp b/QtCollider/hacks/hacks_mac.hpp
index 068ad3d..8c0cd50 100644
--- a/QtCollider/hacks/hacks_mac.hpp
+++ b/QtCollider/hacks/hacks_mac.hpp
@@ -28,6 +28,7 @@ namespace QtCollider {
 namespace Mac {

 bool isKeyWindow ( QWidget *w );
+void disableAppNap ( );

 } // namespace Mac
 } // namespace QtCollider
diff --git a/QtCollider/hacks/hacks_mac.mm b/QtCollider/hacks/hacks_mac.mm
index 8ccbe00..78fae1b 100644
--- a/QtCollider/hacks/hacks_mac.mm
+++ b/QtCollider/hacks/hacks_mac.mm
@@ -31,5 +31,15 @@ bool isKeyWindow ( QWidget *w )
   return [[reinterpret_cast<NSView *>(w->winId()) window] isKeyWindow];
 }

+void disableAppNap ( )
+{
+   // Does the App Nap API even exist on this Mac?
+   if ([[NSProcessInfo processInfo] respondsToSelector:@selector(beginActivityWithOptions:reason:)]) {
+       // If the API exists, then disable App Nap...
+       NSActivityOptions options = NSActivityLatencyCritical or NSActivityUserInitiated;
+       id activity = [[NSProcessInfo processInfo] beginActivityWithOptions: options reason:@"avoiding audio hiccups and reducing latency"];
+   }   
+}
+
 } // namespace Mac
 } // namespace QtCollider

@bagong
Copy link
Contributor

bagong commented Dec 22, 2013

Hi Seth,
cool, thank you! I've tried this (and reproduce below the full patch with headers that will hopefully apply with git am). Unfortunately I experience two problems:

  1. it doesn't seem to work the way hoped. "sclang" is the process that goes to sleep (see Activity Monitor/Energy/SuperCollider/sclang), and it continues to do so after applying your patch (as indicated by "Yes" in the AppNap column, and by a simple simple test: restart the server and observe that it takes 15 to 30 seconds receive: "Receiving notification messages from server localhost" and "Shared memory server interface initialized"). While "switching off" AppNap for SuperCollider.app on the command line propagates to sclang, your patch doesn't seem to do so.
  2. applying your patch and compiling with SDK 10.8 creates a build error (this was with SDK and target set to 10.8):

[ 63%] Building CXX object lang/CMakeFiles/libsclang.dir/**/QtCollider/hacks/hacks_mac.mm.o
/Users/rainer/GitRepos/supercollider/QtCollider/hacks/hacks_mac.mm:39:21: error:
use of undeclared identifier 'options'; did you mean 'optind'?
NSActivityOptions options = NSActivityLatencyCritical or NSActivityUse...
^~~~~~~
optind
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/unistd.h:541:12: note:
'optind' declared here
extern int optind, opterr, optopt;
^
/Users/rainer/GitRepos/supercollider/QtCollider/hacks/hacks_mac.mm:39:3: error:
use of undeclared identifier 'NSActivityOptions'
NSActivityOptions options = NSActivityLatencyCritical or NSActivityUse...
^
/Users/rainer/GitRepos/supercollider/QtCollider/hacks/hacks_mac.mm:40:74: error:
use of undeclared identifier 'options'; did you mean 'optind'?
...= [[NSProcessInfo processInfo] beginActivityWithOptions: options reason:...
^~~~~~~
optind
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/unistd.h:541:12: note:
'optind' declared here
extern int optind, opterr, optopt;
^
/Users/rainer/GitRepos/supercollider/QtCollider/hacks/hacks_mac.mm:40:48: warning:
instance method '-beginActivityWithOptions:reason:' not found (return type
defaults to 'id') [-Wobjc-method-access]
...[[NSProcessInfo processInfo] beginActivityWithOptions: options reason:@"...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 3 errors generated.
make[2]: * [lang/CMakeFiles/libsclang.dir//QtCollider/hacks/hacks_mac.mm.o] Error 1
make[1]: *** [lang/CMakeFiles/libsclang.dir/all] Error 2
make: *** [all] Error 2


But thanks, we're getting closer, I think...
.r.


Seth's PATCH

From dbab41ce699e247e1ff7c6fa8bc01eb9d617db95 Mon Sep 17 00:00:00 2001
From: seth xy@xyz.com
Date: Sun, 22 Dec 2013 12:21:36 +0100
Subject: [PATCH 1/1] Seth Nickell's AppNap suggestion


QtCollider/QcApplication.cpp | 9 +++++++++
QtCollider/hacks/hacks_mac.hpp | 1 +
QtCollider/hacks/hacks_mac.mm | 10 ++++++++++
3 files changed, 20 insertions(+)

diff --git a/QtCollider/QcApplication.cpp b/QtCollider/QcApplication.cpp
index caad6a7..611730f 100644
--- a/QtCollider/QcApplication.cpp
+++ b/QtCollider/QcApplication.cpp
@@ -33,6 +33,10 @@
#include
#include

+#ifdef Q_WS_MAC
+# include "hacks/hacks_mac.hpp"
+#endif
+
extern bool compiledOK;
extern const char * gIdeName;

@@ -77,6 +81,11 @@ QcApplication::QcApplication( int & argc, char ** argv )
setWindowIcon(icon);
}

+#ifdef Q_WS_MAC
+// On Mac, we may need to disable "App Nap", so we aren't put to sleep unexpectedly
+QtCollider::Mac::disableAppNap();
+#endif
+
_handleCmdPeriod = strcmp(gIdeName, "scapp") != 0;
}

diff --git a/QtCollider/hacks/hacks_mac.hpp b/QtCollider/hacks/hacks_mac.hpp
index 068ad3d..8c0cd50 100644
--- a/QtCollider/hacks/hacks_mac.hpp
+++ b/QtCollider/hacks/hacks_mac.hpp
@@ -28,6 +28,7 @@ namespace QtCollider {
namespace Mac {

bool isKeyWindow ( QWidget *w );
+void disableAppNap ( );

} // namespace Mac
} // namespace QtCollider
diff --git a/QtCollider/hacks/hacks_mac.mm b/QtCollider/hacks/hacks_mac.mm
index 8ccbe00..73919f9 100644
--- a/QtCollider/hacks/hacks_mac.mm
+++ b/QtCollider/hacks/hacks_mac.mm
@@ -31,5 +31,15 @@ bool isKeyWindow ( QWidget *w )
return [[reinterpret_cast<NSView *>(w->winId()) window] isKeyWindow];
}

+void disableAppNap ( )
+{
+// Does the App Nap API even exist on this Mac?

  • if ([[NSProcessInfo processInfo] respondsToSelector:@selector(beginActivityWithOptions:reason:)]) {
    +// If the API exists, then disable App Nap...
  • NSActivityOptions options = NSActivityLatencyCritical or NSActivityUserInitiated;
  • id activity = [[NSProcessInfo processInfo] beginActivityWithOptions: options reason:@"avoiding audio hiccups and reducing latency"];
  • }
    +}

} // namespace Mac
} // namespace QtCollider

1.8.5.2

@snickell
Copy link
Contributor

Hi Bagong, another try... I actually tested this one. ;-)

Also, this now seems to compile against the 10.8 SDK (avoided using new constants). This patch should also disable appnap if you compile against 10.8, but run on 10.9 (it does runtime detection of the method call, not compile time). So it should be a fairly universal "blunt hammer" solution to app nap.

Arguably, as I understand the event architecture, QtCollider maybe should /not/ call disableAppNap(), since its not latency critical (?), and maybe people do want QtCollider napping when its in the background? Hard to say. In any case, the patch below currently attempts (and seems to succeed in...) to disable appnap on all 3 processes (QtCollider, sclang, scsynth).

Let me know how it works for you. I'm not sure how to manage a git change that relies on an existing PR, but I can open a new PR if you want for this. I'm pretty git-ignorant still, so lemme know what works best for you guys.

diff --git a/common/SC_Apple.hpp b/common/SC_Apple.hpp
new file mode 100644
index 0000000..0331989
--- /dev/null
+++ b/common/SC_Apple.hpp
@@ -0,0 +1,31 @@
+/************************************************************************
+*
+* Copyright 2013 Seth Nickell <snickell@gmail.com>
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+************************************************************************/
+
+#ifndef _SC_APPLE_H_
+#define _SC_APPLE_H_
+
+namespace SC {
+namespace Apple {
+
+void disableAppNap ( );
+
+} // namespace Apple
+} // namespace SC
+
+#endif
\ No newline at end of file
diff --git a/common/SC_Apple.mm b/common/SC_Apple.mm
new file mode 100644
index 0000000..b95541c
--- /dev/null
+++ b/common/SC_Apple.mm
@@ -0,0 +1,48 @@
+/************************************************************************
+*
+* Copyright 2013 Seth Nickell <snickell@gmail.com>
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+************************************************************************/
+
+#include "SC_Apple.hpp"
+
+#import <Cocoa/Cocoa.h>
+
+namespace SC {
+namespace Apple {
+
+void disableAppNap ( )
+{
+   printf("In disableAppNap()\n");
+   // Does the App Nap API even exist on this Mac?
+   if ([[NSProcessInfo processInfo] respondsToSelector:@selector(beginActivityWithOptions:reason:)]) {
+       // If the API exists, then disable App Nap...
+       printf("Disabling!!!\n");
+       
+       // From NSProcessInfo.h:
+       // NSActivityIdleSystemSleepDisabled = (1ULL << 20),
+       // NSActivityUserInitiated = (0x00FFFFFFULL | NSActivityIdleSystemSleepDisabled),
+       // NSActivityLatencyCritical = 0xFF00000000ULL
+       
+       uint64_t options = (0x00FFFFFFULL | (1ULL << 20)) | 0xFF00000000ULL;
+
+       // NSActivityLatencyCritical | NSActivityUserInitiated
+       id activity = [[NSProcessInfo processInfo] beginActivityWithOptions: options reason:@"avoiding audio hiccups and reducing latency"];
+   }   
+}
+
+} // namespace Apple
+} // namespace SC
\ No newline at end of file
diff --git a/QtCollider/QcApplication.cpp b/QtCollider/QcApplication.cpp
index caad6a7..39826be 100644
--- a/QtCollider/QcApplication.cpp
+++ b/QtCollider/QcApplication.cpp
@@ -33,6 +33,10 @@
 #include <QKeyEvent>
 #include <QIcon>

+#ifdef Q_WS_MAC
+#include "../../common/SC_Apple.hpp"
+#endif
+
 extern bool compiledOK;
 extern const char * gIdeName;

@@ -76,6 +80,12 @@ QcApplication::QcApplication( int & argc, char ** argv )
     icon.addFile(":/icons/sc-cube-16");
     setWindowIcon(icon);
   }
+  
+#ifdef Q_WS_MAC
+  // On Mac, we may need to disable "App Nap", so we aren't put to sleep unexpectedly
+  SC::Apple::disableAppNap();
+#endif
+  

   _handleCmdPeriod = strcmp(gIdeName, "scapp") != 0;
 }
diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt
index 06973aa..562b3cb 100644
--- a/lang/CMakeLists.txt
+++ b/lang/CMakeLists.txt
@@ -86,6 +86,9 @@ set(sclang_sources

 if(APPLE)
    set_property(SOURCE ${CMAKE_SOURCE_DIR}/common/SC_DirUtils.cpp PROPERTY COMPILE_FLAGS -xobjective-c++)
+   
+   list(APPEND sclang_sources ${CMAKE_SOURCE_DIR}/common/SC_Apple.mm)
+   set_source_files_properties(${CMAKE_SOURCE_DIR}/common/SC_Apple.mm PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-exceptions")
 endif()

 if (NOT Boost_FOUND)
diff --git a/lang/LangSource/SC_TerminalClient.cpp b/lang/LangSource/SC_TerminalClient.cpp
index 94289bf..faea0d6 100644
--- a/lang/LangSource/SC_TerminalClient.cpp
+++ b/lang/LangSource/SC_TerminalClient.cpp
@@ -39,6 +39,10 @@
 # include <windows.h>
 #endif

+#ifdef __APPLE__
+#include "../../common/SC_Apple.hpp"
+#endif
+
 #ifdef HAVE_READLINE
 # include <readline/readline.h>
 # include <readline/history.h>
@@ -656,6 +660,11 @@ SC_DLLEXPORT SC_LanguageClient * createLanguageClient(const char * name)
    if (SC_LanguageClient::instance())
        return NULL;

+#ifdef __APPLE__
+   printf("Calling disableAppNap for sclang...\n");
+   SC::Apple::disableAppNap();
+#endif
+
 #ifdef SC_QT
    return new QtCollider::LangClient(name);
 #else
diff --git a/server/scsynth/CMakeLists.txt b/server/scsynth/CMakeLists.txt
index b1d0cdf..492482f 100644
--- a/server/scsynth/CMakeLists.txt
+++ b/server/scsynth/CMakeLists.txt
@@ -87,6 +87,13 @@ set(scsynth_sources

 if(APPLE)
    set_property(SOURCE ${CMAKE_SOURCE_DIR}/common/SC_DirUtils.cpp PROPERTY COMPILE_FLAGS -xobjective-c++)
+   
+   list(APPEND scsynth_sources 
+       ${CMAKE_SOURCE_DIR}/common/SC_Apple.mm
+   )
+   set_source_files_properties( ${CMAKE_SOURCE_DIR}/common/SC_Apple.mm
+       PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-exceptions"
+   )
 endif()

 if(WIN32)
diff --git a/server/scsynth/SC_World.cpp b/server/scsynth/SC_World.cpp
index 124092c..07c89b3 100644
--- a/server/scsynth/SC_World.cpp
+++ b/server/scsynth/SC_World.cpp
@@ -22,6 +22,11 @@
 #include "SC_Win32Utils.h"
 #endif

+#ifdef __APPLE__
+#include "../../common/SC_Apple.hpp"
+#endif
+
+
 #include "SC_World.h"
 #include "SC_WorldOptions.h"
 #include "SC_HiddenWorld.h"
@@ -454,6 +459,13 @@ SC_DLLEXPORT_C World* World_New(WorldOptions *inOptions)
                scprintf("start audio failed.\n");
                return 0;
            }
+           
+#ifdef __APPLE__
+           printf("Calling disableAppNap...\n");
+           SC::Apple::disableAppNap();
+#endif
+           
+           
        } else {
            hw->mAudioDriver = 0;
        }

@bagong
Copy link
Contributor

bagong commented Dec 23, 2013

Hi Seth,

how nice that you keep going!! I've applied your patch. It compiled fine (both against SDK 10.8 and 10.9 and it appears to be doing the job as intended. No more 'yes' in 'Activity Monitor/Energy' and the server reboots instantly as in the past. I think this is great, and I think a separate pull request would be the best, honour your initiative and set a separate topic.

A few small considerations:

  • as you said one might ask if the ide itself should nap. I think it should not, but others can say so with far more authority.
  • scsynth hasn't gone to sleep in the past, apparently it is automatically recognized as a audio-/latency-sensitive process and excluded. Either way, one might ask if scsynth and supernova shouldn't be treated the same.
  • currently, when building against SDK 10.8/target 10.7 and installing on 10.9 we still get the startup-option to prevent AppNap (in SuperCollider.app/ConextMenu/GetInfo) while your patch switches AppNap off regardless of the setting. While I don't think that would ever cause a problem...

Last but not least: unfortunately the SC community is currently not very compact as to github-use. I think you would get the most competent feedback (and an interesting discussion), if your patch was also posted on sc-dev. Have you joined it already? I am sure your participation would highly appreciated!

Thanks for all of this
.r.

@muellmusik
Copy link
Contributor

I can confirm this builds and runs on 10.8 using the 10.8 SDK. Shall I push the button?

@muellmusik
Copy link
Contributor

Doesn't seem to build on 10.8 with the 10.7 SDK, but the error seems unrelated:

/tmp/testVecLib/lang/LangSource/GC.cpp:801:11: 'MacTypes.h' file not found

@bagong
Copy link
Contributor

bagong commented Dec 24, 2013

There used to be a version check in an earlier version of the patch which apparently is still required, but with PRE_10_8 rather than 10_7:

-#if defined(SC_DARWIN) && defined(MACOS_SDK_PRE_10_7)
 -  #include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>
 -#elif defined(SC_DARWIN)
 -  #include <MacTypes.h>  
 +#ifdef SC_DARWIN
 +  #include <MacTypes.h>  
  #endif

@muellmusik
Copy link
Contributor

Probably just not awake yet, but the option seems not to be there.

cmake .. -GXcode -DMACOS_SDK_PRE_10_7=ON

CMake Warning:
Manually-specified variables were not used by the project:

MACOS_SDK_PRE_10_7

@bagong
Copy link
Contributor

bagong commented Dec 24, 2013

Well I am not sure it is the solution, I just observed that there used to be a version check for MacTypes.h-path in Holgers original patch. It was removed later:

https://github.com/mortuosplango/supercollider/commit/a73b0a079a0413c5b7b1062e3311e086b6300fc3

Maybe the old path is still required when building against 10.7 SDK?

@timblechmann
Copy link
Contributor

btw, i would not spend too much effort on 10.7 sdk compatibility:

  • the 10.7 sdk is not available anymore
  • one can use the 10.8 sdk and set a deployment target of 10.7 to build a 10.7-compatible binary

apple continuously changes its APIs. making it almost impossible to have the same code compiling on 3 different osx sdks. it is a great way to waste time, though

@timblechmann
Copy link
Contributor

easier:

@@ -797,10 +798,6 @@ bool PyrGC::SanityCheck2()
        return mNumGrey == numgrey;
 }

-#ifdef SC_DARWIN
-       #include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>
-#endif
-
 bool PyrGC::SanityCheck()
 {
        if (!mRunning) return true;

@mortuosplango
Copy link
Contributor Author

So should I add this back or will 10.7 sdk now be dropped, too?

@timblechmann
Copy link
Contributor

nobody is actively dropping anything ... people simply don't care ... :/

however it does make sense to actually read the code and see what is going on: this file is included, but apparently none of its content is used. so why in include it in the first place?

@muellmusik
Copy link
Contributor

nobody is actively dropping anything ... people simply don't care ... :/

Just knowing that you care is enough to make it a Merry Christmas for everyone, Tim! :-)

I can confirm that with that include removed it builds against the 10.7 SDK. So I'd suggest decrufting and then merging.

@bagong
Copy link
Contributor

bagong commented Dec 24, 2013

Just knowing that you care is enough to make it a Merry Christmas for everyone, Tim! :-)

Yesss! Merry Christmas to everybody...

I can confirm that with that include removed it builds against the 10.7 SDK. So I'd suggest decrufting and then merging.

Rough process but nice result ;)!

@mortuosplango
Copy link
Contributor Author

That was fun. Happy Christmas!

muellmusik added a commit that referenced this pull request Dec 24, 2013
Mac OS 10.9 SDK compatibility

Seems to have been sorted, so merging
@muellmusik muellmusik merged commit aa5bbde into supercollider:master Dec 24, 2013
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

Successfully merging this pull request may close these issues.

7 participants