-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[godot] fixing platform/windows/detect.py
- Loading branch information
Showing
3 changed files
with
145 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
diff --git a/modules/SCsub b/modules/SCsub | ||
index fcc01e2..56bb473 100644 | ||
--- a/modules/SCsub | ||
+++ b/modules/SCsub | ||
@@ -5,6 +5,17 @@ import os | ||
|
||
Import("env") | ||
|
||
+from os.path import join | ||
+vcpkg_installed_dir = os.environ["VCPKG_INSTALLED_DIR"] | ||
+vcpkg_include_dir = join(vcpkg_installed_dir, "include") | ||
+env.Prepend(CPPPATH=[vcpkg_include_dir]) | ||
+ | ||
+vcpkg_lib_dir = join(vcpkg_installed_dir, "lib") | ||
+env.Prepend(LIBPATH=[vcpkg_lib_dir]) | ||
+ | ||
+vcpkg_bin_dir = join(vcpkg_installed_dir, "bin") | ||
+env.Prepend(RPATH=[vcpkg_bin_dir]) | ||
+ | ||
env_modules = env.Clone() | ||
|
||
Export("env_modules") | ||
diff --git a/platform/windows/detect.py b/platform/windows/detect.py | ||
index 6e56f2a..cf49624 100644 | ||
--- a/platform/windows/detect.py | ||
+++ b/platform/windows/detect.py | ||
@@ -652,6 +652,103 @@ def configure(env: "Environment"): | ||
setup_mingw(env) | ||
env.msvc = False | ||
|
||
+ # FIXME: Check for existence of the libs before parsing their flags with pkg-config | ||
+ | ||
+ # freetype depends on libpng and zlib, so bundling one of them while keeping others | ||
+ # as shared libraries leads to weird issues. And graphite and harfbuzz need freetype. | ||
+ ft_linked_deps = [ | ||
+ env["builtin_freetype"], | ||
+ env["builtin_libpng"], | ||
+ env["builtin_zlib"], | ||
+ env["builtin_graphite"], | ||
+ env["builtin_harfbuzz"], | ||
+ ] | ||
+ if (not all(ft_linked_deps)) and any(ft_linked_deps): # All or nothing. | ||
+ print( | ||
+ "These libraries should be either all builtin, or all system provided:\n" | ||
+ "freetype, libpng, zlib, graphite, harfbuzz.\n" | ||
+ "Please specify `builtin_<name>=no` for all of them, or none." | ||
+ ) | ||
+ sys.exit(255) | ||
+ | ||
+ if not env["builtin_freetype"]: | ||
+ env.ParseConfig("pkg-config freetype2 --cflags --libs") | ||
+ | ||
+ if not env["builtin_graphite"]: | ||
+ env.ParseConfig("pkg-config graphite2 --cflags --libs") | ||
+ | ||
+ if not env["builtin_icu4c"]: | ||
+ env.ParseConfig("pkg-config icu-i18n icu-uc --cflags --libs") | ||
+ | ||
+ if not env["builtin_harfbuzz"]: | ||
+ env.ParseConfig("pkg-config harfbuzz harfbuzz-icu --cflags --libs") | ||
+ | ||
+ if not env["builtin_libpng"]: | ||
+ env.ParseConfig("pkg-config libpng16 --cflags --libs") | ||
+ | ||
+ if not env["builtin_enet"]: | ||
+ env.ParseConfig("pkg-config libenet --cflags --libs") | ||
+ | ||
+ if not env["builtin_squish"]: | ||
+ # libsquish doesn't reliably install its .pc file, so some distros lack it. | ||
+ env.Append(LIBS=["libsquish"]) | ||
+ | ||
+ if not env["builtin_zstd"]: | ||
+ env.ParseConfig("pkg-config libzstd --cflags --libs") | ||
+ | ||
+ if not env["builtin_brotli"]: | ||
+ env.ParseConfig("pkg-config libbrotlicommon libbrotlidec --cflags --libs") | ||
+ | ||
+ # Sound and video libraries | ||
+ # Keep the order as it triggers chained dependencies (ogg needed by others, etc.) | ||
+ | ||
+ if not env["builtin_libtheora"]: | ||
+ env["builtin_libogg"] = False # Needed to link against system libtheora | ||
+ env["builtin_libvorbis"] = False # Needed to link against system libtheora | ||
+ env.ParseConfig("pkg-config theora theoradec --cflags --libs") | ||
+ | ||
+ | ||
+ if not env["builtin_libvorbis"]: | ||
+ env["builtin_libogg"] = False # Needed to link against system libvorbis | ||
+ env.ParseConfig("pkg-config vorbis vorbisfile --cflags --libs") | ||
+ | ||
+ if not env["builtin_libogg"]: | ||
+ env.ParseConfig("pkg-config ogg --cflags --libs") | ||
+ | ||
+ if not env["builtin_libwebp"]: | ||
+ env.ParseConfig("pkg-config libwebp --cflags --libs") | ||
+ | ||
+ if not env["builtin_mbedtls"]: | ||
+ # mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228 | ||
+ env.Append(LIBS=["mbedtls", "mbedcrypto", "mbedx509"]) | ||
+ | ||
+ # if not env["builtin_wslay"]: | ||
+ # env.ParseConfig("pkg-config libwslay --cflags --libs") | ||
+ | ||
+ if not env["builtin_miniupnpc"]: | ||
+ env.Append(LIBS=["miniupnpc"]) | ||
+ | ||
+ # On Linux wchar_t should be 32-bits | ||
+ # 16-bit library shouldn't be required due to compiler optimizations | ||
+ if not env["builtin_pcre2"]: | ||
+ env.ParseConfig("pkg-config libpcre2-32 --cflags --libs") | ||
+ | ||
+ # if not env["builtin_recastnavigation"]: | ||
+ # # No pkgconfig file so far, hardcode default paths. | ||
+ # env.Prepend(CPPPATH=["/usr/include/recastnavigation"]) | ||
+ # env.Append(LIBS=["Recast"]) | ||
+ | ||
+ if not env["builtin_embree"] and env["arch"] in ["x86_64", "arm64"]: | ||
+ # No pkgconfig file so far, hardcode expected lib name. | ||
+ env.Append(LIBS=["embree3"]) | ||
+ | ||
+ # if not env["builtin_openxr"]: | ||
+ # env.ParseConfig("pkg-config openxr --cflags --libs") | ||
+ | ||
+ # Linkflags below this line should typically stay the last ones | ||
+ if not env["builtin_zlib"]: | ||
+ env.ParseConfig("pkg-config zlib --cflags --libs") | ||
+ | ||
# Now set compiler/linker flags | ||
if env.msvc: | ||
configure_msvc(env, vcvars_msvc_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ | |
"host": true | ||
}, | ||
"zlib", | ||
"pcg", | ||
"zstd" | ||
], | ||
"features": { | ||
|