Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake: Convert the libcryptsetup library
- Loading branch information
1 parent
f46d2b4
commit 521dad4
Showing
5 changed files
with
429 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Copyright (c) 2014-present, Facebook, Inc. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed in accordance with the terms specified in | ||
# the LICENSE file found in the root directory of this source tree. | ||
|
||
function(libcryptsetupMain) | ||
set(library_root "${CMAKE_CURRENT_SOURCE_DIR}/src") | ||
|
||
add_library(thirdparty_libcryptsetup | ||
"${library_root}/lib/crypto_backend/pbkdf_check.c" | ||
"${library_root}/lib/crypto_backend/crc32.c" | ||
"${library_root}/lib/crypto_backend/crypto_cipher_kernel.c" | ||
"${library_root}/lib/crypto_backend/crypto_storage.c" | ||
"${library_root}/lib/crypto_backend/crypto_gcrypt.c" | ||
"${library_root}/lib/luks1/af.c" | ||
"${library_root}/lib/luks1/keyencryption.c" | ||
"${library_root}/lib/luks1/keymanage.c" | ||
"${library_root}/lib/loopaes/loopaes.c" | ||
"${library_root}/lib/verity/verity_hash.c" | ||
"${library_root}/lib/verity/verity.c" | ||
"${library_root}/lib/tcrypt/tcrypt.c" | ||
"${library_root}/lib/utils_device.c" | ||
"${library_root}/lib/libdevmapper.c" | ||
"${library_root}/lib/utils_wipe.c" | ||
"${library_root}/lib/utils.c" | ||
"${library_root}/lib/utils_benchmark.c" | ||
"${library_root}/lib/setup.c" | ||
"${library_root}/lib/utils_crypt.c" | ||
"${library_root}/lib/utils_loop.c" | ||
"${library_root}/lib/utils_devpath.c" | ||
"${library_root}/lib/utils_fips.c" | ||
"${library_root}/lib/volumekey.c" | ||
"${library_root}/lib/crypt_plain.c" | ||
"${library_root}/lib/random.c" | ||
"${library_root}/src/utils_tools.c" | ||
"${library_root}/src/utils_password.c" | ||
) | ||
|
||
target_compile_definitions(thirdparty_libcryptsetup PRIVATE | ||
DATADIR="/usr/share" | ||
HAVE_CONFIG_H | ||
LIBDIR="/usr/lib" | ||
LOCALEDIR="/usr/share/locale" | ||
PREFIX="/usr" | ||
SYSCONFDIR="/etc" | ||
VERSION="1.7.5" | ||
) | ||
|
||
target_compile_options(thirdparty_libcryptsetup PRIVATE | ||
-include config.h | ||
) | ||
|
||
target_link_libraries(thirdparty_libcryptsetup PUBLIC | ||
global_c_settings | ||
thirdparty_util-linux | ||
thirdparty_libgcrypt | ||
thirdparty_popt | ||
) | ||
|
||
target_link_libraries(thirdparty_libcryptsetup PRIVATE | ||
thirdparty_source_module_warnings | ||
) | ||
|
||
target_include_directories(thirdparty_libcryptsetup PRIVATE | ||
"${CMAKE_CURRENT_SOURCE_DIR}/config" | ||
"${library_root}" | ||
"${library_root}/lib" | ||
"${library_root}/lib/crypto_backend" | ||
"${library_root}/lib/loopaes" | ||
"${library_root}/lib/luks1" | ||
"${library_root}/lib/tcrypt" | ||
"${library_root}/lib/verity" | ||
"${library_root}/src" | ||
) | ||
|
||
target_include_directories(thirdparty_libcryptsetup SYSTEM INTERFACE | ||
"${library_root}/lib" | ||
) | ||
endfunction() | ||
|
||
libcryptsetupMain() |
Oops, something went wrong.