fix mac osx compilation

This commit is contained in:
Erwin Coumans
2019-09-30 14:08:22 -07:00
parent 0d948a2c56
commit b6e5609f90
2 changed files with 6 additions and 2 deletions

View File

@@ -2007,12 +2007,16 @@ typedef khronos_ssize_t GLsizeiptr;
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef long GLintptrARB; typedef long GLintptrARB;
#else #else
#ifndef __gltypes_h_
typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLintptrARB;
#endif #endif
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
typedef long GLsizeiptrARB; typedef long GLsizeiptrARB;
#else #else
#ifndef __gltypes_h_
typedef ptrdiff_t GLsizeiptrARB; typedef ptrdiff_t GLsizeiptrARB;
#endif
#endif #endif
typedef int64_t GLint64EXT; typedef int64_t GLint64EXT;
typedef uint64_t GLuint64EXT; typedef uint64_t GLuint64EXT;

View File

@@ -50,7 +50,7 @@ def parallelCCompile(self,
newcc_args = cc_args newcc_args = cc_args
if _platform == "darwin": if _platform == "darwin":
if src.endswith('.cpp'): if src.endswith('.cpp'):
newcc_args = cc_args + ["-stdlib=libc++"] newcc_args = cc_args + ["-mmacosx-version-min=10.7", "-stdlib=libc++"]
self._compile(obj, src, ext, newcc_args, extra_postargs, pp_opts) self._compile(obj, src, ext, newcc_args, extra_postargs, pp_opts)
# convert to list, imap is evaluated on-demand # convert to list, imap is evaluated on-demand
@@ -417,7 +417,7 @@ elif _platform == "win32":
+["examples/ThirdPartyLibs/glad/gl.c"] +["examples/ThirdPartyLibs/glad/gl.c"]
elif _platform == "darwin": elif _platform == "darwin":
print("darwin!") print("darwin!")
os.environ['LDFLAGS'] = '-framework Cocoa -stdlib=libc++ -framework OpenGL' os.environ['LDFLAGS'] = '-framework Cocoa -mmacosx-version-min=10.7 -stdlib=libc++ -framework OpenGL'
CXX_FLAGS += '-DB3_NO_PYTHON_FRAMEWORK ' CXX_FLAGS += '-DB3_NO_PYTHON_FRAMEWORK '
CXX_FLAGS += '-DHAS_SOCKLEN_T ' CXX_FLAGS += '-DHAS_SOCKLEN_T '
CXX_FLAGS += '-D_DARWIN ' CXX_FLAGS += '-D_DARWIN '