summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GenerateExportHeader/GEH.cmake
diff options
context:
space:
mode:
authorCorentin Damman <c.damman@intopix.com>2023-02-17 13:53:55 (GMT)
committerCorentin Damman <c.damman@intopix.com>2023-02-23 08:19:06 (GMT)
commit1e199363200f33c63160b2fd2730c2f86283ce1e (patch)
treea1fc768e698fd2dd10d6802fedfaaf6e60b106e2 /Tests/RunCMake/GenerateExportHeader/GEH.cmake
parentab049ed7f1efef546ef82d1ec2585a03b47eccce (diff)
downloadCMake-1e199363200f33c63160b2fd2730c2f86283ce1e.zip
CMake-1e199363200f33c63160b2fd2730c2f86283ce1e.tar.gz
CMake-1e199363200f33c63160b2fd2730c2f86283ce1e.tar.bz2
GenerateExportHeader: Fix Clang support on Windows
When using Clang with Visual Studio, the GenerateExportHeader function generates the DEPRECATED definition "__attribute__ ((__deprecated__))", because Clang can compile such instruction. However, if a user wants to compile the library with this generated header with MSVC, the declaration is not valid. We suggest to always use the DEPRECATED definition "__declspec(deprecated)" on Windows, which is valid for both Clang and MSVC.
Diffstat (limited to 'Tests/RunCMake/GenerateExportHeader/GEH.cmake')
-rw-r--r--Tests/RunCMake/GenerateExportHeader/GEH.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Tests/RunCMake/GenerateExportHeader/GEH.cmake b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
index bf9c302..3e35aa3 100644
--- a/Tests/RunCMake/GenerateExportHeader/GEH.cmake
+++ b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
@@ -100,7 +100,9 @@ if (WIN32 OR CYGWIN)
set(_platform Win32-Clang)
elseif(MSVC AND COMPILER_HAS_DEPRECATED)
set(_platform Win32)
- elseif((MINGW OR CYGWIN) AND COMPILER_HAS_DEPRECATED)
+ elseif(CYGWIN AND COMPILER_HAS_DEPRECATED)
+ set(_platform Cygwin)
+ elseif(MINGW AND COMPILER_HAS_DEPRECATED)
set(_platform MinGW)
else()
set(_platform WinEmpty)