From 21b3c444820c9d35ffdcf711383492a2bd354a2c Mon Sep 17 00:00:00 2001 From: Roman Lacko Date: Wed, 31 Jul 2013 15:24:26 +0200 Subject: Don't try to init msvc environment if it's already initialized --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 0013c78d5..d7a733b6d 100644 --- a/setup.py +++ b/setup.py @@ -301,10 +301,6 @@ class pyside_build(_build): platform_arch = platform.architecture()[0] log.info("Python architecture is %s" % platform_arch) - # Try to init the MSVC environment - if sys.platform == "win32" and OPTION_MAKESPEC == "msvc": - init_msvc_env(OPTION_MSVCVERSION, platform_arch, log) - # Check env make_path = None make_generator = None @@ -313,6 +309,12 @@ class pyside_build(_build): make_name = "make" make_generator = "Unix Makefiles" elif OPTION_MAKESPEC == "msvc": + nmake_path = find_executable("nmake") + if nmake_path is None or not os.path.exists(nmake_path): + log.info("nmake not found. Trying to initialize the MSVC env...") + init_msvc_env(OPTION_MSVCVERSION, platform_arch, log) + else: + log.info("nmake was found in %s" % nmake_path) if OPTION_JOM: make_name = "jom" make_generator = "NMake Makefiles JOM" -- cgit v1.2.3