diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 4f4efbcf3..6389d3072 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -341,7 +341,9 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) string(MAKE_C_IDENTIFIER ${STATIC_DEFINE} STATIC_DEFINE) if(_GEH_DEFINE_NO_DEPRECATED) - set(DEFINE_NO_DEPRECATED TRUE) + set(DEFINE_NO_DEPRECATED 1) + else() + set(DEFINE_NO_DEPRECATED 0) endif() if(_GEH_NO_DEPRECATED_MACRO_NAME) diff --git a/Modules/exportheader.cmake.in b/Modules/exportheader.cmake.in index 118de16d6..7cfbcbda4 100644 --- a/Modules/exportheader.cmake.in +++ b/Modules/exportheader.cmake.in @@ -33,9 +33,10 @@ # define @DEPRECATED_MACRO_NAME@_NO_EXPORT @NO_EXPORT_MACRO_NAME@ @DEPRECATED_MACRO_NAME@ #endif -#cmakedefine01 DEFINE_NO_DEPRECATED -#if DEFINE_NO_DEPRECATED -# define @NO_DEPRECATED_MACRO_NAME@ +#if @DEFINE_NO_DEPRECATED@ /* DEFINE_NO_DEPRECATED */ +# ifndef @NO_DEPRECATED_MACRO_NAME@ +# define @NO_DEPRECATED_MACRO_NAME@ +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/Empty/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/Empty/libshared_export.h index b6749b257..e8af0a5c1 100644 --- a/Tests/Module/GenerateExportHeader/reference/Empty/libshared_export.h +++ b/Tests/Module/GenerateExportHeader/reference/Empty/libshared_export.h @@ -33,9 +33,10 @@ # define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSHARED_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSHARED_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/Empty/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/Empty/libstatic_export.h index e8000e251..598bd71be 100644 --- a/Tests/Module/GenerateExportHeader/reference/Empty/libstatic_export.h +++ b/Tests/Module/GenerateExportHeader/reference/Empty/libstatic_export.h @@ -33,9 +33,10 @@ # define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSTATIC_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSTATIC_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/MinGW/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/MinGW/libshared_export.h index d37663102..cc20e09b0 100644 --- a/Tests/Module/GenerateExportHeader/reference/MinGW/libshared_export.h +++ b/Tests/Module/GenerateExportHeader/reference/MinGW/libshared_export.h @@ -33,9 +33,10 @@ # define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSHARED_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSHARED_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/MinGW/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/MinGW/libstatic_export.h index fd021e9d0..4aaa84863 100644 --- a/Tests/Module/GenerateExportHeader/reference/MinGW/libstatic_export.h +++ b/Tests/Module/GenerateExportHeader/reference/MinGW/libstatic_export.h @@ -33,9 +33,10 @@ # define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSTATIC_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSTATIC_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/UNIX/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/UNIX/libshared_export.h index 7d8087f60..053ad1869 100644 --- a/Tests/Module/GenerateExportHeader/reference/UNIX/libshared_export.h +++ b/Tests/Module/GenerateExportHeader/reference/UNIX/libshared_export.h @@ -33,9 +33,10 @@ # define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSHARED_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSHARED_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/UNIX/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/UNIX/libstatic_export.h index fd021e9d0..4aaa84863 100644 --- a/Tests/Module/GenerateExportHeader/reference/UNIX/libstatic_export.h +++ b/Tests/Module/GenerateExportHeader/reference/UNIX/libstatic_export.h @@ -33,9 +33,10 @@ # define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSTATIC_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSTATIC_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h index 5681f5842..808ff0131 100644 --- a/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h +++ b/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h @@ -33,9 +33,10 @@ # define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSHARED_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSHARED_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h index fd021e9d0..4aaa84863 100644 --- a/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h +++ b/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h @@ -33,9 +33,10 @@ # define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSTATIC_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSTATIC_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h index d37663102..cc20e09b0 100644 --- a/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h +++ b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h @@ -33,9 +33,10 @@ # define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSHARED_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSHARED_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h index fd021e9d0..4aaa84863 100644 --- a/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h +++ b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h @@ -33,9 +33,10 @@ # define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSTATIC_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSTATIC_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/Win32/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/Win32/libshared_export.h index 976c92ef8..4e675af6c 100644 --- a/Tests/Module/GenerateExportHeader/reference/Win32/libshared_export.h +++ b/Tests/Module/GenerateExportHeader/reference/Win32/libshared_export.h @@ -33,9 +33,10 @@ # define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSHARED_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSHARED_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/Win32/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/Win32/libstatic_export.h index db4df61b4..4d5ed4ecd 100644 --- a/Tests/Module/GenerateExportHeader/reference/Win32/libstatic_export.h +++ b/Tests/Module/GenerateExportHeader/reference/Win32/libstatic_export.h @@ -33,9 +33,10 @@ # define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSTATIC_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSTATIC_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/WinEmpty/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/WinEmpty/libshared_export.h index 2dc41d414..84340e305 100644 --- a/Tests/Module/GenerateExportHeader/reference/WinEmpty/libshared_export.h +++ b/Tests/Module/GenerateExportHeader/reference/WinEmpty/libshared_export.h @@ -33,9 +33,10 @@ # define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSHARED_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSHARED_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +# endif #endif #endif diff --git a/Tests/Module/GenerateExportHeader/reference/WinEmpty/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/WinEmpty/libstatic_export.h index e8000e251..598bd71be 100644 --- a/Tests/Module/GenerateExportHeader/reference/WinEmpty/libstatic_export.h +++ b/Tests/Module/GenerateExportHeader/reference/WinEmpty/libstatic_export.h @@ -33,9 +33,10 @@ # define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED #endif -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define LIBSTATIC_NO_DEPRECATED +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef LIBSTATIC_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +# endif #endif #endif