Skip to content

Commit

Permalink
Make it possible to disable automatic compiler selection
Browse files Browse the repository at this point in the history
  • Loading branch information
milasudril committed Jun 13, 2021
1 parent 273bd39 commit 6b733e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions maikeconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
],
"std_revision": {
"min": "c++17"
}
},
"always_use_default_compiler": 1
},
"recipe": "recipes/cxx_compiler.py"
},
Expand All @@ -54,7 +55,8 @@
],
"std_revision": {
"min": "c++17"
}
},
"always_use_default_compiler": 1
},
"recipe": "recipes/cxx_compiler.py"
},
Expand Down
7 changes: 5 additions & 2 deletions recipes/cxx_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ def select_cpp_rev(compiler, rev):
if default_rev > max_num:
return rev['max']

def get_compiler_alternatives(compiler):
def get_compiler_alternatives(compiler, always_use_default):
if always_use_default:
return [compiler]

ret = []
for path in os.environ['PATH'].split(':'):
try:
Expand Down Expand Up @@ -178,7 +181,7 @@ def select_compiler_and_stdrev(compilers, stdrev):

def configure(cfg):
if 'std_revision' in cfg:
compiler_alternatives = get_compiler_alternatives(default_compiler)
compiler_alternatives = get_compiler_alternatives(default_compiler, cfg['always_use_default_compiler'] if 'always_use_default_compiler' in cfg else False)
sel = select_compiler_and_stdrev(compiler_alternatives, cfg['std_revision'])
cfg['backend'] = sel[0]
if sel[1] != '':
Expand Down

0 comments on commit 6b733e9

Please sign in to comment.