Skip to content

Commit fc33aa9

Browse files
authored
[llvm][cmake] Quote CMAKE_CXX_COMPILER_ID in string comparison (llvm#133332)
We're seeing following configuration error when building the `runtimes` target on our buildbots: ``` CMake Error at /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/llvm/cmake/modules/CheckProblematicConfigurations.cmake:14 (if): if given arguments: "STREQUAL" "MSVC" Unknown arguments specified Call Stack (most recent call first): /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/llvm/cmake/modules/HandleLLVMOptions.cmake:10 (include) CMakeLists.txt:175 (include) ``` If I understand correctly this happens because ${CMAKE_CXX_COMPILER_ID} is empty. Quoting it should make the comparison work for those cases.
1 parent 5e1fba4 commit fc33aa9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/cmake/modules/CheckProblematicConfigurations.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endmacro()
1111

1212
# MSVC and /arch:AVX is untested and have created problems before. See:
1313
# https://github.com/llvm/llvm-project/issues/54645
14-
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
14+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
1515
string(TOLOWER "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}" _FLAGS)
1616
if(_FLAGS MATCHES "/arch:avx[0-9]*")
1717
log_problematic("Compiling LLVM with MSVC and the /arch:AVX flag is known to cause issues with parts of LLVM.\nSee https://github.com/llvm/llvm-project/issues/54645 for details.\nUse clang-cl if you want to enable AVX instructions.")

0 commit comments

Comments
 (0)