Skip to content

Commit

Permalink
LinuxBSD now compiles without vulkan/x11.
Browse files Browse the repository at this point in the history
  • Loading branch information
Faless committed Jun 1, 2021
1 parent ae04dac commit 8594613
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 181 deletions.
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ opts.Add(BoolVariable("use_lto", "Use link-time optimization", False))
opts.Add(BoolVariable("deprecated", "Enable deprecated features", True))
opts.Add(BoolVariable("minizip", "Enable ZIP archive support using minizip", True))
opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver", False))
opts.Add(BoolVariable("vulkan", "Enable the vulkan video driver", True))
opts.Add("custom_modules", "A list of comma-separated directory paths containing custom modules to build.", "")
opts.Add(BoolVariable("custom_modules_recursive", "Detect custom modules recursively for each specified path.", True))

Expand Down
4 changes: 1 addition & 3 deletions drivers/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ SConscript("coremidi/SCsub")
SConscript("winmidi/SCsub")

# Graphics drivers
if env["platform"] != "javascript":
if env["vulkan"]:
SConscript("vulkan/SCsub")
else:
SConscript("dummy/SCsub")

# Core dependencies
SConscript("png/SCsub")
Expand Down
5 changes: 0 additions & 5 deletions drivers/dummy/SCsub

This file was deleted.

109 changes: 0 additions & 109 deletions drivers/dummy/texture_loader_dummy.cpp

This file was deleted.

47 changes: 0 additions & 47 deletions drivers/dummy/texture_loader_dummy.h

This file was deleted.

1 change: 1 addition & 0 deletions platform/javascript/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def get_flags():
# in this platform. For the available networking methods, the browser
# manages TLS.
("module_mbedtls_enabled", False),
("vulkan", False),
]


Expand Down
22 changes: 14 additions & 8 deletions platform/linuxbsd/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@ Import("env")
from platform_methods import run_in_subprocess
import platform_linuxbsd_builders

common_x11 = [
common_linuxbsd = [
"crash_handler_linuxbsd.cpp",
"os_linuxbsd.cpp",
"joypad_linux.cpp",
"context_gl_x11.cpp",
"detect_prime_x11.cpp",
"display_server_x11.cpp",
"vulkan_context_x11.cpp",
"key_mapping_x11.cpp",
]

if "x11" in env and env["x11"]:
common_linuxbsd += [
"context_gl_x11.cpp",
"detect_prime_x11.cpp",
"display_server_x11.cpp",
"key_mapping_x11.cpp",
]

if "vulkan" in env and env["vulkan"]:
common_linuxbsd.append("vulkan_context_x11.cpp")

if "udev" in env and env["udev"]:
common_x11.append("libudev-so_wrap.c")
common_linuxbsd.append("libudev-so_wrap.c")

prog = env.add_program("#bin/godot", ["godot_linuxbsd.cpp"] + common_x11)
prog = env.add_program("#bin/godot", ["godot_linuxbsd.cpp"] + common_linuxbsd)

if env["debug_symbols"] and env["separate_debug_symbols"]:
env.AddPostAction(prog, run_in_subprocess(platform_linuxbsd_builders.make_debug_linuxbsd))
27 changes: 18 additions & 9 deletions platform/linuxbsd/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def get_opts():
BoolVariable("use_msan", "Use LLVM compiler memory sanitizer (MSAN)", False),
BoolVariable("pulseaudio", "Detect and use PulseAudio", True),
BoolVariable("udev", "Use udev for gamepad connection callbacks", True),
BoolVariable("x11", "Enable X11 display", True),
BoolVariable("debug_symbols", "Add debugging symbols to release/release_debug builds", True),
BoolVariable("separate_debug_symbols", "Create a separate file containing debugging symbols", False),
BoolVariable("touch", "Enable touch events", True),
Expand Down Expand Up @@ -362,18 +363,26 @@ def configure(env):
env.ParseConfig("pkg-config zlib --cflags --libs")

env.Prepend(CPPPATH=["#platform/linuxbsd"])
env.Append(CPPDEFINES=["X11_ENABLED", "UNIX_ENABLED"])

if env["x11"]:
if not env["vulkan"]:
print("Error: X11 support requires vulkan=yes")
env.Exit(255)
env.Append(CPPDEFINES=["X11_ENABLED"])

env.Append(CPPDEFINES=["UNIX_ENABLED"])
env.Append(CPPDEFINES=[("_FILE_OFFSET_BITS", 64)])

env.Append(CPPDEFINES=["VULKAN_ENABLED"])
if not env["builtin_vulkan"]:
env.ParseConfig("pkg-config vulkan --cflags --libs")
if not env["builtin_glslang"]:
# No pkgconfig file for glslang so far
env.Append(LIBS=["glslang", "SPIRV"])
if env["vulkan"]:
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
if not env["builtin_vulkan"]:
env.ParseConfig("pkg-config vulkan --cflags --libs")
if not env["builtin_glslang"]:
# No pkgconfig file for glslang so far
env.Append(LIBS=["glslang", "SPIRV"])

# env.Append(CPPDEFINES=['OPENGL_ENABLED'])
env.Append(LIBS=["GL"])
# env.Append(CPPDEFINES=['OPENGL_ENABLED'])
env.Append(LIBS=["GL"])

env.Append(LIBS=["pthread"])

Expand Down

0 comments on commit 8594613

Please sign in to comment.