From 000b3a6635f2c93d878dad668b620d0432544f16 Mon Sep 17 00:00:00 2001 From: Lectem Date: Sun, 17 Sep 2017 14:27:09 +0200 Subject: cmake target_* requires v2.8.12 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 942f684..088c5ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ project(StormLib) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) set(LIBRARY_NAME storm) -- cgit v1.2.3 From 2d529bcb82853edcbbaca0187b4bf2a9f751fdea Mon Sep 17 00:00:00 2001 From: Lectem Date: Sun, 17 Sep 2017 14:28:01 +0200 Subject: Add STORMLIB_NO_AUTO_LINK define to disable linking with pragma --- CMakeLists.txt | 2 +- src/StormLib.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 088c5ad..79e0092 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -308,7 +308,7 @@ endif() add_library(${LIBRARY_NAME} ${LIB_TYPE} ${SRC_FILES} ${SRC_ADDITIONAL_FILES}) target_link_libraries(${LIBRARY_NAME} ${LINK_LIBS}) -target_compile_definitions(${LIBRARY_NAME} PUBLIC) #CMake should take care of the linking +target_compile_definitions(${LIBRARY_NAME} INTERFACE STORMLIB_NO_AUTO_LINK) #CMake will take care of the linking target_include_directories(${LIBRARY_NAME} PUBLIC src/) set_target_properties(${LIBRARY_NAME} PROPERTIES PUBLIC_HEADER "src/StormLib.h;src/StormPort.h") if(BUILD_SHARED_LIBS) diff --git a/src/StormLib.h b/src/StormLib.h index f7512e5..45dda2e 100644 --- a/src/StormLib.h +++ b/src/StormLib.h @@ -99,8 +99,11 @@ extern "C" { // Z - S for static-linked CRT library, D for multithreaded DLL CRT library // -#if defined(_MSC_VER) && !defined(__STORMLIB_SELF__) - +#if defined(__STORMLIB_SELF__) && !defined(STORMLIB_NO_AUTO_LINK) +#define STORMLIB_NO_AUTO_LINK // Define this if you don't want to link using pragmas when using msvc +#endif + +#if defined(_MSC_VER) && !defined(STORMLIB_NO_AUTO_LINK) #ifdef _DEBUG // DEBUG VERSIONS #ifndef _UNICODE #ifdef _DLL -- cgit v1.2.3