summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-10-15 09:48:03 +0200
committerGitHub <noreply@github.com>2016-10-15 09:48:03 +0200
commita63f57297b8bcce88084acd31c2a82353fdc9052 (patch)
tree8c3d53bf7a4907cca195a9930a5f45ecd3b7ad41 /CMakeLists.txt
parentc0482ace6c78ddce0a2fcf37020302a41fbc5ee9 (diff)
parent0d958bf3b3485a17071d7d4d17030f75f28412e4 (diff)
Merge pull request #115 from shehzan10/development
Fixes for static lib compilation on Windows
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3927858e..140b35a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,15 @@ elseif(MSVC)
endif()
endif()
+# DLL Settings
+if(MSVC)
+ if(BUILD_SHARED_LIBS)
+ add_definitions(" /DCLBLAST_DLL")
+ else(BUILD_SHARED_LIBS)
+ add_definitions(" /DCLBLAST_STATIC")
+ endif(BUILD_SHARED_LIBS)
+endif(MSVC)
+
# C++ compiler settings
if(MSVC)
set(FLAGS "/Ox")
@@ -195,7 +204,9 @@ target_include_directories(clblast PUBLIC
# Sets the proper __declspec(dllexport) keyword for Visual Studio when the library is built
if(MSVC)
- target_compile_definitions(clblast PRIVATE COMPILING_DLL=1) # requires at least CMake 2.8.11
+ if(BUILD_SHARED_LIBS)
+ target_compile_definitions(clblast PRIVATE COMPILING_DLL=1) # requires at least CMake 2.8.11
+ endif(BUILD_SHARED_LIBS)
endif()
# Installs the library