Improve gcc detection in llvm. (#20189)
Co-authored-by: Tom Scogland <tom.scogland@gmail.com> Co-authored-by: Thomas Green <ca-tgreen@gw4a64fxlogin00.head.gw4.metoffice.gov.uk>
This commit is contained in:
parent
56904d5834
commit
58d5b73ba4
1 changed files with 10 additions and 1 deletions
|
@ -499,7 +499,16 @@ def cmake_args(self):
|
|||
cmake_args.append("-DLIBOMP_TSAN_SUPPORT=ON")
|
||||
|
||||
if self.compiler.name == "gcc":
|
||||
gcc_prefix = ancestor(self.compiler.cc, 2)
|
||||
compiler = Executable(self.compiler.cc)
|
||||
gcc_output = compiler('-print-search-dirs', output=str, error=str)
|
||||
|
||||
for line in gcc_output.splitlines():
|
||||
if line.startswith("install:"):
|
||||
# Get path and strip any whitespace
|
||||
# (causes oddity with ancestor)
|
||||
gcc_prefix = line.split(":")[1].strip()
|
||||
gcc_prefix = ancestor(gcc_prefix, 4)
|
||||
break
|
||||
cmake_args.append("-DGCC_INSTALL_PREFIX=" + gcc_prefix)
|
||||
|
||||
if spec.satisfies("@4.0.0:"):
|
||||
|
|
Loading…
Reference in a new issue