From 4c5af7c03c21334c1f722b69c666dae4d49cb3bf Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 17 Aug 2019 19:16:37 +0700 Subject: [PATCH] Simplified argon2/CMakeLists.txt. --- src/3rdparty/argon2/CMakeLists.txt | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/3rdparty/argon2/CMakeLists.txt b/src/3rdparty/argon2/CMakeLists.txt index a28f39e8d..30900b0bc 100644 --- a/src/3rdparty/argon2/CMakeLists.txt +++ b/src/3rdparty/argon2/CMakeLists.txt @@ -7,16 +7,6 @@ set(CMAKE_C_STANDARD_REQUIRED ON) include(CheckCSourceCompiles) -add_library(argon2-interface INTERFACE) -target_include_directories(argon2-interface INTERFACE - $ - $ -) - -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 lib/argon2.c lib/core.c @@ -26,15 +16,14 @@ add_library(argon2 STATIC lib/blake2/blake2.c ) -set_property(TARGET argon2 PROPERTY VERSION ${Upstream_VERSION}) -set_property(TARGET argon2 PROPERTY SOVERSION 1) -set_property(TARGET argon2 PROPERTY INTERFACE_ARGON2_MAJOR_VERSION 1) -set_property(TARGET argon2 APPEND PROPERTY COMPATIBLE_INTERFACE_STRING ARGON2_MAJOR_VERSION) +target_include_directories(argon2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +target_include_directories(argon2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib) if (CMAKE_C_COMPILER_ID MATCHES MSVC) function(add_feature_impl FEATURE MSVC_FLAG DEF) 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) 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) function(add_feature_impl FEATURE GCC_FLAG DEF) 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) 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}) endfunction() - target_include_directories(argon2-internal INTERFACE arch/x86_64/lib) - add_feature_impl(sse2 -msse2 HAVE_SSE2) add_feature_impl(ssse3 -mssse3 HAVE_SSSE3) add_feature_impl(xop -mxop HAVE_XOP)