From 824771f7f93ac163f3249c8f1982862494642b94 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 28 Aug 2021 23:04:18 +0300 Subject: [PATCH 1/2] Provide support to build project under arm64/aarch64 --- CHANGELOG.md | 10 +++- CMakePresets.json | 52 +++++++++++++++++++ cmake/FindFUSE.cmake | 2 + .../conan/profiles/macos-arm64-apple-12-debug | 15 ++++++ 4 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 tools/conan/profiles/macos-arm64-apple-12-debug diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f558181..ed55eb88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,15 @@ releases, in reverse chronological order. * Added `-dumpversion` program option alias for `--dumpversion`. * Amended tests. * Provided launchd integration for macOS. - +* Provided support to build project under arm64/aarch64 architectures. + +### Bugfix + +* [#87](https://github.com/sergeyklay/pcloud-console-client/issues/87): + Define `_FILE_OFFSET_BITS` to `64` on arm64 architectures. + For more info about this macro refer to + https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html. + ### Changes * Renamed `overlay_callback` pointer to function to `poverlay_callback`. diff --git a/CMakePresets.json b/CMakePresets.json index 53fe8a15..87d8ef51 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -80,6 +80,37 @@ "CMAKE_CXX_COMPILER": "c++", "PCLOUD_TLS_IMPL": "mbedtls" } + }, + { + "name": "macos-armv8-apple-mbedtls-debug", + "displayName": "macOS armv8: Debug / Apple Clang / Mbed TLS", + "description": "Sets Ninja generator, Clang compiler, build and install directory, debug build type and Mbed TLS implementation", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "architecture": { + "value": "armv8", + "strategy": "external" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "PCLOUD_MAINTAINER_LOGS": true, + "PCLOUD_MAINTAINER_LOGS_LEVEL": "0", + "PCLOUD_MAINTAINER_LOG_FILE": "", + "PCLOUD_BUILD_DOC": true, + "PCLOUD_WITH_TESTS": true, + "PCLOUD_WITH_LAUNCHD": true, + "PCLOUD_WITH_SYSTEMD": false, + "PCLOUD_LAUNCHD_PLISTS_INSTALL_DIR": "${sourceDir}/out/install/${presetName}/Library/LaunchAgents", + "CMAKE_C_COMPILER": "cc", + "CMAKE_CXX_COMPILER": "c++", + "PCLOUD_TLS_IMPL": "mbedtls" + } } ], "buildPresets": [ @@ -114,6 +145,17 @@ "lhs": "${hostSystemName}", "rhs": "Darwin" } + }, + { + "name": "macos-armv8-apple-mbedtls-debug", + "displayName": "macOS armv8: Debug / Apple Clang / Mbed TLS", + "configurePreset": "macos-armv8-apple-mbedtls-debug", + "configuration": "Debug", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } } ], "testPresets": [ @@ -146,6 +188,16 @@ "lhs": "${hostSystemName}", "rhs": "Darwin" } + }, + { + "name": "macos-armv8-apple-mbedtls-debug", + "displayName": "macOS armv8: Debug / Apple Clang / Mbed TLS", + "configurePreset": "macos-armv8-apple-mbedtls-debug", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } } ] } diff --git a/cmake/FindFUSE.cmake b/cmake/FindFUSE.cmake index f46b9173..915282a7 100644 --- a/cmake/FindFUSE.cmake +++ b/cmake/FindFUSE.cmake @@ -92,6 +92,8 @@ if(FUSE_FOUND) set(FUSE_DEFINITIONS "-D_REENTRANT -D_FILE_OFFSET_BITS=64") elseif(sys_cpu MATCHES x86_64) set(FUSE_DEFINITIONS "-D_REENTRANT -D_FILE_OFFSET_BITS=64") + elseif(sys_cpu MATCHES arm64) + set(FUSE_DEFINITIONS "-D_REENTRANT -D_FILE_OFFSET_BITS=64") endif() unset(sys_cpu) endif() diff --git a/tools/conan/profiles/macos-arm64-apple-12-debug b/tools/conan/profiles/macos-arm64-apple-12-debug new file mode 100644 index 00000000..717b5839 --- /dev/null +++ b/tools/conan/profiles/macos-arm64-apple-12-debug @@ -0,0 +1,15 @@ +[settings] +os=Macos +os_build=Macos +arch=armv8 +arch_build=armv8 +compiler=apple-clang +compiler.version=12.0 +compiler.libcxx=libc++ +build_type=Debug + +[options] + +[build_requires] + +[env] From 98af2fbd5890f804617a358e320815503c053164 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 28 Aug 2021 23:05:41 +0300 Subject: [PATCH 2/2] Rename conan profile --- .../{macos-arm64-apple-12-debug => macos-armv8-apple-12-debug} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/conan/profiles/{macos-arm64-apple-12-debug => macos-armv8-apple-12-debug} (100%) diff --git a/tools/conan/profiles/macos-arm64-apple-12-debug b/tools/conan/profiles/macos-armv8-apple-12-debug similarity index 100% rename from tools/conan/profiles/macos-arm64-apple-12-debug rename to tools/conan/profiles/macos-armv8-apple-12-debug