From kde-commits Tue Dec 15 23:29:41 2015 From: Patrick Spendrin Date: Tue, 15 Dec 2015 23:29:41 +0000 To: kde-commits Subject: [emerge] /: Add modifier option for msvc2013 64bit cross compiler Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=145022219218700 Git commit e63d3f494df325ce547748144d79171ab52cbb24 by Patrick Spendrin. Committed on 15/12/2015 at 23:29. Pushed by sengels into branch 'master'. Add modifier option for msvc2013 64bit cross compiler If you want to use the 64 bit cross compiler, then you need to call x86_amd64 for the vcvarsall.bat M +4 -2 bin/EmergeSetupHelper.py M +4 -0 bin/compiler.py M +3 -0 kdesettings.ini http://commits.kde.org/emerge/e63d3f494df325ce547748144d79171ab52cbb24 diff --git a/bin/EmergeSetupHelper.py b/bin/EmergeSetupHelper.py index d2be811..db80cae 100644 --- a/bin/EmergeSetupHelper.py +++ b/bin/EmergeSetupHelper.py @@ -89,9 +89,11 @@ class SetupHelper( object ): "msvc2013": "VS120COMNTOOLS", "msvc2015": "VS140COMNTOOLS" } - architectures =3D { "x86": "x86", "x64": "amd64" } + architectures =3D { "x86": "x86", "x64": "amd64", "x64_cross":= "x86_amd64" } + crossmodifier =3D "" + if not compiler.isNative(): crossmodifier=3D"_cross" status, result =3D subprocess.getstatusoutput( "\"%s\\..\\..\\= VC\\vcvarsall.bat\" %s > NUL && set" % ( - os.getenv( compilerDirs[ compiler.getCompilerName( ) ] ), = architectures[ compiler.architecture( ) ]) ) + os.getenv( compilerDirs[ compiler.getCompilerName( ) ] ), = architectures[ compiler.architecture( ) + crossmodifier ]) ) if status !=3D 0: print( "Failed to setup msvc compiler", file =3D sys.stder= r ) out =3D self.stringToEnv( result ) diff --git a/bin/compiler.py b/bin/compiler.py index fa04520..8c3fe5a 100644 --- a/bin/compiler.py +++ b/bin/compiler.py @@ -33,6 +33,9 @@ def _getGCCTarget(): def architecture(): return emergeSettings.get("General", "Architecture" ) = +def isNative(): + return emergeSettings.getboolean("General", "Native", True) + def isX64(): return architecture() =3D=3D "x64" = @@ -140,5 +143,6 @@ if __name__ =3D=3D '__main__': print("Testing Compiler.py") print("Version: %s" % getVersion()) print("Compiler Name: %s" % getCompilerName()) + print("Native compiler: %s" % ("No", "Yes")[isNative()]) print("Compiler Version: %s" % getMinGWVersion()) = diff --git a/kdesettings.ini b/kdesettings.ini index ef222f9..5f0c4f2 100644 --- a/kdesettings.ini +++ b/kdesettings.ini @@ -11,6 +11,9 @@ KDECOMPILER =3D mingw4 ## possible values x86 or x64 Architecture =3D x86 +## This option should be set to False if you use the msvc 201X Express Edi= tion 64bit compiler +## in all other cases, simply keep this option commented out +#Native=3DFalse = ## This option can be used to override the default make program ## change the value to the path of the executable you want to use instead.