From c765ae495aa25714023d2cf2bcf6a9873da06184 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 21 Jan 2019 10:23:03 -0500 Subject: CMakeDetermineCompilerABI: pass verbose flag during compilation Default to the same flag that is used for verbose link information, but provide another internal platform information variable to use a compilation-specific variant. Populate it for CUDA where we use a different compiler for compilation and linking and therefore need different flags. Co-Author: Chuck Cranor --- Modules/CMakeDetermineCompilerABI.cmake | 6 ++++++ Modules/Compiler/NVIDIA-CUDA.cmake | 1 + 2 files changed, 7 insertions(+) diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index d88f2ed..14f4da0 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -16,8 +16,13 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) # Compile the ABI identification source. set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_${lang}.bin") set(CMAKE_FLAGS ) + set(COMPILE_DEFINITIONS ) if(DEFINED CMAKE_${lang}_VERBOSE_FLAG) set(CMAKE_FLAGS "-DEXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}") + set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_FLAG}") + endif() + if(DEFINED CMAKE_${lang}_VERBOSE_COMPILE_FLAG) + set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_COMPILE_FLAG}") endif() if(NOT "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC") # Avoid adding our own platform standard libraries for compilers @@ -30,6 +35,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) CMAKE_FLAGS ${CMAKE_FLAGS} # Ignore unused flags when we are just determining the ABI. "--no-warn-unused-cli" + COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} OUTPUT_VARIABLE OUTPUT COPY_FILE "${BIN}" COPY_FILE_ERROR _copy_error diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 05db548..de9dd99 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -1,4 +1,5 @@ set(CMAKE_CUDA_VERBOSE_FLAG "-v") +set(CMAKE_CUDA_VERBOSE_COMPILE_FLAG "-Xcompiler=-v") if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CUDA_COMPILE_OPTIONS_PIE -Xcompiler=-fPIE) -- cgit v0.12