Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The MSYS build is almost fully working except for one strange issue: sometimes getcwd() returns an invalid path. This seems to always happen when running via Explorer. Running via command line, especially if \msys64\usr\bin is on the PATH, seems to work great.
- Loading branch information
Showing
15 changed files
with
107 additions
and
26 deletions.
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
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,34 @@ | ||
#!/usr/bin/env python3 | ||
# This script goes through an MSYS2 deployment and copies all the required | ||
# dependencies from the system directory. All executables (EXE, DLL) are | ||
# checked. | ||
|
||
import sys, os, shutil, subprocess, re, platform | ||
if not platform.system().startswith('MSYS_'): | ||
raise Exception('Please run under MSYS') | ||
system_bin = '/usr/bin' | ||
objdump_cmd = '/usr/bin/objdump' | ||
root = os.path.abspath(sys.argv[1]) | ||
if root.startswith('/usr'): | ||
print('msys_deps.py will not copy system libraries to a destination under /usr') | ||
binaries = set(filter(lambda n: os.path.splitext(n)[1].lower() in ['.exe', '.dll'], | ||
os.listdir(root))) | ||
while binaries: | ||
binary = binaries.pop() | ||
if binary.startswith('lib'): | ||
# Not an MSYS library. | ||
continue | ||
print('--', binary) | ||
bin_path = os.path.join(root, binary) | ||
deps = subprocess.check_output([objdump_cmd, '-p', bin_path]).decode() | ||
for deps_line in deps.split('\n'): | ||
found = re.search('DLL Name: (.*)', deps_line) | ||
if found: | ||
dll_name = found.group(1).strip() | ||
dll_path = os.path.join(system_bin, dll_name) | ||
dest_path = os.path.join(root, dll_name) | ||
if os.path.exists(dll_path) and not os.path.exists(dest_path): | ||
# Copy this dependency. | ||
print(dll_path) | ||
shutil.copy(dll_path, dest_path) | ||
binaries.add(dest_path) |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
include (PlatformGenericUnix) | ||
|
||
set (DE_PLATFORM_SUFFIX windows) | ||
set (DE_AMETHYST_PLATFORM WIN32) | ||
|
||
set (DE_INSTALL_DATA_DIR "data") | ||
set (DE_INSTALL_DOC_DIR "doc") | ||
#set (DE_INSTALL_LIB_DIR "bin") | ||
|
||
add_definitions ( | ||
-D__USE_BSD | ||
-DWINVER=0x0601 | ||
-D_WIN32_WINNT=0x0601 | ||
-D_GNU_SOURCE=1 | ||
-DDE_PLATFORM_ID="win-${DE_ARCH}" | ||
-DDE_WINDOWS=1 | ||
-DDE_MSYS=1 | ||
) | ||
|
||
if (CMAKE_COMPILER_IS_GNUCXX) | ||
append_unique (CMAKE_CXX_FLAGS -Werror=return-type) | ||
append_unique (CMAKE_CXX_FLAGS -fdiagnostics-color) | ||
endif () | ||
|
||
# All symbols are hidden by default. | ||
append_unique (CMAKE_C_FLAGS "-fvisibility=hidden") | ||
append_unique (CMAKE_CXX_FLAGS "-fvisibility=hidden") |
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
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
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