make : fix incorrect GF_CC_VER for CUDA host compiler

We intentionally craft a GF_CC for CUDA that will fail but print the
desired version anyway. So instead of checking whether the version
command was successful, we need to check if the command printed
anything.
This commit is contained in:
Jared Van Bortel 2024-02-18 16:08:42 -05:00
parent d42a8bf134
commit b51b78ea90

View file

@ -1,6 +1,6 @@
ifeq '' '$(findstring clang,$(shell $(GF_CC) --version))'
GF_CC_IS_GCC = 1
GF_CC_VER := $(shell { $(GF_CC) -dumpfullversion 2>/dev/null || $(GF_CC) -dumpversion; } | awk -F. '{ printf("%02d%02d%02d", $$1, $$2, $$3) }')
GF_CC_VER := $(shell { $(GF_CC) -dumpfullversion 2>/dev/null; echo; $(GF_CC) -dumpversion; } | awk -F. '/./ { printf("%02d%02d%02d", $$1, $$2, $$3); exit }')
else
GF_CC_IS_CLANG = 1
ifeq '' '$(findstring Apple,$(shell $(GF_CC) --version))'