diff options
author | Robin Dunn <robin@alldunn.com> | 2013-05-30 18:47:08 -0700 |
---|---|---|
committer | Robin Dunn <robin@alldunn.com> | 2013-05-30 18:47:08 -0700 |
commit | bc5c6a48f7d749ce05b37e8ce8662efd11f1816b (patch) | |
tree | 41b75ab5c9b1889145f0e6057e11ddcaaef5cdef /setup.py | |
parent | 17e7a7fb95e248af5d1429d5e06cc6f660abce36 (diff) |
Add --jom and --jobs options.
--jom will use jom instead of nmake for msvc builds
--jobs will set the number of build jobs (-jN passed to make or jom)
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -100,7 +100,9 @@ OPTION_LISTVERSIONS = has_option("list-versions") OPTION_MAKESPEC = option_value("make-spec") OPTION_IGNOREGIT = has_option("ignore-git") OPTION_MSVCVERSION = option_value("msvc-version") -OPTION_NOEXAMPLES = has_option("no-examples") +OPTION_NOEXAMPLES = has_option("no-examples") # don't include pyside-examples +OPTION_JOBS = option_value('jobs') # number of parallel build jobs +OPTION_JOM = has_option('jom') # use jom instead of nmake with msvc if OPTION_QMAKE is None: OPTION_QMAKE = find_executable("qmake") @@ -127,9 +129,25 @@ else: print("Invalid option --make-spec. Available values are %s" % (["make"])) sys.exit(1) +if OPTION_JOM: + if OPTION_MAKESPEC != "msvc": + print("Option --jom can only be used with msvc") + sys.exit(1) + +if OPTION_JOBS: + if sys.platform == 'win32' and not OPTION_JOM: + print("Option --jobs can only be used with --jom on Windows.") + sys.exit(1) + else: + if not OPTION_JOBS.startswith('-j'): + OPTION_JOBS = '-j' + OPTION_JOBS +else: + OPTION_JOBS = '' + if sys.platform == 'darwin' and OPTION_STANDALONE: print("--standalone option does not yet work on OSX") + # Show available versions if OPTION_LISTVERSIONS: for v in submodules: @@ -285,8 +303,12 @@ class pyside_build(_build): make_name = "make" make_generator = "Unix Makefiles" elif OPTION_MAKESPEC == "msvc": - make_name = "nmake" - make_generator = "NMake Makefiles" + if OPTION_JOM: + make_name = "jom" + make_generator = "NMake Makefiles JOM" + else: + make_name = "nmake" + make_generator = "NMake Makefiles" elif OPTION_MAKESPEC == "mingw": make_name = "mingw32-make" make_generator = "MinGW Makefiles" @@ -419,6 +441,7 @@ class pyside_build(_build): log.info("-" * 3) log.info("Make path: %s" % self.make_path) log.info("Make generator: %s" % self.make_generator) + log.info("Make jobs: %s" % OPTION_JOBS) log.info("-" * 3) log.info("Script directory: %s" % self.script_dir) log.info("Sources directory: %s" % self.sources_dir) @@ -893,4 +916,4 @@ setup( # dist with the full platform info. #ext_modules = [Extension('QtCore', [])], ext_package = 'PySide', -)
\ No newline at end of file +) |