IVGCVSW-4402 add boost and armnn path to sample dynamic backend
authorNarumol Prangnawarat <narumol.prangnawarat@arm.com>
Fri, 7 Feb 2020 10:28:31 +0000 (10:28 +0000)
committerNarumol Prangnawarat <narumol.prangnawarat@arm.com>
Fri, 7 Feb 2020 15:11:11 +0000 (15:11 +0000)
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com>
Change-Id: Ibeed3301352d8f15e144f8466d8a26b21c744b84

samples/CMakeLists.txt
src/dynamic/sample/CMakeLists.txt

index 5505de0bec07e478b0cf7c8790202a6da79d760b..2ff556c8c1c2fdcd99a5322f6b8230d0ae2035dd 100644 (file)
@@ -3,7 +3,7 @@ if(BUILD_SAMPLE_APP AND ARMNNREF)
     target_link_libraries(SimpleSample armnn ${CMAKE_THREAD_LIBS_INIT})
 endif()
 
-if(SAMPLE_DYNAMIC_BACKEND)
+if(BUILD_SAMPLE_APP AND SAMPLE_DYNAMIC_BACKEND)
     add_executable(DynamicSample DynamicSample.cpp)
     target_link_libraries(DynamicSample armnn ${CMAKE_THREAD_LIBS_INIT})
 endif()
index 65ad8a166035f75f7ae9349c68a53133b2d76bfe..cbf980e6cc0ac2f5d26dbbcd1b23eceb97569b2f 100644 (file)
@@ -8,12 +8,10 @@ project(sample-dynamic)
 
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
-if("${CMAKE_SYSTEM_NAME}" STREQUAL Android)
-    add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
-    find_package(Boost REQUIRED COMPONENTS system filesystem)
-    include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
-    link_directories(${Boost_LIBRARY_DIRS})
-endif()
+add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
+find_package(Boost REQUIRED COMPONENTS system filesystem)
+include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
+link_directories(${Boost_LIBRARY_DIRS})
 
 list(APPEND armnnSampleDynamicBackend_sources
         SampleDynamicAdditionWorkload.cpp
@@ -38,9 +36,6 @@ target_include_directories(Arm_SampleDynamic_backend PRIVATE ${PROJECT_SOURCE_DI
 target_include_directories(Arm_SampleDynamic_backend PRIVATE ${PROJECT_SOURCE_DIR}/../../../src/armnnUtils)
 target_include_directories(Arm_SampleDynamic_backend PRIVATE ${PROJECT_SOURCE_DIR}/../../../src/backends)
 target_include_directories(Arm_SampleDynamic_backend PRIVATE ${PROJECT_SOURCE_DIR}/../../../src/profiling)
-
-if("${CMAKE_SYSTEM_NAME}" STREQUAL Android)
-    target_include_directories(Arm_SampleDynamic_backend PRIVATE ${Boost_INCLUDE_DIRS})
-    target_link_libraries(Arm_SampleDynamic_backend ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
-    target_link_libraries(Arm_SampleDynamic_backend ${ARMNN_PATH})
-endif()
+target_include_directories(Arm_SampleDynamic_backend PRIVATE ${Boost_INCLUDE_DIRS})
+target_link_libraries(Arm_SampleDynamic_backend ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
+target_link_libraries(Arm_SampleDynamic_backend ${ARMNN_PATH})