Re: [cmake-developers] [PATCH] Use dllexport and dllimport on Cygwin too

2015-08-27 Thread Brad King
On 08/27/2015 03:48 AM, Tony Kelman wrote:
 First hunk below is from Yaakov Selkowitz, it was reported to be 
 necessary to build KF5 in Cygwin. Second hunk fixes the corresponding 
 test to account for the change. Currently the MinGW platform reference 
 outputs appear to match the Cygwin results here, though a separate new 
 pair of reference outputs just for Cygwin could of course work for this 
 too.

Applied, thanks:

 GenerateExportHeader: Use dllexport/dllimport on Cygwin
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e2865b4

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] [PATCH] Use dllexport and dllimport on Cygwin too

2015-08-27 Thread Tony Kelman
First hunk below is from Yaakov Selkowitz, it was reported to be 
necessary to build KF5 in Cygwin. Second hunk fixes the corresponding 
test to account for the change. Currently the MinGW platform reference 
outputs appear to match the Cygwin results here, though a separate new 
pair of reference outputs just for Cygwin could of course work for this 
too.

Thanks,
Tony


diff --git a/Modules/GenerateExportHeader.cmake 
b/Modules/GenerateExportHeader.cmake
index aab29ea..8205425 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -268,7 +268,7 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
   get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)

   if(NOT ${type} STREQUAL STATIC_LIBRARY)
-if(WIN32)
+if(WIN32 OR CYGWIN)
   set(DEFINE_EXPORT __declspec(dllexport))
   set(DEFINE_IMPORT __declspec(dllimport))
 elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND 
USE_COMPILER_HIDDEN_VISIBILITY)
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt 
b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index b52c44d..8cd25a4 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -106,10 +106,10 @@ endif()
 add_executable(GenerateExportHeader exportheader_test.cpp)

 target_link_libraries(GenerateExportHeader ${link_libraries})
-if (WIN32)
+if (WIN32 OR CYGWIN)
   if(MSVC AND COMPILER_HAS_DEPRECATED)
 set(_platform Win32)
-  elseif(MINGW AND COMPILER_HAS_DEPRECATED)
+  elseif((MINGW OR CYGWIN) AND COMPILER_HAS_DEPRECATED)
 set(_platform MinGW)
   else()
 set(_platform WinEmpty)


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers