CMakeLists.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. project (dmmlib C)
  2. cmake_minimum_required (VERSION 2.6)
  3. set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
  4. include(DefineOptions.cmake)
  5. include(MacroEnsureOutOfSourceBuild)
  6. macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")
  7. if(CMAKE_COMPILER_IS_GNUCC AND LINUXTEST)
  8. add_definitions(-std=c99)
  9. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wconversion -Wstrict-prototypes")
  10. endif(CMAKE_COMPILER_IS_GNUCC AND LINUXTEST)
  11. configure_file (
  12. "${PROJECT_SOURCE_DIR}/dmm_config.h.in"
  13. "${PROJECT_BINARY_DIR}/dmm_config.h"
  14. )
  15. include_directories("${PROJECT_BINARY_DIR}")
  16. add_subdirectory(include)
  17. add_subdirectory(src)
  18. if (WITH_EXAMPLES)
  19. add_subdirectory(examples)
  20. endif (WITH_EXAMPLES)
  21. if (WITH_DOC)
  22. add_subdirectory(doc)
  23. endif (WITH_DOC)
  24. message(STATUS "********************************************")
  25. message(STATUS "********** ${PROJECT_NAME} build options : **********")
  26. message(STATUS "Support for just one allocator: " ${WITH_SINGLE_ALLOCATOR})
  27. message(STATUS "OS call for memory requests: " ${WITH_SYSTEM_CALLS})
  28. if(NOT WITH_SYSTEM_CALLS STREQUAL "none")
  29. message(STATUS "Requesting blocks multiple of: " ${SYS_ALLOC_SIZE} " bytes")
  30. endif(NOT WITH_SYSTEM_CALLS STREQUAL "none")
  31. message(STATUS "POSIX locking mechanisms: " ${HAVE_LOCKS})
  32. message(STATUS "Number of heaps per allocator: " ${NUM_HEAPS})
  33. if(BLOCKS_ORGANIZATION STREQUAL "dll")
  34. message(STATUS "Block organization: Doubly-Linked Lists")
  35. else(BLOCKS_ORGANIZATION STREQUAL "dll")
  36. message(STATUS "Block organization: Singly-Linked Lists")
  37. endif(BLOCKS_ORGANIZATION STREQUAL "dll")
  38. if(SORT_POLICY STREQUAL "lifo")
  39. message(STATUS "Block sorting policy: LIFO-ordered")
  40. elseif(SORT_POLICY STREQUAL "fifo")
  41. message(STATUS "Block sorting policy: FIFO-ordered")
  42. elseif(SORT_POLICY STREQUAL "size")
  43. message(STATUS "Block sorting policy: Size-ordered")
  44. elseif(SORT_POLICY STREQUAL "address")
  45. message(STATUS "Block sorting policy: Address-ordered")
  46. endif(SORT_POLICY STREQUAL "lifo")
  47. message(STATUS "Predefined lists of fixed-sized blocks: " ${WITH_FIXED_LISTS})
  48. message(STATUS "Requested Size per Block: " ${REQUEST_SIZE_INFO})
  49. message(STATUS "Heap Ownership per Block: " ${WITH_OWNERSHIP})
  50. message(STATUS "Have statistics: " ${WITH_STATS})
  51. if (WITH_STATS)
  52. message(STATUS "Count memory accesses: " ${COUNT_ACCESSES})
  53. message(STATUS "Count hops per request: " ${COUNT_HOPS})
  54. endif (WITH_STATS)
  55. message(STATUS "Have knobs: " ${WITH_KNOBS})
  56. message(STATUS "Search policy: " ${SEARCH_POLICY})
  57. if(ALLOC_VAR_FIT OR HEAP_VAR_FIT)
  58. message(STATUS "Initial search policy: " ${INITIAL_SEARCH_POLICY})
  59. endif(ALLOC_VAR_FIT OR HEAP_VAR_FIT)
  60. if(GOOD_FIT)
  61. message(STATUS "Acceptable fit percentage: " ${FIT_PERCENTAGE})
  62. endif(GOOD_FIT)
  63. message(STATUS "Coalescing: " ${WITH_COALESCING})
  64. if(MAX_COALESCE_SIZE)
  65. if(WITH_COALESCING STREQUAL "fixed")
  66. message(STATUS " with max. coalescing size: " ${MAX_COALESCE_SIZE} " bytes")
  67. elseif(WITH_COALESCING STREQUAL "variable")
  68. message(STATUS " with initial max. coalescing size: " ${MAX_COALESCE_SIZE}
  69. " bytes")
  70. endif(WITH_COALESCING STREQUAL "fixed")
  71. endif(MAX_COALESCE_SIZE)
  72. message(STATUS "Splitting: " ${WITH_SPLITTING})
  73. if(MIN_SPLITTING_SIZE)
  74. if(WITH_SPLITTING STREQUAL "fixed")
  75. message(STATUS " with min. spliting size: " ${MIN_SPLITTING_SIZE} " bytes")
  76. elseif(WITH_SPLITTING STREQUAL "variable")
  77. message(STATUS " with initial min. spliting size: "
  78. ${MIN_SPLITTING_SIZE} " bytes")
  79. endif(WITH_SPLITTING STREQUAL "fixed")
  80. if(COALESCE_AFTER_SPLIT)
  81. message(STATUS "Coalesce after split: " ${COALESCE_AFTER_SPLIT})
  82. endif(COALESCE_AFTER_SPLIT)
  83. endif(MIN_SPLITTING_SIZE)
  84. message(STATUS "Adaptivity: " ${WITH_ADAPTIVITY})
  85. message(STATUS "Support for realloc(): " ${WITH_REALLOC})
  86. message(STATUS "********************************************")