Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
leak --(cherry picked from commit dd1330c53beec9c5abb8b23375062e6acf214632)
[simgrid.git] / buildtools / Cmake / Supernovae.cmake
1 ### Make supernovae files and libs
2
3 #############################################################################
4 ### Add here every files that should not be supernovaed (generated files) ###
5 #############################################################################
6 set(simgrid_fragile_sources
7   src/simdag/sd_daxloader.c
8   src/surf/surfxml_parse.c
9   src/xbt/graphxml_parse.c
10   src/xbt/mmalloc/mm.c
11   ${GTNETS_USED}
12   )
13
14 #####################################################
15 ### END OF CONFIGURATION, NO NEED TO READ FURTHER ###
16 #####################################################
17
18 ### Rebuild the supernovae source files
19 if (enable_supernovae) # I need supernovae
20
21   message(WARNING
22 "==============================================================================\n"
23 "WARNING\n"
24 "Supernovae builds are deprecated, and expected to be removed in the next version of SimGrid.\n"
25 "If you want this feature to be kept, please tell us at <simgrid-user@lists.gforge.inria.fr>.\n"
26 "===============================================================================
27 ")
28
29   # supernovae files are generated. I promise
30   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
31     PROPERTIES GENERATED true)
32   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c
33     PROPERTIES GENERATED true)
34
35   ADD_CUSTOM_COMMAND(
36     OUTPUT   ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
37     DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl ${simgrid_sources}
38     COMMAND  perl ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl --out=${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c '--fragile=${simgrid_fragile_sources}' '${simgrid_sources}'
39     WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
40     COMMENT "Generating supernovae_sg.c"
41     )
42
43
44   ADD_CUSTOM_COMMAND(
45     OUTPUT   ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c
46     DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl ${SMPI_SRC}
47     COMMAND  perl ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl --out=${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c  '${SMPI_SRC}'
48     WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
49     COMMENT "Generating supernovae_smpi.c"
50     )
51
52   ### Change the content of the libraries so that it contains only supernovae+fragiles
53   set(simgrid_sources
54     ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
55     ${simgrid_fragile_sources})
56
57   set(SMPI_SRC
58     ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c)
59
60 endif() # I need supernovae