diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-08 11:23:29 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-08 11:23:29 +0200 |
| commit | be2e6884aafa58053a0707bc629ae8c56dbf1eb5 (patch) | |
| tree | 762ddba469b5a95840572ab786adf9d1777e4d2e /src | |
| parent | 557692987d29d3b96660ebfdbf5a3fe0060385b6 (diff) | |
Fix build on old 10.6 environment.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/cross_osx.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 481edad0d..c52dfc434 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -31,7 +31,6 @@ extern "C" { } #include <boost/algorithm/string.hpp> #include <boost/foreach.hpp> -#include <boost/dll/runtime_symbol_info.hpp> #include <boost/regex.hpp> #include <sys/sysctl.h> #include <mach-o/dyld.h> @@ -94,7 +93,21 @@ cpu_info () boost::filesystem::path app_contents () { - return boost::dll::program_location().parent_path().parent_path(); + /* Could use boost::dll::program_location().parent_path().parent_path() but that + * boost library isn't in the 10.6 environment we're currently using and I don't + * really want to change it right now. + */ + uint32_t size = 1024; + char buffer[size]; + if (_NSGetExecutablePath (buffer, &size)) { + throw runtime_error ("_NSGetExecutablePath failed"); + } + + boost::filesystem::path path (buffer); + path = boost::filesystem::canonical (path); + path = path.parent_path (); + path = path.parent_path (); + return path; } boost::filesystem::path |
