From 0d958bf3b3485a17071d7d4d17030f75f28412e4 Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Fri, 14 Oct 2016 18:45:34 -0400 Subject: Fixes for static lib compilation on Windows --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') 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 -- cgit v1.2.3