Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
de2cde61
Kaydet (Commit)
de2cde61
authored
Şub 20, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Detect Win64 builds.
üst
71322121
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
10 deletions
+39
-10
msvccompiler.py
Lib/distutils/msvccompiler.py
+39
-10
No files found.
Lib/distutils/msvccompiler.py
Dosyayı görüntüle @
de2cde61
...
...
@@ -172,6 +172,20 @@ def get_build_version():
# else we don't know what version of the compiler this is
return
None
def
get_build_architecture
():
"""Return the processor architecture.
Possible results are "Intel", "Itanium", or "AMD64".
"""
prefix
=
" bit ("
i
=
string
.
find
(
sys
.
version
,
prefix
)
if
i
==
-
1
:
return
"Intel"
j
=
string
.
find
(
sys
.
version
,
")"
,
i
)
return
sys
.
version
[
i
+
len
(
prefix
):
j
]
class
MSVCCompiler
(
CCompiler
)
:
"""Concrete class that implements an interface to Microsoft Visual C++,
...
...
@@ -206,11 +220,19 @@ class MSVCCompiler (CCompiler) :
def
__init__
(
self
,
verbose
=
0
,
dry_run
=
0
,
force
=
0
):
CCompiler
.
__init__
(
self
,
verbose
,
dry_run
,
force
)
self
.
__version
=
get_build_version
()
if
self
.
__version
>=
7
:
self
.
__root
=
r"Software\Microsoft\VisualStudio"
self
.
__macros
=
MacroExpander
(
self
.
__version
)
self
.
__arch
=
get_build_architecture
()
if
self
.
__arch
==
"Intel"
:
# x86
if
self
.
__version
>=
7
:
self
.
__root
=
r"Software\Microsoft\VisualStudio"
self
.
__macros
=
MacroExpander
(
self
.
__version
)
else
:
self
.
__root
=
r"Software\Microsoft\Devstudio"
self
.
__product
=
"Visual Studio version
%
s"
%
self
.
__version
else
:
self
.
__root
=
r"Software\Microsoft\Devstudio"
# Win64. Assume this was built with the platform SDK
self
.
__product
=
"Microsoft SDK compiler
%
s"
%
(
self
.
__version
+
6
)
self
.
initialized
=
False
def
initialize
(
self
):
...
...
@@ -228,9 +250,9 @@ class MSVCCompiler (CCompiler) :
if
len
(
self
.
__paths
)
==
0
:
raise
DistutilsPlatformError
,
\
(
"Python was built with
version
%
s of Visual Studio
, "
(
"Python was built with
%
s
, "
"and extensions need to be built with the same "
"version of the compiler, but it isn't installed."
%
self
.
__
version
)
"version of the compiler, but it isn't installed."
%
self
.
__
product
)
self
.
cc
=
self
.
find_exe
(
"cl.exe"
)
self
.
linker
=
self
.
find_exe
(
"link.exe"
)
...
...
@@ -249,10 +271,17 @@ class MSVCCompiler (CCompiler) :
os
.
environ
[
'path'
]
=
string
.
join
(
self
.
__paths
,
';'
)
self
.
preprocess_options
=
None
self
.
compile_options
=
[
'/nologo'
,
'/Ox'
,
'/MD'
,
'/W3'
,
'/GX'
,
'/DNDEBUG'
]
self
.
compile_options_debug
=
[
'/nologo'
,
'/Od'
,
'/MDd'
,
'/W3'
,
'/GX'
,
'/Z7'
,
'/D_DEBUG'
]
if
self
.
__arch
==
"Intel"
:
self
.
compile_options
=
[
'/nologo'
,
'/Ox'
,
'/MD'
,
'/W3'
,
'/GX'
,
'/DNDEBUG'
]
self
.
compile_options_debug
=
[
'/nologo'
,
'/Od'
,
'/MDd'
,
'/W3'
,
'/GX'
,
'/Z7'
,
'/D_DEBUG'
]
else
:
# Win64
self
.
compile_options
=
[
'/nologo'
,
'/Ox'
,
'/MD'
,
'/W3'
,
'/GS-'
,
'/DNDEBUG'
]
self
.
compile_options_debug
=
[
'/nologo'
,
'/Od'
,
'/MDd'
,
'/W3'
,
'/GS-'
,
'/Z7'
,
'/D_DEBUG'
]
self
.
ldflags_shared
=
[
'/DLL'
,
'/nologo'
,
'/INCREMENTAL:NO'
]
if
self
.
__version
>=
7
:
...
...
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