Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisplayServer: Some fixes to X11, build system and Window class #37029

Merged
merged 2 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ matrix:

- name: Linux editor (debug, GCC 9, with Mono)
stage: build
env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
env: PLATFORM=linuxbsd TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
os: linux
compiler: gcc-9
addons:
Expand All @@ -47,7 +47,7 @@ matrix:

- name: Linux export template (release, Clang 7)
stage: build
env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
env: PLATFORM=linuxbsd TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
os: linux
compiler: clang
addons:
Expand Down Expand Up @@ -109,7 +109,7 @@ matrix:

- name: Linux export template (release_debug, GCC 7, without 3D support)
stage: build
env: PLATFORM=x11 TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-gcc-7 EXTRA_ARGS="disable_3d=yes"
env: PLATFORM=linuxbsd TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-gcc-7 EXTRA_ARGS="disable_3d=yes"
os: linux
compiler: gcc
addons:
Expand Down Expand Up @@ -150,7 +150,7 @@ script:
scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS &&
if [ "$TEST_PROJECT" = "yes" ]; then
git clone --depth 1 "https://github.com/godotengine/godot-tests.git";
sed -i "s:custom_template/release=\"\":custom_template/release=\"$(readlink -e bin/godot_server.x11.opt.tools.64)\":" godot-tests/tests/project_export/export_presets.cfg;
godot-tests/tests/project_export/test_project.sh "bin/godot_server.x11.opt.tools.64";
sed -i "s:custom_template/release=\"\":custom_template/release=\"$(readlink -e bin/godot_server.linuxbsd.opt.tools.64)\":" godot-tests/tests/project_export/export_presets.cfg;
godot-tests/tests/project_export/test_project.sh "bin/godot_server.linuxbsd.opt.tools.64";
fi
fi
2 changes: 1 addition & 1 deletion editor/plugins/script_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void ScriptEditorQuickOpen::_notification(int p_what) {

search_box->set_clear_button_enabled(true);
[[fallthrough]];
};
}
case NOTIFICATION_VISIBILITY_CHANGED: {
search_box->set_right_icon(search_options->get_theme_icon("Search", "EditorIcons"));
} break;
Expand Down
4 changes: 2 additions & 2 deletions editor/project_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class ProjectDialog : public ConfirmationDialog {
install_status_rect->set_texture(new_icon);
}

set_size(Size2(500, 0) * EDSCALE);
set_size(Size2i(500, 0) * EDSCALE);
}

String _test_path() {
Expand Down Expand Up @@ -788,7 +788,7 @@ class ProjectDialog : public ConfirmationDialog {
_test_path();
}

popup_centered(Size2(500, 0) * EDSCALE);
popup_centered(Size2i(500, 0) * EDSCALE);
}

