libcryfs/CMakeLists.txt

63 lines
2.3 KiB
CMake
Raw Normal View History

2021-01-15 05:00:19 +01:00
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
2019-10-20 17:57:58 +02:00
# TODO Remove this deprecated policy switch once we're on cmake 3.4 or later
cmake_policy(SET CMP0065 OLD)
2018-05-19 23:42:00 +02:00
# TODO Perf test:
# - try if setting CRYPTOPP_NATIVE_ARCH=ON and adding -march=native to the compile commands for cryfs source files makes a difference
# -> if yes, offer a cmake option to enable both of these
2022-06-22 22:32:05 +02:00
#set(ANDROID_ABI arm64-v8a)
#set(ANDROID_NDK /ndk/23.1.7779620/)
#set(ANDROID_PLATFORM android-21)
#set(ANDROID_TOOLCHAIN clang)
#
#set(CMAKE_SYSTEM_NAME Android)
#set(CMAKE_SYSTEM_VERSION 21)
#set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
#set(CMAKE_ANDROID_NDK ${ANDROID_NDK})
#set(CMAKE_ANDROID_STL_TYPE c++_static)
#
#set(CMAKE_TOOLCHAIN_FILE ${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake)
#set(ANDROID TRUE) # Current toolchain file doesn't set this variable which is needed by spdlog
2022-06-18 21:11:24 +02:00
project(cryfs)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake-utils)
include(utils)
2015-02-17 01:02:15 +01:00
require_gcc_version(7.0)
require_clang_version(7.0)
2015-03-16 02:15:51 +01:00
# Default value is not to build test cases
2018-05-20 23:11:54 +02:00
option(BUILD_TESTING "build test cases" OFF)
2022-06-18 21:11:24 +02:00
option(CRYFS_UPDATE_CHECKS "let cryfs check for updates and security vulnerabilities" OFF)
option(DISABLE_OPENMP "allow building without OpenMP libraries. This will cause performance degradations." OFF)
# The following options are helpful for development and/or CI
option(USE_WERROR "build with -Werror flag")
option(USE_CLANG_TIDY "build with clang-tidy checks enabled" OFF)
2018-10-21 11:46:27 +02:00
option(USE_IWYU "build with iwyu checks enabled" OFF)
option(CLANG_TIDY_WARNINGS_AS_ERRORS "treat clang-tidy warnings as errors" OFF)
if (MSVC)
option(DOKAN_PATH "Location of the Dokan library, e.g. C:\\Program Files\\Dokan\\DokanLibrary-1.1.0" "")
endif()
2018-11-10 22:25:15 +01:00
# Default value is to build in release mode but with debug symbols
if(NOT CMAKE_BUILD_TYPE)
2018-11-10 22:25:15 +01:00
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE INTERNAL "CMAKE_BUILD_TYPE")
endif(NOT CMAKE_BUILD_TYPE)
# We don't use LTO because crypto++ has problems with it, see https://github.com/weidai11/cryptopp/issues/1031 and https://www.cryptopp.com/wiki/Link_Time_Optimization
2018-07-18 06:08:17 +02:00
# The MSVC version on AppVeyor CI needs this
if(MSVC)
add_definitions(/bigobj)
endif()
2022-06-18 21:11:24 +02:00
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2020-02-24 09:51:48 +01:00
add_subdirectory(vendor EXCLUDE_FROM_ALL)
add_subdirectory(src)