diff options
author | Brad King <brad.king@kitware.com> | 2023-02-24 13:33:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-02-24 13:33:23 (GMT) |
commit | 7552276e6ecfa918fd54978d939ab7532920346e (patch) | |
tree | beb04e5c0175d813351cf4d57c6f932b3a524ac9 /Tests | |
parent | d19b61bf4317282909c897f7dae61f2cc2c4ca61 (diff) | |
parent | 1e199363200f33c63160b2fd2730c2f86283ce1e (diff) | |
download | CMake-7552276e6ecfa918fd54978d939ab7532920346e.zip CMake-7552276e6ecfa918fd54978d939ab7532920346e.tar.gz CMake-7552276e6ecfa918fd54978d939ab7532920346e.tar.bz2 |
Merge topic 'GenerateExportHeader-Fix-Clang-support-on-Windows'
1e19936320 GenerateExportHeader: Fix Clang support on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Adrien De Coninck <deconinck.adrien@gmail.com>
Merge-request: !8221
Diffstat (limited to 'Tests')
7 files changed, 91 insertions, 5 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) diff --git a/Tests/RunCMake/GenerateExportHeader/reference/Cygwin/libshared_export.h b/Tests/RunCMake/GenerateExportHeader/reference/Cygwin/libshared_export.h new file mode 100644 index 0000000..dac4fda --- /dev/null +++ b/Tests/RunCMake/GenerateExportHeader/reference/Cygwin/libshared_export.h @@ -0,0 +1,42 @@ + +#ifndef LIBSHARED_EXPORT_H +#define LIBSHARED_EXPORT_H + +#ifdef LIBSHARED_STATIC_DEFINE +# define LIBSHARED_EXPORT +# define LIBSHARED_NO_EXPORT +#else +# ifndef LIBSHARED_EXPORT +# ifdef libshared_EXPORTS + /* We are building this library */ +# define LIBSHARED_EXPORT __declspec(dllexport) +# else + /* We are using this library */ +# define LIBSHARED_EXPORT __declspec(dllimport) +# endif +# endif + +# ifndef LIBSHARED_NO_EXPORT +# define LIBSHARED_NO_EXPORT +# endif +#endif + +#ifndef LIBSHARED_DEPRECATED +# define LIBSHARED_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef LIBSHARED_DEPRECATED_EXPORT +# define LIBSHARED_DEPRECATED_EXPORT LIBSHARED_EXPORT LIBSHARED_DEPRECATED +#endif + +#ifndef LIBSHARED_DEPRECATED_NO_EXPORT +# define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED +#endif + +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSHARED_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +# endif +#endif + +#endif /* LIBSHARED_EXPORT_H */ diff --git a/Tests/RunCMake/GenerateExportHeader/reference/Cygwin/libstatic_export.h b/Tests/RunCMake/GenerateExportHeader/reference/Cygwin/libstatic_export.h new file mode 100644 index 0000000..b6e2a4a --- /dev/null +++ b/Tests/RunCMake/GenerateExportHeader/reference/Cygwin/libstatic_export.h @@ -0,0 +1,42 @@ + +#ifndef LIBSTATIC_EXPORT_H +#define LIBSTATIC_EXPORT_H + +#ifdef LIBSTATIC_STATIC_DEFINE +# define LIBSTATIC_EXPORT +# define LIBSTATIC_NO_EXPORT +#else +# ifndef LIBSTATIC_EXPORT +# ifdef libstatic_EXPORTS + /* We are building this library */ +# define LIBSTATIC_EXPORT +# else + /* We are using this library */ +# define LIBSTATIC_EXPORT +# endif +# endif + +# ifndef LIBSTATIC_NO_EXPORT +# define LIBSTATIC_NO_EXPORT +# endif +#endif + +#ifndef LIBSTATIC_DEPRECATED +# define LIBSTATIC_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef LIBSTATIC_DEPRECATED_EXPORT +# define LIBSTATIC_DEPRECATED_EXPORT LIBSTATIC_EXPORT LIBSTATIC_DEPRECATED +#endif + +#ifndef LIBSTATIC_DEPRECATED_NO_EXPORT +# define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED +#endif + +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSTATIC_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +# endif +#endif + +#endif /* LIBSTATIC_EXPORT_H */ diff --git a/Tests/RunCMake/GenerateExportHeader/reference/MinGW/libshared_export.h b/Tests/RunCMake/GenerateExportHeader/reference/MinGW/libshared_export.h index dac4fda..3ba2d2e 100644 --- a/Tests/RunCMake/GenerateExportHeader/reference/MinGW/libshared_export.h +++ b/Tests/RunCMake/GenerateExportHeader/reference/MinGW/libshared_export.h @@ -22,7 +22,7 @@ #endif #ifndef LIBSHARED_DEPRECATED -# define LIBSHARED_DEPRECATED __attribute__ ((__deprecated__)) +# define LIBSHARED_DEPRECATED __declspec(deprecated) #endif #ifndef LIBSHARED_DEPRECATED_EXPORT diff --git a/Tests/RunCMake/GenerateExportHeader/reference/MinGW/libstatic_export.h b/Tests/RunCMake/GenerateExportHeader/reference/MinGW/libstatic_export.h index b6e2a4a..3c7e093 100644 --- a/Tests/RunCMake/GenerateExportHeader/reference/MinGW/libstatic_export.h +++ b/Tests/RunCMake/GenerateExportHeader/reference/MinGW/libstatic_export.h @@ -22,7 +22,7 @@ #endif #ifndef LIBSTATIC_DEPRECATED -# define LIBSTATIC_DEPRECATED __attribute__ ((__deprecated__)) +# define LIBSTATIC_DEPRECATED __declspec(deprecated) #endif #ifndef LIBSTATIC_DEPRECATED_EXPORT diff --git a/Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libshared_export.h b/Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libshared_export.h index dac4fda..3ba2d2e 100644 --- a/Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libshared_export.h +++ b/Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libshared_export.h @@ -22,7 +22,7 @@ #endif #ifndef LIBSHARED_DEPRECATED -# define LIBSHARED_DEPRECATED __attribute__ ((__deprecated__)) +# define LIBSHARED_DEPRECATED __declspec(deprecated) #endif #ifndef LIBSHARED_DEPRECATED_EXPORT diff --git a/Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h b/Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h index b6e2a4a..3c7e093 100644 --- a/Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h +++ b/Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h @@ -22,7 +22,7 @@ #endif #ifndef LIBSTATIC_DEPRECATED -# define LIBSTATIC_DEPRECATED __attribute__ ((__deprecated__)) +# define LIBSTATIC_DEPRECATED __declspec(deprecated) #endif #ifndef LIBSTATIC_DEPRECATED_EXPORT |