From 14643643c979c3dea1869b951af8a2bd938ca10b Mon Sep 17 00:00:00 2001 From: Qingyao Sun Date: Thu, 23 Apr 2020 05:14:20 -0600 Subject: [PATCH] Fix compatibility problem with CMake policy CMP0025 (#2277) Signed-off-by: Qingyao Sun --- docs/CONTRIBUTORS | 1 + verilator-config.cmake.in | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index dedbf3726..7c70a0722 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -33,6 +33,7 @@ Patrick Stewart Peter Monsson Philipp Wagner Pieter Kapsenberg +Qingyao Sun Richard Myers Sean Cross Sebastien Van Cauwenberghe diff --git a/verilator-config.cmake.in b/verilator-config.cmake.in index 458b74c49..50edfdcd9 100644 --- a/verilator-config.cmake.in +++ b/verilator-config.cmake.in @@ -163,7 +163,9 @@ function(verilate TARGET) endforeach() string(TOLOWER ${CMAKE_CXX_COMPILER_ID} COMPILER) - if (NOT COMPILER MATCHES "msvc|clang") + if (COMPILER STREQUAL "appleclang") + set(COMPILER clang) + elseif (NOT COMPILER MATCHES "^msvc$|^clang$") set(COMPILER gcc) endif()