From fa76d2b0607aedca3b470a17ee77b293fbda7dcc Mon Sep 17 00:00:00 2001 From: dsc Date: Thu, 28 Mar 2024 16:56:05 +0200 Subject: [PATCH] fix amd64 --- cmake/WowneroConfig.cmake.in | 8 +++++++- cmake/functions.cmake | 20 +++++++++++--------- src/crypto/CMakeLists.txt | 3 --- src/crypto/wallet/CMakeLists.txt | 1 + src/device/CMakeLists.txt | 2 +- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/cmake/WowneroConfig.cmake.in b/cmake/WowneroConfig.cmake.in index 98c8075b8..4543a70d2 100644 --- a/cmake/WowneroConfig.cmake.in +++ b/cmake/WowneroConfig.cmake.in @@ -26,6 +26,10 @@ find_package(Boost 1.58 REQUIRED COMPONENTS system filesystem thread date_time c find_package(Libunbound 1.16 REQUIRED) find_package(sodium REQUIRED) +if(APPLE) + find_library(IOKIT_LIBRARY IOKit) +endif() + print_cmake_summary() check_required_components(epee) @@ -38,7 +42,9 @@ check_required_components(common) check_required_components(lmdb_lib) check_required_components(randomx) check_required_components(cryptonote_format_utils_basic) -check_required_components(monero-crypto-amd64-64-24k) +if(ARCH_ID STREQUAL "x86" OR ARCH_ID STREQUAL "amd64") + check_required_components(monero-crypto-amd64-64-24k) +endif() check_required_components(wallet-crypto) check_required_components(ringct) check_required_components(cryptonote_basic) diff --git a/cmake/functions.cmake b/cmake/functions.cmake index d2926d31d..b97254d1f 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -96,15 +96,17 @@ endmacro(install_with_directory) function(set_arch_id) # possible values: amd64, x86, aarch64 - set(ARCH_ID ${CMAKE_SYSTEM_PROCESSOR}) - string(TOLOWER ${ARCH_ID} ARCH_ID) + set(_ARCH_ID ${CMAKE_SYSTEM_PROCESSOR}) + string(TOLOWER ${_ARCH_ID} _ARCH_ID) - if(ARCH_ID STREQUAL "x86_64") - set(ARCH_ID "amd64") - elseif(ARCH_ID STREQUAL "i386") - set(ARCH_ID "x86") - elseif(ARCH_ID STREQUAL "aarch64") - set(ARCH_ID "arm64") + if(_ARCH_ID STREQUAL "x86_64") + set(_ARCH_ID "amd64") + elseif(_ARCH_ID STREQUAL "i386") + set(_ARCH_ID "x86") + elseif(_ARCH_ID STREQUAL "aarch64") + set(_ARCH_ID "arm64") endif() - set(ARCH_ID "${ARCH_ID}" PARENT_SCOPE) + + #set_property(GLOBAL PROPERTY ARCH_ID "${_ARCH_ID}") + set(ARCH_ID ${_ARCH_ID} PARENT_SCOPE) endfunction() \ No newline at end of file diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt index 08d8c9c28..01a4c2d34 100644 --- a/src/crypto/CMakeLists.txt +++ b/src/crypto/CMakeLists.txt @@ -115,9 +115,6 @@ if (ANDROID OR IOS) add_definitions(-DFORCE_USE_HEAP=1) endif() -set(ARCH_ID "${CMAKE_SYSTEM_PROCESSOR}") -message(STATUS "${ARCH_ID}") - # cheat because cmake and ccache hate each other set_property(SOURCE CryptonightR_template.S PROPERTY LANGUAGE ASM) set_property(SOURCE CryptonightR_template.S PROPERTY XCODE_EXPLICIT_FILE_TYPE sourcecode.asm) diff --git a/src/crypto/wallet/CMakeLists.txt b/src/crypto/wallet/CMakeLists.txt index ee272a9b2..f97e457c8 100644 --- a/src/crypto/wallet/CMakeLists.txt +++ b/src/crypto/wallet/CMakeLists.txt @@ -32,6 +32,7 @@ check_language(ASM-ATT) # write crypto/ops.h based on platform if(ARCH_ID STREQUAL "x86" OR ARCH_ID STREQUAL "amd64") + add_library(wallet-crypto crypto.h) include(${CMAKE_SOURCE_DIR}/external/supercop/functions.cmake) generate_supercop_config() diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt index eac64974a..09748fc95 100644 --- a/src/device/CMakeLists.txt +++ b/src/device/CMakeLists.txt @@ -47,7 +47,6 @@ target_link_libraries(device cryptonote_format_utils_basic ringct_basic wallet-crypto - #monero-crypto-amd64-64-24k OpenSSL::Crypto Boost::serialization PRIVATE @@ -55,6 +54,7 @@ target_link_libraries(device blocks) if(ARCH_ID STREQUAL "x86" OR ARCH_ID STREQUAL "amd64") + target_link_libraries(device PUBLIC monero-crypto-amd64-64-24k) target_include_directories(device PUBLIC $ PUBLIC $