Merge pull request #78 from archie2x/77-pkg-config-flags

#77 use all link flags from pkg-config
This commit is contained in:
Richard Smith 2022-08-11 21:25:32 +01:00 committed by GitHub
commit 3a6deb2c04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,9 @@ def get_the_lib_path():
return subprocess.run(['pkg-config', '--variable=libdir', 'raylib'], text=True,
stdout=subprocess.PIPE).stdout.strip()
def get_lib_flags():
return subprocess.run(['pkg-config', '--libs', 'raylib'], text=True,
stdout=subprocess.PIPE).stdout.strip().split()
def pre_process_header(filename, remove_function_bodies=False):
print("Pre-processing " + filename)
@ -154,7 +157,7 @@ def build_unix():
libraries = []
else: #platform.system() == "Linux":
print("BUILDING FOR LINUX")
extra_link_args = [get_the_lib_path() + '/libraylib.a', '-lm', '-lpthread', '-lGL',
extra_link_args = get_lib_flags() + [ '-lm', '-lpthread', '-lGL',
'-lrt', '-lm', '-ldl', '-lX11', '-lpthread', '-latomic']
libraries = ['GL', 'm', 'pthread', 'dl', 'rt', 'X11', 'atomic']
@ -200,4 +203,4 @@ else:
if __name__ == "__main__":
ffibuilder.compile(verbose=True)
ffibuilder.compile(verbose=True)