Skip to content

Commit f616e29

Browse files
authored
Merge pull request #6359 from markrtuttle/cmake-on-big-sur-arm2
Build with /usr/bin/clang on MacOS
2 parents cdaa7a1 + c2effbf commit f616e29

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
cmake_minimum_required(VERSION 3.2)
22

3+
# Compile with /usr/bin/clang on MacOS
4+
# See https://github.com/diffblue/cbmc/issues/4956
5+
#
6+
if (CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
7+
if(NOT DEFINED CMAKE_C_COMPILER)
8+
message(STATUS "Setting CMAKE_C_COMPILER to /usr/bin/clang for MacOS")
9+
set(CMAKE_C_COMPILER "/usr/bin/clang")
10+
endif()
11+
endif()
12+
313
# If cmake generates files inside of the cbmc source directory this can lead to important files being overwritten, so we prevent that here
414
if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
515
message(FATAL_ERROR

0 commit comments

Comments
 (0)