Skip to content

Commit

Permalink
Handle build directories for specific versions of gcc/clang:
Browse files Browse the repository at this point in the history
* Example: gcc.Debug will use the the default version of gcc installed on the
  system. gcc-9.Debug will use version 9, regardless of the default. This will
  be most useful when the default is older than required or desired.
  • Loading branch information
ximinez authored and manojsdoshi committed Feb 12, 2020
1 parent 5ff23f8 commit 3753840
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Builds/Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,17 @@ def run_cmake(directory, cmake_dir, args):
args += ( '-DCMAKE_BUILD_TYPE=Debug', )
if re.search('release', cmake_dir):
args += ( '-DCMAKE_BUILD_TYPE=Release', )
if re.search('gcc', cmake_dir):
m = re.search('gcc(-[^.]*)', cmake_dir)
if m:
args += ( '-DCMAKE_C_COMPILER=' + m.group(0),
'-DCMAKE_CXX_COMPILER=g++' + m.group(1), )
elif re.search('gcc', cmake_dir):
args += ( '-DCMAKE_C_COMPILER=gcc', '-DCMAKE_CXX_COMPILER=g++', )
if re.search('clang', cmake_dir):
m = re.search('clang(-[^.]*)', cmake_dir)
if m:
args += ( '-DCMAKE_C_COMPILER=' + m.group(0),
'-DCMAKE_CXX_COMPILER=clang++' + m.group(1), )
elif re.search('clang', cmake_dir):
args += ( '-DCMAKE_C_COMPILER=clang', '-DCMAKE_CXX_COMPILER=clang++', )

args += ( os.path.join('..', '..', '..'), )
Expand Down

0 comments on commit 3753840

Please sign in to comment.