diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d0cf18c..63e1edd 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,6 +3,7 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 AS base RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends \ build-essential clang lld make gdb cmake ninja-build \ + crossbuild-essential-arm64 \ git curl wget unzip sudo \ pip \ clang-format clang-tidy \ diff --git a/README.md b/README.md index c529a7a..f29eaa1 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ In the configuration options, select the `'conan-debug' config`. When the project configuration is finished, click Build to build the project.

cmakeBuild

+#### Build for ARMv8 + +To compile dependencies this project to run to-dos-api in the **ARMv8** environment, use the command `conan install . -pr:h profiles/to-dos-conan-profile-arm64.conf --build=missing` instead of the one specified in the previous paragraph in the terminal. + +When dependencies are built, use the command `conan build . -pr:h profiles/to-dos-conan-profile-arm64.conf` to build to-dos-api for running in an **ARMv8** environment. + ### Project run #### Before launching web server: diff --git a/profiles/to-dos-conan-profile-arm64.conf b/profiles/to-dos-conan-profile-arm64.conf new file mode 100644 index 0000000..055d54d --- /dev/null +++ b/profiles/to-dos-conan-profile-arm64.conf @@ -0,0 +1,30 @@ +[settings] +os=Linux +arch=armv8 +build_type=Debug +compiler=clang +compiler.version=14 +compiler.libcxx=libstdc++11 +compiler.cppstd=gnu20 + +[options] +boost/*:without_locale=True +boost/*:without_stacktrace=True + +[conf] +tools.build:compiler_executables={"c":"clang","cpp":"clang++"} +tools.system.package_manager:mode=install + +[buildenv] +CFLAGS=--target=aarch64-linux-gnu +CXXFLAGS=--target=aarch64-linux-gnu +LDFLAGS=--target=aarch64-linux-gnu +CC=clang +CXX=clang++ +LD=aarch64-linux-gnu-ld +AR=aarch64-linux-gnu-ar +RANLIB=aarch64-linux-gnu-ranlib +NM=aarch64-linux-gnu-nm +STRIP=aarch64-linux-gnu-strip +OBJCOPY=aarch64-linux-gnu-objcopy +OBJDUMP=aarch64-linux-gnu-objdump \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a25a440..f2d5e77 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -17,4 +17,10 @@ target_include_directories(${TEST_PROJECT} PRIVATE ${CMAKE_SOURCE_DIR}/src ) -gtest_discover_tests(${TEST_PROJECT}) \ No newline at end of file +if(CMAKE_CROSSCOMPILING) + message(STATUS "Cross-compiling for ${CMAKE_SYSTEM_PROCESSOR}, skipping test discovery") + add_test(NAME ${TEST_PROJECT} + COMMAND ${TEST_PROJECT}) +else() + gtest_discover_tests(${TEST_PROJECT}) +endif()