Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
b044e7d3
Commit
b044e7d3
authored
Aug 18, 2017
by
Rémi Verschelde
Committed by
GitHub
Aug 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10426 from akien-mga/drop-old-mingw32
Windows: Drop support for obsolete MinGW
parents
18a73153
6afa0875
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
35 deletions
+20
-35
detect.py
platform/windows/detect.py
+20
-35
No files found.
platform/windows/detect.py
View file @
b044e7d3
...
...
@@ -14,69 +14,56 @@ def get_name():
def
can_build
():
if
(
os
.
name
==
"nt"
):
#
building natively on windows!
if
(
os
.
getenv
(
"VCINSTALLDIR"
)):
#
Building natively on Windows
if
(
os
.
getenv
(
"VCINSTALLDIR"
)):
# MSVC
return
True
else
:
print
(
"
\n
MSVC not detected, attempting MinGW."
)
mingw32
=
""
mingw64
=
""
if
(
os
.
getenv
(
"MINGW32_PREFIX"
)):
mingw32
=
os
.
getenv
(
"MINGW32_PREFIX"
)
if
(
os
.
getenv
(
"MINGW64_PREFIX"
)):
mingw64
=
os
.
getenv
(
"MINGW64_PREFIX"
)
test
=
"gcc --version > NUL 2>&1"
if
os
.
system
(
test
)
!=
0
and
os
.
system
(
mingw32
+
test
)
!=
0
and
os
.
system
(
mingw64
+
test
)
!=
0
:
print
(
"- could not detect gcc."
)
print
(
"Please, make sure a path to a MinGW /bin directory is accessible into the environment PATH.
\n
"
)
return
False
else
:
print
(
"- gcc detected."
)
print
(
"MSVC not detected (no VCINSTALLDIR environment variable), attempting MinGW."
)
mingw32
=
""
mingw64
=
""
if
(
os
.
getenv
(
"MINGW32_PREFIX"
)):
mingw32
=
os
.
getenv
(
"MINGW32_PREFIX"
)
if
(
os
.
getenv
(
"MINGW64_PREFIX"
)):
mingw64
=
os
.
getenv
(
"MINGW64_PREFIX"
)
test
=
"gcc --version > NUL 2>&1"
if
(
os
.
system
(
test
)
==
0
or
os
.
system
(
mingw32
+
test
)
==
0
or
os
.
system
(
mingw64
+
test
)
==
0
):
return
True
if
(
os
.
name
==
"posix"
):
mingw
=
"i586-mingw32msvc-"
mingw64
=
"x86_64-w64-mingw32-"
# Cross-compiling with MinGW-w64 (old MinGW32 is not supported)
mingw32
=
"i686-w64-mingw32-"
mingw64
=
"x86_64-w64-mingw32-"
if
(
os
.
getenv
(
"MINGW32_PREFIX"
)):
mingw32
=
os
.
getenv
(
"MINGW32_PREFIX"
)
mingw
=
mingw32
if
(
os
.
getenv
(
"MINGW64_PREFIX"
)):
mingw64
=
os
.
getenv
(
"MINGW64_PREFIX"
)
test
=
"gcc --version > /dev/null 2>&1"
if
(
os
.
system
(
mingw
+
test
)
==
0
or
os
.
system
(
mingw
64
+
test
)
==
0
or
os
.
system
(
mingw32
+
test
)
==
0
):
if
(
os
.
system
(
mingw64
+
test
)
==
0
or
os
.
system
(
mingw32
+
test
)
==
0
):
return
True
print
(
"Could not detect MinGW. Ensure its binaries are in your PATH or that MINGW32_PREFIX or MINGW64_PREFIX are properly defined."
)
return
False
def
get_opts
():
mingw
=
""
mingw32
=
""
mingw64
=
""
if
(
os
.
name
==
"posix"
):
mingw
=
"i586-mingw32msvc-"
mingw32
=
"i686-w64-mingw32-"
mingw64
=
"x86_64-w64-mingw32-"
if
os
.
system
(
mingw32
+
"gcc --version > /dev/null 2>&1"
)
!=
0
:
mingw32
=
mingw
if
(
os
.
getenv
(
"MINGW32_PREFIX"
)):
mingw32
=
os
.
getenv
(
"MINGW32_PREFIX"
)
mingw
=
mingw32
if
(
os
.
getenv
(
"MINGW64_PREFIX"
)):
mingw64
=
os
.
getenv
(
"MINGW64_PREFIX"
)
return
[
(
'mingw_prefix
'
,
'MinGW Prefix
'
,
mingw32
),
(
'mingw_prefix_64'
,
'MinGW
Prefix 64 bits
'
,
mingw64
),
(
'mingw_prefix
_32'
,
'MinGW prefix (Win32)
'
,
mingw32
),
(
'mingw_prefix_64'
,
'MinGW
prefix (Win64)
'
,
mingw64
),
]
...
...
@@ -88,12 +75,10 @@ def get_flags():
def
build_res_file
(
target
,
source
,
env
):
cmdbase
=
""
if
(
env
[
"bits"
]
==
"32"
):
cmdbase
=
env
[
'mingw_prefix'
]
cmdbase
=
env
[
'mingw_prefix
_32
'
]
else
:
cmdbase
=
env
[
'mingw_prefix_64'
]
CPPPATH
=
env
[
'CPPPATH'
]
cmdbase
=
cmdbase
+
'windres --include-dir . '
import
subprocess
for
x
in
range
(
len
(
source
)):
...
...
@@ -249,7 +234,7 @@ def configure(env):
env
.
Append
(
LINKFLAGS
=
[
'-static'
])
env
.
Append
(
LINKFLAGS
=
[
'-static-libgcc'
])
env
.
Append
(
LINKFLAGS
=
[
'-static-libstdc++'
])
mingw_prefix
=
env
[
"mingw_prefix"
]
mingw_prefix
=
env
[
"mingw_prefix
_32
"
]
else
:
env
.
Append
(
LINKFLAGS
=
[
'-static'
])
mingw_prefix
=
env
[
"mingw_prefix_64"
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment