@@ -41,6 +41,9 @@ def get_the_lib_path():
4141 return subprocess .run (['pkg-config' , '--variable=libdir' , 'raylib' ], text = True ,
4242 stdout = subprocess .PIPE ).stdout .strip ()
4343
44+ def get_lib_flags ():
45+ return subprocess .run (['pkg-config' , '--libs' , 'raylib' ], text = True ,
46+ stdout = subprocess .PIPE ).stdout .strip ().split ()
4447
4548def pre_process_header (filename , remove_function_bodies = False ):
4649 print ("Pre-processing " + filename )
@@ -154,7 +157,7 @@ def build_unix():
154157 libraries = []
155158 else : #platform.system() == "Linux":
156159 print ("BUILDING FOR LINUX" )
157- extra_link_args = [ get_the_lib_path () + '/libraylib.a' , '-lm' , '-lpthread' , '-lGL' ,
160+ extra_link_args = get_lib_flags () + [ '-lm' , '-lpthread' , '-lGL' ,
158161 '-lrt' , '-lm' , '-ldl' , '-lX11' , '-lpthread' , '-latomic' ]
159162 libraries = ['GL' , 'm' , 'pthread' , 'dl' , 'rt' , 'X11' , 'atomic' ]
160163
@@ -200,4 +203,4 @@ def build_windows():
200203
201204
202205if __name__ == "__main__" :
203- ffibuilder .compile (verbose = True )
206+ ffibuilder .compile (verbose = True )
0 commit comments