Merge branch 'main' into beta

This commit is contained in:
David Capello 2021-04-15 10:35:36 -03:00
commit 5bd83d0c1a
3 changed files with 37 additions and 0 deletions

View File

@ -17,6 +17,11 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: ccache
uses: hendrikmuhs/ccache-action@v1
if: runner.os == 'Linux'
with:
key: ${{ matrix.os }}-${{ matrix.enable_ui }}
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'

View File

@ -78,6 +78,7 @@ option(ENABLE_DEVMODE "Compile vesion for developers" off)
option(ENABLE_UI "Compile UI (turn off to compile CLI-only version)" on)
option(FULLSCREEN_PLATFORM "Enable fullscreen by default" off)
option(ENABLE_CLANG_TIDY "Enable static analysis" off)
option(ENABLE_CCACHE "Use CCache to improve recompilation speed (optional)" on)
set(CUSTOM_WEBSITE_URL "" CACHE STRING "Enable custom local webserver to check updates")
if(ENABLE_NEWS OR ENABLE_UPDATER)
@ -169,6 +170,14 @@ set(ZLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib)
# Search in the "cmake" directory for additional CMake modules.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(ENABLE_CCACHE)
find_package(CCache)
if(CCache_FOUND)
# Use e.g. "ccache clang++" instead of "clang++"
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCache_EXECUTABLE}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCache_EXECUTABLE}")
endif()
endif()
# Put libraries into "lib".
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)

23
cmake/FindCCache.cmake Normal file
View File

@ -0,0 +1,23 @@
# To find CCache compiler cache
include(FindPackageHandleStandardArgs)
find_program(CCache_EXECUTABLE ccache)
if (CCache_EXECUTABLE)
execute_process(COMMAND "${CCache_EXECUTABLE}" --version
OUTPUT_VARIABLE CCache_VERSION_OUTPUT
)
if (CCache_VERSION_OUTPUT MATCHES "version ([0-9]+\\.[0-9]+\\.[0-9]+)")
set(CCache_VERSION "${CMAKE_MATCH_1}")
endif ()
endif (CCache_EXECUTABLE)
find_package_handle_standard_args(CCache
FOUND_VAR CCache_FOUND
REQUIRED_VARS CCache_EXECUTABLE
VERSION_VAR CCache_VERSION
)
mark_as_advanced(CCache_EXECUTABLE)