mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-09 20:39:27 +00:00
Simplified argon2/CMakeLists.txt.
This commit is contained in:
parent
1d4bbbf6aa
commit
4c5af7c03c
1 changed files with 6 additions and 18 deletions
24
src/3rdparty/argon2/CMakeLists.txt
vendored
24
src/3rdparty/argon2/CMakeLists.txt
vendored
|
@ -7,16 +7,6 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
add_library(argon2-interface INTERFACE)
|
|
||||||
target_include_directories(argon2-interface INTERFACE
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
||||||
$<INSTALL_INTERFACE:include>
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(argon2-internal INTERFACE)
|
|
||||||
target_include_directories(argon2-internal INTERFACE lib lib/blake2)
|
|
||||||
target_link_libraries(argon2-internal INTERFACE argon2-interface)
|
|
||||||
|
|
||||||
add_library(argon2 STATIC
|
add_library(argon2 STATIC
|
||||||
lib/argon2.c
|
lib/argon2.c
|
||||||
lib/core.c
|
lib/core.c
|
||||||
|
@ -26,15 +16,14 @@ add_library(argon2 STATIC
|
||||||
lib/blake2/blake2.c
|
lib/blake2/blake2.c
|
||||||
)
|
)
|
||||||
|
|
||||||
set_property(TARGET argon2 PROPERTY VERSION ${Upstream_VERSION})
|
target_include_directories(argon2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
set_property(TARGET argon2 PROPERTY SOVERSION 1)
|
target_include_directories(argon2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||||
set_property(TARGET argon2 PROPERTY INTERFACE_ARGON2_MAJOR_VERSION 1)
|
|
||||||
set_property(TARGET argon2 APPEND PROPERTY COMPATIBLE_INTERFACE_STRING ARGON2_MAJOR_VERSION)
|
|
||||||
|
|
||||||
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||||
function(add_feature_impl FEATURE MSVC_FLAG DEF)
|
function(add_feature_impl FEATURE MSVC_FLAG DEF)
|
||||||
add_library(argon2-${FEATURE} STATIC arch/x86_64/lib/argon2-${FEATURE}.c)
|
add_library(argon2-${FEATURE} STATIC arch/x86_64/lib/argon2-${FEATURE}.c)
|
||||||
target_link_libraries(argon2-${FEATURE} PRIVATE argon2-internal)
|
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
|
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||||
set_target_properties(argon2-${FEATURE} PROPERTIES POSITION_INDEPENDENT_CODE True)
|
set_target_properties(argon2-${FEATURE} PROPERTIES POSITION_INDEPENDENT_CODE True)
|
||||||
|
|
||||||
target_compile_options(argon2-${FEATURE} PRIVATE ${MSVC_FLAG})
|
target_compile_options(argon2-${FEATURE} PRIVATE ${MSVC_FLAG})
|
||||||
|
@ -52,7 +41,8 @@ if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||||
elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
function(add_feature_impl FEATURE GCC_FLAG DEF)
|
function(add_feature_impl FEATURE GCC_FLAG DEF)
|
||||||
add_library(argon2-${FEATURE} STATIC arch/x86_64/lib/argon2-${FEATURE}.c)
|
add_library(argon2-${FEATURE} STATIC arch/x86_64/lib/argon2-${FEATURE}.c)
|
||||||
target_link_libraries(argon2-${FEATURE} PRIVATE argon2-internal)
|
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
|
target_include_directories(argon2-${FEATURE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||||
set_target_properties(argon2-${FEATURE} PROPERTIES POSITION_INDEPENDENT_CODE True)
|
set_target_properties(argon2-${FEATURE} PROPERTIES POSITION_INDEPENDENT_CODE True)
|
||||||
|
|
||||||
message("-- argon2: detecting feature '${FEATURE}'...")
|
message("-- argon2: detecting feature '${FEATURE}'...")
|
||||||
|
@ -81,8 +71,6 @@ elseif (NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
target_link_libraries(argon2 PUBLIC argon2-${FEATURE})
|
target_link_libraries(argon2 PUBLIC argon2-${FEATURE})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
target_include_directories(argon2-internal INTERFACE arch/x86_64/lib)
|
|
||||||
|
|
||||||
add_feature_impl(sse2 -msse2 HAVE_SSE2)
|
add_feature_impl(sse2 -msse2 HAVE_SSE2)
|
||||||
add_feature_impl(ssse3 -mssse3 HAVE_SSSE3)
|
add_feature_impl(ssse3 -mssse3 HAVE_SSSE3)
|
||||||
add_feature_impl(xop -mxop HAVE_XOP)
|
add_feature_impl(xop -mxop HAVE_XOP)
|
||||||
|
|
Loading…
Reference in a new issue