Files
Eric Kilmer 1b415d616b Use system compiler to build (#516)
* Don't use vcpkg clang to build remill in build script

* Don't manually set compiler within CMakeLists.txt & Fix ccache detection

* Simplify ccache usage

Don't use a macro since we just immediately invoke it

* Turn on CMAKE_ENABLE_EXPORTS to fix tests

Not sure exactly why the updated CMake version affected this, but it
did.

See https://cmake.org/cmake/help/latest/variable/CMAKE_ENABLE_EXPORTS.html#variable:CMAKE_ENABLE_EXPORTS

* Bump number of build jobs in Dockerfile
2021-05-17 15:13:17 -04:00

29 lines
1.0 KiB
CMake

# Copyright (c) 2018-present Trail of Bits, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
find_program(ccache_path ccache)
if("${ccache_path}" STREQUAL "ccache_path-NOTFOUND")
message(STATUS "ccache: Not found")
else()
set(CMAKE_C_COMPILER_LAUNCHER "${ccache_path}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${ccache_path}")
set(ccache_dir "$ENV{CCACHE_DIR}")
if("${ccache_dir}" STREQUAL "")
set(ccache_dir "$ENV{HOME}/.ccache")
endif()
message(STATUS "ccache: enabled with '${ccache_path}'. The cache folder is located here: '${ccache_dir}'")
endif()