Skip to content

Commit e47801e

Browse files
Only include some defines if not importing MantidKernel/System.h
1 parent 4da782c commit e47801e

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

buildconfig/CMake/GenerateMantidExportHeader.cmake

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
include(GenerateExportHeader)
22
function(GENERATE_MANTID_EXPORT_HEADER TARGET_LIBRARY GENERATE_EXTERN)
33
string(TOUPPER "${TARGET_LIBRARY}" TARGET_NAME)
4-
set(CUSTOM "\n")
5-
64
set(CUSTOM
7-
"${CUSTOM}\
8-
#ifndef UNUSED_ARG\n\
9-
#define UNUSED_ARG(x) (void) x;\n\
10-
#endif\n\n\
5+
"\n\
116
#ifndef ${TARGET_NAME}_DEPRECATED\n\
127
#define ${TARGET_NAME}_DEPRECATED(func) MANTID_${TARGET_NAME}_DEPRECATED func\n\
13-
#endif\n\n\
14-
"
8+
#endif\n\n"
159
)
1610

1711
if(GENERATE_EXTERN)
@@ -26,9 +20,18 @@ function(GENERATE_MANTID_EXPORT_HEADER TARGET_LIBRARY GENERATE_EXTERN)
2620
// EXTERN_IMPORT is defined in MantidKernel/System.h\n
2721
#define EXTERN_MANTID_${TARGET_NAME} EXTERN_IMPORT\n\
2822
#endif /* ${TARGET_LIBRARY}_EXPORTS*/\n\n\
29-
#include <cstdint>
3023
"
3124
)
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+
3235
endif(GENERATE_EXTERN)
3336

3437
generate_export_header(

0 commit comments

Comments
 (0)