summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-10-14 10:06:44 +0200
committerGitHub <noreply@github.com>2016-10-14 10:06:44 +0200
commit99a620f9a1ef81e7d9991ea801d44e8d1c740985 (patch)
tree674c14155c2c42aee17f8b1e9fe4aa53a623bcc9
parentebb505b7836244d07c5ae37d5d9914bea761e185 (diff)
parent56f07e42b1734fdebefadea6405f4d2838f65190 (diff)
Merge pull request #112 from shehzan10/static
Add option to build shared or static library
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07cb9283..9b028448 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,7 @@ set(clblast_VERSION_MINOR 9)
set(clblast_VERSION_PATCH 0)
# Options and their default values
+option(BUILD_SHARED_LIBS "Build shared or static library" ON)
option(SAMPLES "Enable compilation of the examples" OFF)
option(TUNERS "Enable compilation of the tuners" OFF)
option(CLIENTS "Enable compilation of the clients to test and compare performance" OFF)
@@ -172,7 +173,12 @@ foreach(ROUTINE ${LEVELX_ROUTINES})
endforeach()
# Creates and links the library
-add_library(clblast SHARED ${SOURCES})
+if(BUILD_SHARED_LIBS)
+ add_library(clblast SHARED ${SOURCES})
+else(BUILD_SHARED_LIBS)
+ add_library(clblast STATIC ${SOURCES})
+endif(BUILD_SHARED_LIBS)
+
target_link_libraries(clblast ${OPENCL_LIBRARIES})
# Includes directories: CLBlast and OpenCL