diff --git a/build_single.sh b/build_single.sh index 4130f8a..f5b5383 100755 --- a/build_single.sh +++ b/build_single.sh @@ -99,7 +99,7 @@ case "$HOST_ABI" in export CC="clang -stdlib=libc++ -target arm64-apple-darwin11 -mmacosx-version-min=10.8 --sysroot $WDIR/$repo/contrib/depends/aarch64-apple-darwin11/native/SDK/ -mlinker-version=609 -B$WDIR/$repo/contrib/depends/aarch64-apple-darwin11/native/bin/aarch64-apple-darwin11-" export CXX="clang++ -stdlib=libc++ -target arm64-apple-darwin11 -mmacosx-version-min=10.8 --sysroot $WDIR/$repo/contrib/depends/aarch64-apple-darwin11/native/SDK/ -mlinker-version=609 -B$WDIR/$repo/contrib/depends/aarch64-apple-darwin11/native/bin/aarch64-apple-darwin11-" ;; - "host-apple-darwin") + "host-apple-darwin"|"x86_64-host-apple-darwin"|"aarch64-host-apple-darwin") export CC="clang" export CXX="clang++" ;; @@ -117,7 +117,7 @@ pushd $repo/contrib/depends "x86_64-linux-gnu" | "i686-linux-gnu" | "aarch64-linux-gnu" | "x86_64-linux-android" | "i686-linux-android" | "aarch64-linux-android" | "arm-linux-androideabi" | "i686-w64-mingw32" | "x86_64-w64-mingw32" | "x86_64-apple-darwin11" | "aarch64-apple-darwin11") CC=gcc CXX=g++ make HOST="$HOST_ABI" "$NPROC" ;; - "host-apple-darwin") + "host-apple-darwin" | "x86_64-host-apple-darwin" | "aarch64-host-apple-darwin") echo "====================================" echo "= =" echo "= CHECK README.md IF BUILD FAILS =" @@ -145,7 +145,7 @@ pushd $repo/contrib/depends make $NPROC popd fi - MACOS_LIBS_DIR="${PWD}/host-apple-darwin" + MACOS_LIBS_DIR="${PWD}/${HOST_ABI}" rm -rf ${MACOS_LIBS_DIR} mkdir -p ${MACOS_LIBS_DIR}/lib if [[ "x$HOMEBREW_PREFIX" == "x" ]]; @@ -288,7 +288,7 @@ pushd $repo/build/${HOST_ABI} "aarch64-apple-darwin11") env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="armv8-a" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="mac-armv8" ../.. ;; - "host-apple-darwin") + "host-apple-darwin" | "x86_64-host-apple-darwin" | "aarch64-host-apple-darwin") env CC="${CC}" CXX="${CXX}" cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType ../.. ;; "host-apple-ios") @@ -323,7 +323,7 @@ pushd ${repo}_libwallet2_api_c mkdir -p build/${HOST_ABI} -p pushd build/${HOST_ABI} case $HOST_ABI in - "x86_64-linux-gnu" | "i686-linux-gnu" | "aarch64-linux-gnu" | "x86_64-linux-android" | "i686-linux-android" | "aarch64-linux-android" | "arm-linux-androideabi" | "i686-w64-mingw32" | "x86_64-w64-mingw32" | "x86_64-apple-darwin11" | "aarch64-apple-darwin11" | "host-apple-darwin") + "x86_64-linux-gnu" | "i686-linux-gnu" | "aarch64-linux-gnu" | "x86_64-linux-android" | "i686-linux-android" | "aarch64-linux-android" | "arm-linux-androideabi" | "i686-w64-mingw32" | "x86_64-w64-mingw32" | "x86_64-apple-darwin11" | "aarch64-apple-darwin11" | "host-apple-darwin" | "x86_64-host-apple-darwin" | "aarch64-host-apple-darwin") env CC="${CC}" CXX="${CXX}" cmake -DMONERO_FLAVOR=$repo -DCMAKE_BUILD_TYPE=Debug -DHOST_ABI=${HOST_ABI} ../.. CC="${CC}" CXX="${CXX}" make $NPROC ;; @@ -349,7 +349,7 @@ pushd release/$repo cp ../../$repo/build/${HOST_ABI}/external/polyseed/libpolyseed.${APPENDIX} ${HOST_ABI}_libpolyseed.${APPENDIX} rm ${HOST_ABI}_libpolyseed.${APPENDIX}.xz || true xz -e ${HOST_ABI}_libpolyseed.${APPENDIX} - elif [[ "${HOST_ABI}" == "x86_64-apple-darwin11" || "${HOST_ABI}" == "aarch64-apple-darwin11" || "${HOST_ABI}" == "host-apple-darwin" || "${HOST_ABI}" == "host-apple-ios" ]]; + elif [[ "${HOST_ABI}" == "x86_64-apple-darwin11" || "${HOST_ABI}" == "aarch64-apple-darwin11" || "${HOST_ABI}" == "host-apple-darwin" || "${HOST_ABI}" == "x86_64-host-apple-darwin" || "${HOST_ABI}" == "aarch64-host-apple-darwin" || "${HOST_ABI}" == "host-apple-ios" ]]; then APPENDIX="${APPENDIX}dylib" else diff --git a/monero_libwallet2_api_c/CMakeLists.txt b/monero_libwallet2_api_c/CMakeLists.txt index 38bd850..d3b9c06 100644 --- a/monero_libwallet2_api_c/CMakeLists.txt +++ b/monero_libwallet2_api_c/CMakeLists.txt @@ -18,7 +18,9 @@ elseif(${HOST_ABI} STREQUAL "host-apple-ios") set(CMAKE_SYSTEM_NAME iOS) endif() -if (${HOST_ABI} STREQUAL "host-apple-darwin") +if (${HOST_ABI} STREQUAL "host-apple-darwin" OR + ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR + ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin") EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE ) if (NOT ${ARCHITECTURE} STREQUAL arm64) set(CMAKE_OSX_ARCHITECTURES x86_64) @@ -302,7 +304,9 @@ else() set(EXTRA_LIBS "") endif() -if (${HOST_ABI} STREQUAL "host-apple-darwin") +if (${HOST_ABI} STREQUAL "host-apple-darwin" OR + ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR + ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin") EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE ) if (NOT ${ARCHITECTURE} STREQUAL arm64) set(EXTRA_LIBS "wallet-crypto") @@ -312,7 +316,9 @@ endif() if (${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11") set(EXTRA_LIBS_APPLE "-framework IOKit" "-framework CoreFoundation" "-framework Cocoa" hidapi) # set_target_properties(wallet2_api_c PROPERTIES LINK_FLAGS "-Wl,-F/Library/Frameworks") -elseif(${HOST_ABI} STREQUAL "host-apple-darwin") +elseif(${HOST_ABI} STREQUAL "host-apple-darwin" OR + ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR + ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin") set(EXTRA_LIBS_APPLE "-framework IOKit" "-framework CoreFoundation" "-framework Cocoa" apple_nghttp2 event) elseif(${HOST_ABI} STREQUAL "host-apple-ios") set(EXTRA_LIBS_APPLE "-framework IOKit" "-framework CoreFoundation" iconv ) @@ -326,7 +332,7 @@ if(${HOST_ABI} STREQUAL "x86_64-w64-mingw32" OR ${HOST_ABI} STREQUAL "i686-w64-m set(EXTRA_LIBS_WINDOWS ssp wsock32 ws2_32 iconv-win iphlpapi crypt32 hidapi) endif() -if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios") +if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios") set_target_properties(wallet2_api_c PROPERTIES SUFFIX ".dylib") set_target_properties(wallet2_api_c PROPERTIES NO_SONAME 1) @@ -338,11 +344,11 @@ elseif(${MONERO_FLAVOR} STREQUAL "wownero") target_compile_definitions(wallet2_api_c PRIVATE FLAVOR_WOWNERO) endif() -if(NOT ${HOST_ABI} STREQUAL "x86_64-apple-darwin11" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" AND NOT ${HOST_ABI} STREQUAL "host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "host-apple-ios") +if(NOT ${HOST_ABI} STREQUAL "x86_64-apple-darwin11" AND NOT ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" AND NOT ${HOST_ABI} STREQUAL "host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" AND NOT ${HOST_ABI} STREQUAL "host-apple-ios") set_target_properties(wallet2_api_c PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL") endif() -if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios") +if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios") if (${MONERO_FLAVOR} STREQUAL "monero") set(EXPORTED_SYMBOLS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/monero_libwallet2_api_c.exp) elseif(${MONERO_FLAVOR} STREQUAL "wownero")