1 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
5 # This module is shared by multiple languages; use include blocker.
9 set(__COMPILER_NVHPC 1)
13 macro(__compiler_nvhpc lang)
14 # Logic specific to NVHPC.
16 if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 21.07)
17 set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
18 set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
19 set(CMAKE_${lang}_DEPENDS_USE_COMPILER TRUE)
21 # Before NVHPC 21.07 the `-MD` flag implicitly
22 # implies `-E` and therefore compilation and dependency generation
23 # can't occur in the same invocation
24 set(CMAKE_${lang}_DEPENDS_EXTRA_COMMANDS "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> ${CMAKE_${lang}_COMPILE_OPTIONS_EXPLICIT_LANGUAGE} -M <SOURCE> -MT <OBJECT> -MD<DEP_FILE>")