forked from OSchip/llvm-project
[LLVM] Fix GetErrcMessages.cmake module for WoA
GetErrcMessages.cmake module makes use of cmake's try_run which by default builds its sources in debug mode unless configured with CMAKE_TRY_COMPILE_CONFIGURATION. Debug builds on Windows sometimes fail when appropraite DLLs are not included in path. Also on Windows on Arm machines debug builds sometimes fail to link the correct debug DLLs. To fix this I am setting CMAKE_TRY_COMPILE_CONFIGURATION to active build configuration of currently configured LLVM project. This makes sure we select same build type for try_run/try_compile cmake modules as currently configured LLVM project. Reviewed By: zero9178 Differential Revision: https://reviews.llvm.org/D133482
This commit is contained in:
parent
2d60d7ba1a
commit
b816895b0e
|
@ -105,6 +105,20 @@ Learn more about these options in our documentation at https://llvm.org/docs/CMa
|
|||
")
|
||||
endif()
|
||||
|
||||
# Set default build type for cmake's try_compile module.
|
||||
# CMake 3.17 or newer sets CMAKE_DEFAULT_BUILD_TYPE to one of the
|
||||
# items from CMAKE_CONFIGURATION_TYPES. Logic below can be further
|
||||
# simplified once LLVM's minimum CMake version is updated to 3.17.
|
||||
if(CMAKE_DEFAULT_BUILD_TYPE)
|
||||
set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_DEFAULT_BUILD_TYPE})
|
||||
else()
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
list(GET CMAKE_CONFIGURATION_TYPES 0 CMAKE_TRY_COMPILE_CONFIGURATION)
|
||||
elseif(CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Side-by-side subprojects layout: automatically set the
|
||||
# LLVM_EXTERNAL_${project}_SOURCE_DIR using LLVM_ALL_PROJECTS
|
||||
# This allows an easy way of setting up a build directory for llvm and another
|
||||
|
|
Loading…
Reference in New Issue