ProjectDialog() {
Expand Down
2 changes: 1 addition & 1 deletion main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#else
const String error_msg = "Error: Couldn't load project data at path \"" + project_path + "\". Is the .pck file missing?\nIf you've renamed the executable, the associated .pck file should also be renamed to match the executable's name (without the extension).\n";
OS::get_singleton()->print("%s", error_msg.ascii().get_data());
OS::get_singleton()->alert(error_msg);
DisplayServer::get_singleton()->alert(error_msg);

goto error;
#endif
Expand Down
63 changes: 0 additions & 63 deletions main/main_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,68 +63,5 @@ def make_app_icon(target, source, env):
g.write("};\n")
g.write("#endif")


def make_default_controller_mappings(target, source, env):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the reference if anyone wonders about this removal: this code was moved to core/input/.

dst = target[0]
g = open(dst, "w")

g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write("#include \"core/typedefs.h\"\n")
g.write("#include \"main/default_controller_mappings.h\"\n")

# ensure mappings have a consistent order
platform_mappings = OrderedDict()
for src_path in source:
with open(src_path, "r") as f:
# read mapping file and skip header
mapping_file_lines = f.readlines()[2:]

current_platform = None
for line in mapping_file_lines:
if not line:
continue
line = line.strip()
if len(line) == 0:
continue
if line[0] == "#":
current_platform = line[1:].strip()
if current_platform not in platform_mappings:
platform_mappings[current_platform] = {}
elif current_platform:
line_parts = line.split(",")
guid = line_parts[0]
if guid in platform_mappings[current_platform]:
g.write("// WARNING - DATABASE {} OVERWROTE PRIOR MAPPING: {} {}\n".format(src_path, current_platform, platform_mappings[current_platform][guid]))
valid_mapping = True
for input_map in line_parts[2:]:
if "+" in input_map or "-" in input_map or "~" in input_map:
g.write("// WARNING - DISCARDED UNSUPPORTED MAPPING TYPE FROM DATABASE {}: {} {}\n".format(src_path, current_platform, line))
valid_mapping = False
break
if valid_mapping:
platform_mappings[current_platform][guid] = line

platform_variables = {
"Linux": "#if X11_ENABLED",
"Windows": "#ifdef WINDOWS_ENABLED",
"Mac OS X": "#ifdef OSX_ENABLED",
"Android": "#if defined(__ANDROID__)",
"iOS": "#ifdef IPHONE_ENABLED",
"Javascript": "#ifdef JAVASCRIPT_ENABLED",
"UWP": "#ifdef UWP_ENABLED",
}

g.write("const char* DefaultControllerMappings::mappings[] = {\n")
for platform, mappings in platform_mappings.items():
variable = platform_variables[platform]
g.write("{}\n".format(variable))
for mapping in mappings.values():
g.write("\t\"{}\",\n".format(mapping))
g.write("#endif\n")

g.write("\tNULL\n};\n")
g.close()


if __name__ == '__main__':
subprocess_main(globals())
2 changes: 1 addition & 1 deletion modules/assimp/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MMD_IMPORTER'])
if(env['platform'] == 'windows'):
env_assimp.Append(CPPDEFINES=['PLATFORM_WINDOWS'])
env_assimp.Append(CPPDEFINES=[('PLATFORM', 'WINDOWS')])
elif(env['platform'] == 'x11'):
elif(env['platform'] == 'linuxbsd'):
env_assimp.Append(CPPDEFINES=['PLATFORM_LINUX'])
env_assimp.Append(CPPDEFINES=[('PLATFORM', 'LINUX')])
elif(env['platform'] == 'osx'):
Expand Down
4 changes: 2 additions & 2 deletions modules/mono/build_scripts/mono_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def copy_file(src_dir, dst_dir, name):


def is_desktop(platform):
return platform in ['windows', 'osx', 'x11', 'server', 'uwp', 'haiku']
return platform in ['windows', 'osx', 'linuxbsd', 'server', 'uwp', 'haiku']


def is_unix_like(platform):
return platform in ['osx', 'x11', 'server', 'android', 'haiku']
return platform in ['osx', 'linuxbsd', 'server', 'android', 'haiku']


def module_supports_tools_on(platform):
Expand Down
2 changes: 1 addition & 1 deletion modules/mono/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def can_build(env, platform):


def configure(env):
if env['platform'] not in ['windows', 'osx', 'x11', 'server', 'android', 'haiku', 'javascript']:
if env['platform'] not in ['windows', 'osx', 'linuxbsd', 'server', 'android', 'haiku', 'javascript']:
raise RuntimeError('This module does not currently support building for this platform')

env.use_ptrcall = True
Expand Down
2 changes: 1 addition & 1 deletion modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static class Platforms
{
public const string Windows = "windows";
public const string OSX = "osx";
public const string X11 = "x11";
public const string X11 = "linuxbsd";
public const string Server = "server";
public const string UWP = "uwp";
public const string Haiku = "haiku";
Expand Down
6 changes: 3 additions & 3 deletions modules/webm/libvpx/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ if env["platform"] == 'uwp':
webm_cpu_x86 = True
else:
import platform
is_x11_or_server_arm = ((env["platform"] == 'x11' or env["platform"] == 'server') and (platform.machine().startswith('arm') or platform.machine().startswith('aarch')))
is_x11_or_server_arm = ((env["platform"] == 'linuxbsd' or env["platform"] == 'server') and (platform.machine().startswith('arm') or platform.machine().startswith('aarch')))
is_ios_x86 = (env["platform"] == 'iphone' and ("arch" in env and env["arch"].startswith('x86')))
is_android_x86 = (env["platform"] == 'android' and env["android_arch"].startswith('x86'))
if is_android_x86:
cpu_bits = '32' if env["android_arch"] == 'x86' else '64'
webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86)
webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'linuxbsd' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86)
webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or (not is_android_x86 and env["platform"] == 'android')

if webm_cpu_x86:
Expand Down Expand Up @@ -330,7 +330,7 @@ if webm_cpu_x86:
if webm_cpu_arm:
if env["platform"] == 'iphone':
env_libvpx["ASFLAGS"] = '-arch armv7'
elif env["platform"] == 'android' and env["android_arch"] == 'armv7' or env["platform"] == 'x11' or env["platform"] == 'server':
elif env["platform"] == 'android' and env["android_arch"] == 'armv7' or env["platform"] == 'linuxbsd' or env["platform"] == 'server':
env_libvpx["ASFLAGS"] = '-mfpu=neon'
elif env["platform"] == 'uwp':
env_libvpx["AS"] = 'armasm'
Expand Down
4 changes: 2 additions & 2 deletions platform/linuxbsd/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ def configure(env):
print("Warning: Creating template binaries enabled for PCK embedding is currently only supported with GNU ld")
else:
if float(gnu_ld_version.group(1)) >= 2.30:
env.Append(LINKFLAGS=['-T', 'platform/linuxbsd/pck_embed.ld'])
env.Append(LINKFLAGS=['-T', 'platform/linuxbsd/pck_embed.ld'])
else:
env.Append(LINKFLAGS=['-T', 'platform/linuxbsd/pck_embed.legacy.ld'])
env.Append(LINKFLAGS=['-T', 'platform/linuxbsd/pck_embed.legacy.ld'])

## Cross-compilation

Expand Down
Loading