Skip to content

Commit

Permalink
Adding Skral's changes (#1)
Browse files Browse the repository at this point in the history
Creating a single branch with all the Windows changes.
  • Loading branch information
Michael Morehouse committed May 31, 2016
1 parent 77127c1 commit e181977
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/rez/backport/shutilwhich.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def _access_check(fn, mode):
path.insert(0, os.curdir)

# PATHEXT is necessary to check on Windows.
pathext = env.get("PATHEXT", "").split(os.pathsep)
default_pathext = \
'.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
pathext = env.get("PATHEXT", default_pathext).split(os.pathsep)
# See if the given file matches any of the expected path extensions.
# This will allow us to short circuit when given "python.exe".
matches = [cmd for ext in pathext if cmd.lower().endswith(ext.lower())]
Expand Down
3 changes: 2 additions & 1 deletion src/rez/bind/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def commands():

def bind(path, version_range=None, opts=None, parser=None):
exepath = find_exe("cmake", getattr(opts, "exe", None))
version = extract_version(exepath, "--version")
version = extract_version(exepath, "--version",
word_index=2 if os.name == 'nt' else -1)
check_version(version, version_range)

def make_root(variant, root):
Expand Down
4 changes: 2 additions & 2 deletions src/rez/cli/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def command(opts, parser, extra_arg_groups=None):
from rez.pip import pip_install_package

if opts.py_ver:
pyvers = opts.py_ver.strip(',').split(',')
py_vers = opts.py_ver.strip(',').split(',')
else:
pyvers = None
py_vers = None

pip_install_package(opts.PACKAGE,
pip_version=opts.pip_ver,
Expand Down
13 changes: 8 additions & 5 deletions src/rezplugins/build_system/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def _pr(s):
cmd += (self.build_args or [])

cmd.append("-DCMAKE_INSTALL_PREFIX=%s" % install_path)
cmd.append("-DCMAKE_MODULE_PATH=%s" % sh.get_key_token("CMAKE_MODULE_PATH"))
cmd.append("-DCMAKE_MODULE_PATH=%s" %
sh.get_key_token("CMAKE_MODULE_PATH").replace('\\', '/'))
cmd.append("-DCMAKE_BUILD_TYPE=%s" % self.build_target)
cmd.append("-DREZ_BUILD_TYPE=%s" % build_type.name)
cmd.append("-DREZ_BUILD_INSTALL=%d" % (1 if install else 0))
Expand Down Expand Up @@ -174,9 +175,11 @@ def _pr(s):
cmd = ["make"]
cmd += (self.child_build_args or [])

if not any(x.startswith("-j") for x in (self.child_build_args or [])):
n = variant.config.build_thread_count
cmd.append("-j%d" % n)
# nmake has no -j
if self.settings.make_binary != 'nmake':
if not any(x.startswith("-j") for x in (self.child_build_args or [])):
n = variant.config.build_thread_count
cmd.append("-j%d" % n)

# execute make within the build env
_pr("\nExecuting: %s" % ' '.join(cmd))
Expand Down Expand Up @@ -204,7 +207,7 @@ def _add_build_actions(executor, context, package, variant, build_type):
cmake_path = os.path.join(os.path.dirname(__file__), "cmake_files")
template_path = os.path.join(os.path.dirname(__file__), "template_files")

executor.env.CMAKE_MODULE_PATH.append(cmake_path)
executor.env.CMAKE_MODULE_PATH.append(cmake_path.replace('\\', '/'))
executor.env.REZ_BUILD_DOXYFILE = os.path.join(template_path, 'Doxyfile')
executor.env.REZ_BUILD_VARIANT_INDEX = variant.index or 0
executor.env.REZ_BUILD_THREAD_COUNT = package.config.build_thread_count
Expand Down
3 changes: 3 additions & 0 deletions src/rezplugins/build_system/cmake_files/RezPipInstall.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ macro (rez_pip_install)
set(install_cmd "")
endif()

# PIP on Windows doesn't like forward slashes for the --install-scripts argument
file(TO_NATIVE_PATH ${destbinpath} destbinpath)

ExternalProject_add(
${label}
URL ${url}
Expand Down
2 changes: 1 addition & 1 deletion src/rezplugins/shell/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_syspaths(cls):
def _bind_interactive_rez(self):
if config.set_prompt and self.settings.prompt:
stored_prompt = os.getenv("REZ_STORED_PROMPT")
curr_prompt = stored_prompt or os.getenv("PROMPT", "foobar")
curr_prompt = stored_prompt or os.getenv("PROMPT", "")
if not stored_prompt:
self.setenv("REZ_STORED_PROMPT", curr_prompt)

Expand Down

0 comments on commit e181977

Please sign in to comment.