27 lines
725 B
CMake
27 lines
725 B
CMake
cmake_minimum_required(VERSION 3.10)
|
|
|
|
project(libaes VERSION 0.0.1 LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(SOURCES)
|
|
if (USE_WIN_CRYPTO)
|
|
list(APPEND SOURCES aes_win32.cpp)
|
|
else ()
|
|
# Tiny AES in C (https://github.com/kokke/tiny-AES-c/)
|
|
# is licensed under the Unlicense license.
|
|
list(APPEND SOURCES aes.cpp)
|
|
endif ()
|
|
|
|
add_library(libaes STATIC ${SOURCES})
|
|
target_include_directories(libaes
|
|
PUBLIC
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
|
)
|
|
if (USE_WIN_CRYPTO)
|
|
target_link_libraries(libaes PRIVATE bcrypt)
|
|
target_compile_definitions(libaes PRIVATE USE_WIN_CRYPTO=1)
|
|
endif ()
|