diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt index 312ab84f65ee6..3bb4cb80f51bc 100644 --- a/cpp/src/gandiva/CMakeLists.txt +++ b/cpp/src/gandiva/CMakeLists.txt @@ -93,6 +93,16 @@ endif() set(GANDIVA_SHARED_LINK_LIBS arrow_shared LLVM::LLVM_HEADERS) set(GANDIVA_SHARED_PRIVATE_LINK_LIBS LLVM::LLVM_LIBS ${GANDIVA_OPENSSL_TARGETS} Boost::headers) +if(MSVC) + set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK") + if(IS_DIRECTORY ${MSVC_DIA_SDK_DIR}) + set(GANDIVA_DIA_GUIDS_LIB "${MSVC_DIA_SDK_DIR}/lib/amd64/diaguids.lib") + string(REGEX REPLACE "\\\\" "\\\\\\\\" GANDIVA_DIA_GUIDS_LIB_ESCAPED + "${GANDIVA_DIA_GUIDS_LIB}") + list(APPEND GANDIVA_SHARED_PRIVATE_LINK_LIBS GANDIVA_DIA_GUIDS_LIB_ESCAPED) + endif() +endif() + set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_HEADERS