From dc1efa8a058da0bdc7e6878822ee746410e3b96b Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Mon, 23 Feb 2015 00:35:43 +0100 Subject: [PATCH] Fix develop.py for cygwin invocation --- indra/cmake/00-Common.cmake | 17 +++++++++++------ indra/develop.py | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 973111b8d..139a10b3c 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -96,15 +96,20 @@ if (WINDOWS) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244") endif(WORD_SIZE EQUAL 32) - if (MSVC12) - # configure win32 API for windows vista+ compatibility - set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") - add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}") - else (MSVC12) + if (WORD_SIZE EQUAL 32) # configure win32 API for windows XP+ compatibility set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}") - endif (MSVC12) + else (WORD_SIZE EQUAL 32) + # configure win32 API for windows vista+ compatibility + set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") + add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}") + endif (WORD_SIZE EQUAL 32) + + # Use special XP-compatible toolchain on 32-bit builds + if (MSVC12 AND (WORD_SIZE EQUAL 32)) + set(CMAKE_GENERATOR_TOOLSET "v120xp") + endif (MSVC12 AND (WORD_SIZE EQUAL 32)) # Are we using the crummy Visual Studio KDU build workaround? if (NOT DISABLE_FATAL_WARNINGS) diff --git a/indra/develop.py b/indra/develop.py index add325c41..018003c87 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -779,6 +779,22 @@ class CygwinSetup(WindowsSetup): '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' '%(opts)s "%(dir)s"' % args) + def run(self, command, name=None): + '''Run a program. If the program fails, raise an exception.''' + ret = os.system(command) + if ret: + if name is None: + name = os.path.normpath(shlex.split(command.encode('utf8'),posix=False)[0].strip('"')) + + path = self.find_in_path(name) + if not path: + ret = 'was not found' + else: + ret = 'exited with status %d' % ret + raise CommandError('the command %r %s' % + (name, ret)) + + setup_platform = { 'darwin': DarwinSetup, 'linux2': LinuxSetup,