You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Linux: Use pkg-config for alsa, libudev and GL too
It's not needed on most distros as those are found in standard lib
and include paths, but on NixOS they're all in non-standard prefixes,
so we need to rely on information provided by pkg-config.
Fixes #59913.
Co-authored-by: David Lewis <davidalewis00@gmail.com>
(cherry picked from commit 07ad066420)
This commit is contained in:
@@ -328,13 +328,14 @@ def configure(env):
|
|||||||
if os.system("pkg-config --exists alsa") == 0: # 0 means found
|
if os.system("pkg-config --exists alsa") == 0: # 0 means found
|
||||||
env["alsa"] = True
|
env["alsa"] = True
|
||||||
env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
|
env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
|
||||||
|
env.ParseConfig("pkg-config alsa --cflags") # Only cflags, we dlopen the library.
|
||||||
else:
|
else:
|
||||||
print("Warning: ALSA libraries not found. Disabling the ALSA audio driver.")
|
print("Warning: ALSA libraries not found. Disabling the ALSA audio driver.")
|
||||||
|
|
||||||
if env["pulseaudio"]:
|
if env["pulseaudio"]:
|
||||||
if os.system("pkg-config --exists libpulse") == 0: # 0 means found
|
if os.system("pkg-config --exists libpulse") == 0: # 0 means found
|
||||||
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED"])
|
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED"])
|
||||||
env.ParseConfig("pkg-config --cflags libpulse")
|
env.ParseConfig("pkg-config libpulse --cflags") # Only cflags, we dlopen the library.
|
||||||
else:
|
else:
|
||||||
print("Warning: PulseAudio development libraries not found. Disabling the PulseAudio audio driver.")
|
print("Warning: PulseAudio development libraries not found. Disabling the PulseAudio audio driver.")
|
||||||
|
|
||||||
@@ -343,6 +344,7 @@ def configure(env):
|
|||||||
if env["udev"]:
|
if env["udev"]:
|
||||||
if os.system("pkg-config --exists libudev") == 0: # 0 means found
|
if os.system("pkg-config --exists libudev") == 0: # 0 means found
|
||||||
env.Append(CPPDEFINES=["UDEV_ENABLED"])
|
env.Append(CPPDEFINES=["UDEV_ENABLED"])
|
||||||
|
env.ParseConfig("pkg-config libudev --cflags") # Only cflags, we dlopen the library.
|
||||||
else:
|
else:
|
||||||
print("Warning: libudev development libraries not found. Disabling controller hotplugging support.")
|
print("Warning: libudev development libraries not found. Disabling controller hotplugging support.")
|
||||||
else:
|
else:
|
||||||
@@ -354,7 +356,10 @@ def configure(env):
|
|||||||
|
|
||||||
env.Prepend(CPPPATH=["#platform/x11"])
|
env.Prepend(CPPPATH=["#platform/x11"])
|
||||||
env.Append(CPPDEFINES=["X11_ENABLED", "UNIX_ENABLED", "OPENGL_ENABLED", "GLES_ENABLED", ("_FILE_OFFSET_BITS", 64)])
|
env.Append(CPPDEFINES=["X11_ENABLED", "UNIX_ENABLED", "OPENGL_ENABLED", "GLES_ENABLED", ("_FILE_OFFSET_BITS", 64)])
|
||||||
env.Append(LIBS=["GL", "pthread"])
|
|
||||||
|
env.ParseConfig("pkg-config gl --cflags --libs")
|
||||||
|
|
||||||
|
env.Append(LIBS=["pthread"])
|
||||||
|
|
||||||
if platform.system() == "Linux":
|
if platform.system() == "Linux":
|
||||||
env.Append(LIBS=["dl"])
|
env.Append(LIBS=["dl"])
|
||||||
|
|||||||
Reference in New Issue
Block a user