1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- Upstream status: Merged
- Fetched from: https://github.com/intel-iot-devkit/mraa/commit/86a0e10c037e5c069c48012f169f9e8e2587a0ef
- From 86a0e10c037e5c069c48012f169f9e8e2587a0ef Mon Sep 17 00:00:00 2001
- From: Samuel Martin <s.martin49@gmail.com>
- Date: Wed, 6 Jan 2016 01:07:10 +0100
- Subject: [PATCH] cmake: build shared libs by default on linux
- The change allows to build shared libraries by default on Linux, while
- respecting the requested library build type when the standard CMake flag
- BUILD_SHARED_LIBS is defined.
- Signed-off-by: Samuel Martin <s.martin49@gmail.com>
- Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
- ---
- CMakeLists.txt | 7 +++++++
- src/CMakeLists.txt | 2 +-
- 2 files changed, 8 insertions(+), 1 deletion(-)
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- index 9860556..6a189b9 100644
- --- a/CMakeLists.txt
- +++ b/CMakeLists.txt
- @@ -10,6 +10,13 @@ set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for
- # Set CMAKE_LIB_INSTALL_DIR if not defined
- include(GNUInstallDirs)
-
- +# By default, build shared object libraries on linux
- +if (UNIX AND NOT APPLE)
- + if (NOT DEFINED BUILD_SHARED_LIBS)
- + set(BUILD_SHARED_LIBS ON)
- + endif()
- +endif()
- +
- # Appends the cmake/modules path to MAKE_MODULE_PATH variable.
- set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
-
- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
- index ceb31e4..6698fa4 100644
- --- a/src/CMakeLists.txt
- +++ b/src/CMakeLists.txt
- @@ -111,7 +111,7 @@ set (mraa_LIB_GLOB_HEADERS
- ${PROJECT_SOURCE_DIR}/api/mraa.hpp
- )
-
- -add_library (mraa SHARED ${mraa_LIB_SRCS})
- +add_library (mraa ${mraa_LIB_SRCS})
-
-
- target_link_libraries (mraa ${mraa_LIBS})
- --
- 1.9.1
|