mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-16 05:14:01 +02:00
Better hack for library checking on OS X
This commit is contained in:
14
SConscript
14
SConscript
@@ -209,12 +209,16 @@ def CheckBit(context):
|
|||||||
def CheckFramework(context, framework):
|
def CheckFramework(context, framework):
|
||||||
import SCons.Conftest
|
import SCons.Conftest
|
||||||
#Extreme hack, TODO: maybe think of a better one (like replicating CheckLib here) or at least just fix the message
|
#Extreme hack, TODO: maybe think of a better one (like replicating CheckLib here) or at least just fix the message
|
||||||
ret = SCons.Conftest.CheckLib(context, ['m" -framework {0}"'.format(framework)], autoadd = 0)
|
oldLinkFlags = context.env.Append(LINKFLAGS=["-framework", framework])
|
||||||
|
context.Display("Checking for Darwin Framework {0}...".format(framework))
|
||||||
|
ret = SCons.Conftest.CheckLib(context, ["m"], autoadd = 0)
|
||||||
context.did_show_result = 1
|
context.did_show_result = 1
|
||||||
if not ret:
|
if not ret:
|
||||||
context.env.Append(LINKFLAGS=["-framework", framework])
|
context.env.Append(LINKFLAGS=["-framework", framework])
|
||||||
if framework != "Cocoa":
|
if framework != "Cocoa":
|
||||||
env.Append(CPPPATH=['/Library/Frameworks/{0}.framework/Headers/'.format(framework)])
|
env.Append(CPPPATH=['/Library/Frameworks/{0}.framework/Headers/'.format(framework)])
|
||||||
|
else:
|
||||||
|
context.env.Replace(LINKFLAGS=oldLinkFlags)
|
||||||
return not ret
|
return not ret
|
||||||
|
|
||||||
#function that finds libraries and appends them to LIBS
|
#function that finds libraries and appends them to LIBS
|
||||||
@@ -324,7 +328,7 @@ def findLibs(env, conf):
|
|||||||
#Look for pthreads
|
#Look for pthreads
|
||||||
if not conf.CheckLib(['pthread', 'pthreadVC2']):
|
if not conf.CheckLib(['pthread', 'pthreadVC2']):
|
||||||
FatalError("pthreads development library not found or not installed")
|
FatalError("pthreads development library not found or not installed")
|
||||||
|
|
||||||
if msvc:
|
if msvc:
|
||||||
if not conf.CheckHeader('dirent.h') or not conf.CheckHeader('fftw3.h') or not conf.CheckHeader('pthread.h') or not conf.CheckHeader('zlib.h'):
|
if not conf.CheckHeader('dirent.h') or not conf.CheckHeader('fftw3.h') or not conf.CheckHeader('pthread.h') or not conf.CheckHeader('zlib.h'):
|
||||||
FatalError("Required headers not found")
|
FatalError("Required headers not found")
|
||||||
@@ -332,7 +336,7 @@ def findLibs(env, conf):
|
|||||||
#Look for libm
|
#Look for libm
|
||||||
if not conf.CheckLib('m'):
|
if not conf.CheckLib('m'):
|
||||||
FatalError("libm not found or not installed")
|
FatalError("libm not found or not installed")
|
||||||
|
|
||||||
#Look for OpenGL libraries
|
#Look for OpenGL libraries
|
||||||
if GetOption('opengl'):
|
if GetOption('opengl'):
|
||||||
if platform == "Linux":
|
if platform == "Linux":
|
||||||
@@ -342,7 +346,7 @@ def findLibs(env, conf):
|
|||||||
env.ParseConfig('pkg-config --libs glew gl glu')
|
env.ParseConfig('pkg-config --libs glew gl glu')
|
||||||
except:
|
except:
|
||||||
FatalError(sys.exc_info()[0])
|
FatalError(sys.exc_info()[0])
|
||||||
|
|
||||||
elif platform == "Windows":
|
elif platform == "Windows":
|
||||||
if not conf.CheckLib('opengl32'):
|
if not conf.CheckLib('opengl32'):
|
||||||
FatalError("opengl32 not found or not installed")
|
FatalError("opengl32 not found or not installed")
|
||||||
@@ -351,7 +355,7 @@ def findLibs(env, conf):
|
|||||||
elif platform == "Darwin":
|
elif platform == "Darwin":
|
||||||
if not conf.CheckFramework("OpenGL"):
|
if not conf.CheckFramework("OpenGL"):
|
||||||
FatalError("OpenGL framework not found or not installed")
|
FatalError("OpenGL framework not found or not installed")
|
||||||
|
|
||||||
if platform == "Linux":
|
if platform == "Linux":
|
||||||
if not conf.CheckLib('X11'):
|
if not conf.CheckLib('X11'):
|
||||||
FatalError("X11 development library not found or not installed")
|
FatalError("X11 development library not found or not installed")
|
||||||
|
Reference in New Issue
Block a user