From 01325170a63edbd4c9725cf77201cc60089a190d Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Tue, 7 Sep 2021 16:01:02 +0200 Subject: [PATCH] feat: make LEANC_CC configurable --- src/CMakeLists.txt | 2 +- src/bin/leanc.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8909e2ed68..ee05e85b97 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -63,7 +63,7 @@ option(BSYMBOLIC "Link with -Bsymbolic to reduce call overhead in shared librari option(CHECK_OLEAN_VERSION "Only load .olean files compiled with the current version of Lean" ON) set(LEAN_EXTRA_MAKE_OPTS "" CACHE STRING "extra options to lean --make") -set(MINGW_LOCAL_DIR "C:/msys64/mingw64/bin" CACHE STRING "where to find MSYS2 required DLLs and binaries") +set(LEANC_CC "cc" CACHE STRING "C compiler to use in `leanc`") if ("${FAKE_FREE}" MATCHES "ON") set(LEAN_EXTRA_CXX_FLAGS "${LEAN_EXTRA_CXX_FLAGS} -D LEAN_FAKE_FREE") diff --git a/src/bin/leanc.in b/src/bin/leanc.in index d9725f829d..66b3f3e0fb 100755 --- a/src/bin/leanc.in +++ b/src/bin/leanc.in @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Lean compiler # -# A simple wrapper around a C compiler. Defaults to the compiler Lean was built with, +# A simple wrapper around a C compiler. Defaults to `@LEANC_CC@`, # which can be overridden with the environment variable `LEAN_CC`. All parameters are passed # as-is to the wrapped compiler. # @@ -44,6 +44,6 @@ for arg in "$@"; do esac done -[ -n "$LEAN_CC" ] || LEAN_CC=cc +[ -n "$LEAN_CC" ] || LEAN_CC="@LEANC_CC@" $LEAN_CC "${cflags[@]}" "${args[@]}" "${ldflags_ext[@]}" "${ldflags[@]}" -Wno-unused-command-line-argument