diff options
author | alexander <alexander.efremov@arm.com> | 2022-02-11 13:23:22 +0000 |
---|---|---|
committer | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2022-02-11 18:11:35 +0000 |
commit | cb8a987ce714283b66db49d1bc9d5b108caaa707 (patch) | |
tree | b00f86587c8b15d0391691d415220b2bbbcf6ea9 /scripts/cmake/platforms | |
parent | 31ae9f09bb3535975595e999fbc7baca889e46e8 (diff) | |
download | ml-embedded-evaluation-kit-cb8a987ce714283b66db49d1bc9d5b108caaa707.tar.gz |
MLECO-2752: Minor refactoring for native global steps.
And further optimisations of extendability for platform build
steps. Added a list for excluded use-cases.
Change-Id: I5a9398bbeb595a5bf2ea39b81623e4f20238f948
Signed-off-by: alexander <alexander.efremov@arm.com>
Diffstat (limited to 'scripts/cmake/platforms')
-rw-r--r-- | scripts/cmake/platforms/native/build_configuration.cmake | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/scripts/cmake/platforms/native/build_configuration.cmake b/scripts/cmake/platforms/native/build_configuration.cmake index c87ac89..bf6f980 100644 --- a/scripts/cmake/platforms/native/build_configuration.cmake +++ b/scripts/cmake/platforms/native/build_configuration.cmake @@ -15,19 +15,6 @@ # limitations under the License. #---------------------------------------------------------------------------- -set(TEST_TPIP ${DOWNLOAD_DEP_DIR}/test) - -file(MAKE_DIRECTORY ${TEST_TPIP}) -set(TEST_TPIP_INCLUDE ${TEST_TPIP}/include) -file(MAKE_DIRECTORY ${TEST_TPIP_INCLUDE}) - -ExternalProject_Add(catch2-headers - URL https://github.com/catchorg/Catch2/releases/download/v2.11.1/catch.hpp - DOWNLOAD_NO_EXTRACT 1 - CONFIGURE_COMMAND "" - BUILD_COMMAND bash -c "cp -R <DOWNLOAD_DIR>/catch.hpp ${TEST_TPIP_INCLUDE}" - INSTALL_COMMAND "") - function(set_platform_global_defaults) message(STATUS "Platform: Native (Linux based x86_64/aarch64 system)") if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) @@ -35,6 +22,24 @@ function(set_platform_global_defaults) CACHE FILEPATH "Toolchain file") endif() + set(TEST_TPIP ${DOWNLOAD_DEP_DIR}/test) + + file(MAKE_DIRECTORY ${TEST_TPIP}) + set(TEST_TPIP_INCLUDE ${TEST_TPIP}/include) + file(MAKE_DIRECTORY ${TEST_TPIP_INCLUDE}) + + ExternalProject_Add(catch2-headers + URL https://github.com/catchorg/Catch2/releases/download/v2.11.1/catch.hpp + DOWNLOAD_NO_EXTRACT 1 + CONFIGURE_COMMAND "" + BUILD_COMMAND ${CMAKE_COMMAND} -E copy <DOWNLOAD_DIR>/catch.hpp ${TEST_TPIP_INCLUDE} + INSTALL_COMMAND "") + + add_library(catch2 INTERFACE) + target_include_directories(catch2 + INTERFACE + ${TEST_TPIP_INCLUDE}) + endfunction() function(platform_custom_post_build) @@ -98,16 +103,10 @@ function(platform_custom_post_build) set(TEST_TARGET_NAME "${CMAKE_PROJECT_NAME}-${use_case}-tests") add_executable(${TEST_TARGET_NAME} ${TEST_SOURCES}) - target_include_directories(${TEST_TARGET_NAME} PUBLIC - ${TEST_TPIP_INCLUDE} ${TEST_RESOURCES_INCLUDE}) - target_link_libraries(${TEST_TARGET_NAME} PUBLIC ${UC_LIB_NAME}) + target_include_directories(${TEST_TARGET_NAME} PRIVATE ${TEST_RESOURCES_INCLUDE}) + target_link_libraries(${TEST_TARGET_NAME} PRIVATE ${UC_LIB_NAME} catch2) target_compile_definitions(${TEST_TARGET_NAME} PRIVATE "ACTIVATION_BUF_SZ=${${use_case}_ACTIVATION_BUF_SZ}" TESTS) - - add_dependencies( - "${TEST_TARGET_NAME}" - "catch2-headers" - ) endif () endfunction()
\ No newline at end of file |