adjust for erroneous detection of nvc as gcc (#24915)

* adjust for erroneous detection of nvc as gcc

adjust for erroneous detection of nvc as gcc when it is built with gcc

* add missing parenthesis :/

* fix trailing whitespace

* re-work hdf5 patch for nvc to make it more general

* flake8 fixes

* Render as comment

Render intended note as a comment rather than logical constraint

Co-authored-by: Frank Willmore <willmore@anl.gov>
This commit is contained in:
Frank Willmore 2021-08-02 13:13:32 -05:00 committed by GitHub
parent 413ea10e78
commit 0df067e64f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,11 +188,12 @@ def flag_handler(self, name, flags):
cmake_flags = []
if name == "cflags":
cc_name = os.path.basename(self.compiler.cc)
if "clang" in cc_name or "gcc" in cc_name:
if self.spec.satisfies('%gcc') \
or self.spec.satisfies('%clang'):
# Quiet warnings/errors about implicit declaration of functions
# in C99:
cmake_flags.append("-Wno-implicit-function-declaration")
# Note that this flag will cause an error if building %nvhpc.
if self.spec.satisfies('@:1.8.12~shared'):
# More recent versions set CMAKE_POSITION_INDEPENDENT_CODE to
# True and build with PIC flags.