diff options
author | Tony Kelman <tony@kelman.net> | 2015-08-27 07:48:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-08-27 14:08:34 (GMT) |
commit | 3e2865b46744e543af3045331b31b94df2ebe1ad (patch) | |
tree | 1d165d0eea34f39adafe2694398bdb4f4dddf128 | |
parent | 27e4b21dfa926a522bb32674b8836ebb79d51bc5 (diff) | |
download | CMake-3e2865b46744e543af3045331b31b94df2ebe1ad.zip CMake-3e2865b46744e543af3045331b31b94df2ebe1ad.tar.gz CMake-3e2865b46744e543af3045331b31b94df2ebe1ad.tar.bz2 |
GenerateExportHeader: Use dllexport/dllimport on Cygwin
Cygwin sits on top of Windows and so can use explicit symbol
export and import markup too.
Co-Author: Yaakov Selkowitz <yselkowitz@cygwin.com>
-rw-r--r-- | Modules/GenerateExportHeader.cmake | 2 | ||||
-rw-r--r-- | Tests/Module/GenerateExportHeader/CMakeLists.txt | 4 |
2 files changed, 3 insertions, 3 deletions
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) |