aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bentham <Matthew.Bentham@arm.com>2019-10-31 09:55:01 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-10-31 14:03:23 +0000
commitb4e6720edc20ac561716a4681ae1e72c8489f619 (patch)
tree0d4d9a950cb25de6136e7e0da9b421f662f766c0
parent27dbd346d81c4fc73f6600b466ba1d22de9cde63 (diff)
downloadarmnn-b4e6720edc20ac561716a4681ae1e72c8489f619.tar.gz
Github #277 Add option to use shared boost libraries
Pass -DSHARED_BOOST=ON to cmake to link dynamically to boost. This makes it possible to use standard package-installed boost libraries in a native build. Change-Id: I6cbd72fae8b0cf8ae07f4382ab0510854c1623fd Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com>
-rw-r--r--cmake/GlobalConfig.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/GlobalConfig.cmake b/cmake/GlobalConfig.cmake
index 2c1989e006..af579488e6 100644
--- a/cmake/GlobalConfig.cmake
+++ b/cmake/GlobalConfig.cmake
@@ -22,6 +22,7 @@ option(TF_LITE_GENERATED_PATH "Tensorflow lite generated C++ schema location" OF
option(FLATBUFFERS_ROOT "Location where the flatbuffers 'include' and 'lib' folders to be found" Off)
option(DYNAMIC_BACKEND_PATHS "Colon seperated list of paths where to load the dynamic backends from" "")
option(BUILD_GATORD_MOCK "Build the Gatord simulator for external profiling testing." ON)
+option(SHARED_BOOST "Use dynamic linking for boost libraries" OFF)
include(SelectLibraryConfigurations)
@@ -108,8 +109,13 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
# Boost
+if(SHARED_BOOST)
+ add_definitions(-DBOOST_ALL_DYN_LINK)
+ set(Boost_USE_STATIC_LIBS OFF)
+else()
+ set(Boost_USE_STATIC_LIBS ON)
+endif()
add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
-set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework system filesystem log program_options)
include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
link_directories(${Boost_LIBRARY_DIRS})