1
1
include (GenerateExportHeader)
2
2
function (GENERATE_MANTID_EXPORT_HEADER TARGET_LIBRARY GENERATE_EXTERN)
3
3
string (TOUPPER "${TARGET_LIBRARY} " TARGET_NAME)
4
- set (CUSTOM "\n " )
5
-
6
- if (MSVC )
7
- set (CUSTOM
8
- "${CUSTOM} \n\
9
- #ifdef _WIN32\n\
10
- // 'identifier' : class 'type' needs to have dll-interface to be used by clients\n\
11
- // of class 'type2'\n\
12
- // Things from the std library give these warnings and we can't do anything\n\
13
- // about them.\n\
14
- #pragma warning(disable : 4251)\n\
15
- // Given that we are compiling everything with msvc under Windows and\n\
16
- // linking all with the same runtime we can disable the warning about\n\
17
- // inheriting from a non-exported interface, e.g. std::runtime_error */\n\
18
- #pragma warning(disable : 4275)\n\
19
- // Warning C4373: previous versions of the compiler did not override when\n\
20
- // parameters only differed by const/volatile qualifiers\n\
21
- // This is basically saying that it now follows the C++ standard and doesn't\n\
22
- // seem useful\n\
23
- #pragma warning(disable : 4373)\n\
24
- #endif\n\n\
25
- "
26
- )
27
- endif (MSVC )
28
-
29
4
set (CUSTOM
30
- "${CUSTOM} \
31
- #ifndef UNUSED_ARG\n\
32
- #define UNUSED_ARG(x) (void) x;\n\
33
- #endif\n\n\
5
+ "\n\
34
6
#ifndef ${TARGET_NAME} _DEPRECATED\n\
35
7
#define ${TARGET_NAME} _DEPRECATED(func) MANTID_${TARGET_NAME} _DEPRECATED func\n\
36
- #endif\n\n\
37
- "
8
+ #endif\n\n "
38
9
)
39
10
40
11
if (GENERATE_EXTERN)
@@ -49,9 +20,18 @@ function(GENERATE_MANTID_EXPORT_HEADER TARGET_LIBRARY GENERATE_EXTERN)
49
20
// EXTERN_IMPORT is defined in MantidKernel/System.h\n
50
21
#define EXTERN_MANTID_${TARGET_NAME} EXTERN_IMPORT\n\
51
22
#endif /* ${TARGET_LIBRARY} _EXPORTS*/\n\n\
52
- #include <cstdint>
53
23
"
54
24
)
25
+ else ()
26
+ # UNUSED_ARG is defined and cstdint is included in MantidKernel/System.h
27
+ set (CUSTOM
28
+ "${CUSTOM} \
29
+ #ifndef UNUSED_ARG\n\
30
+ #define UNUSED_ARG(x) (void) x;\n\
31
+ #endif\n\n\
32
+ #include <cstdint>\n "
33
+ )
34
+
55
35
endif (GENERATE_EXTERN)
56
36
57
37
generate_export_header(
0 commit comments