diff --git a/cmake/modules/CheckCompiler.cmake b/cmake/modules/CheckCompiler.cmake index 883bf0e2daed1..1bc02b134bfa5 100644 --- a/cmake/modules/CheckCompiler.cmake +++ b/cmake/modules/CheckCompiler.cmake @@ -9,7 +9,14 @@ #--------------------------------------------------------------------------------------------------- if(NOT CMAKE_CXX_COMPILER_ID MATCHES "(Apple|)Clang|GNU|Intel|MSVC") - message(WARNING "Unsupported compiler: ${CMAKE_CXX_COMPILER_ID}.") + if (CMAKE_CXX_COMPILER_ID MATCHES "NVHPC") + message(WARNING "NVHPC compiler is only supported at best effort level.") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "24.11.0") + message(WARNING "Minimum version of NVHPC compiler is 24.11 . Version ${CMAKE_CXX_COMPILER_VERSION} detected.") + endif() + else() + message(WARNING "Unsupported compiler: ${CMAKE_CXX_COMPILER_ID}.") + endif() endif() if(NOT GENERATOR_IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) diff --git a/interpreter/cling/lib/Interpreter/CMakeLists.txt b/interpreter/cling/lib/Interpreter/CMakeLists.txt index e397da97f6bda..7639cbc58ecb5 100644 --- a/interpreter/cling/lib/Interpreter/CMakeLists.txt +++ b/interpreter/cling/lib/Interpreter/CMakeLists.txt @@ -242,24 +242,34 @@ if (UNIX) endif() if(NOT CLING_CXX_HEADERS) - if (CLING_CXX_PATH) - execute_process(COMMAND ${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS} -xc++ -E -v /dev/null + + if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "NVHPC") + execute_process(COMMAND ${CLING_CXX_RLTV} -drygccinc OUTPUT_QUIET ERROR_VARIABLE CLING_CXX_HEADERS) - set(CLING_CXX_PATH "${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS}") + execute_process( + COMMAND echo ${CLING_CXX_HEADERS} + COMMAND sed s/:/\\\n/g + OUTPUT_VARIABLE CLING_CXX_HEADERS) else() - # convert CMAKE_CXX_FLAGS to a list for execute_process - string(REPLACE "-fdiagnostics-color=always" "" cling_tmp_arg_list ${CMAKE_CXX_FLAGS}) - string(REPLACE "-fcolor-diagnosics" "" cling_tmp_arg_list ${cling_tmp_arg_list}) - string(REPLACE " " ";" cling_tmp_arg_list ${cling_tmp_arg_list}) - execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} ${cling_tmp_arg_list} -xc++ -E -v /dev/null - OUTPUT_QUIET ERROR_VARIABLE CLING_CXX_HEADERS) + if (CLING_CXX_PATH) + execute_process(COMMAND ${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS} -xc++ -E -v /dev/null + OUTPUT_QUIET ERROR_VARIABLE CLING_CXX_HEADERS) + set(CLING_CXX_PATH "${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS}") + else() + # convert CMAKE_CXX_FLAGS to a list for execute_process + string(REPLACE "-fdiagnostics-color=always" "" cling_tmp_arg_list ${CMAKE_CXX_FLAGS}) + string(REPLACE "-fcolor-diagnosics" "" cling_tmp_arg_list ${cling_tmp_arg_list}) + string(REPLACE " " ";" cling_tmp_arg_list ${cling_tmp_arg_list}) + execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} ${cling_tmp_arg_list} -xc++ -E -v /dev/null + OUTPUT_QUIET ERROR_VARIABLE CLING_CXX_HEADERS) + endif() + + execute_process( + COMMAND echo ${CLING_CXX_HEADERS} + COMMAND sed -n -e /^.include/,\$\{ -e /^\\\ \\\/.*++/p -e \} + OUTPUT_VARIABLE CLING_CXX_HEADERS) endif() - execute_process( - COMMAND echo ${CLING_CXX_HEADERS} - COMMAND sed -n -e /^.include/,\$\{ -e /^\\\ \\\/.*++/p -e \} - OUTPUT_VARIABLE CLING_CXX_HEADERS) - stripNewLine("${CLING_CXX_HEADERS}" CLING_CXX_HEADERS) endif()