aocc: help compiler find include paths and libstdc++.so (#40450)
Add --gcc-toolchain option by default. Only add these paths if c++ libs and include files are available and the compiler was built with gcc
This commit is contained in:
parent
3c54177c5d
commit
e49f55ba53
@ -91,3 +91,13 @@ def license_reminder(self):
|
||||
def install(self, spec, prefix):
|
||||
print("Installing AOCC Compiler ... ")
|
||||
install_tree(".", prefix)
|
||||
|
||||
@run_after("install")
|
||||
def cfg_files(self):
|
||||
# Add path to gcc/g++ such that clang/clang++ can always find a full gcc installation
|
||||
# including libstdc++.so and header files.
|
||||
if self.spec.satisfies("%gcc") and self.compiler.cxx is not None:
|
||||
compiler_options = "--gcc-toolchain={}".format(self.compiler.prefix)
|
||||
for compiler in ["clang", "clang++"]:
|
||||
with open(join_path(self.prefix.bin, "{}.cfg".format(compiler)), "w") as f:
|
||||
f.write(compiler_options)
|
||||
|
Loading…
Reference in New Issue
Block a user