Skip to content

Build with /usr/bin/clang on MacOS #6359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
cmake_minimum_required(VERSION 3.2)

# Compile with /usr/bin/clang on MacOS
# See https://github.com/diffblue/cbmc/issues/4956
#
if (CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
if(NOT DEFINED CMAKE_C_COMPILER)
message(STATUS "Setting CMAKE_C_COMPILER to /usr/bin/clang for MacOS")
set(CMAKE_C_COMPILER "/usr/bin/clang")
endif()
endif()

# If cmake generates files inside of the cbmc source directory this can lead to important files being overwritten, so we prevent that here
if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message(FATAL_ERROR
Expand Down