CMakeLists.txt 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 -Wuninitialized -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 "Memory space awareness: " ${WITH_MEMORY_SPACE_AWARENESS})
  27. message(STATUS "OS call for memory requests: " ${WITH_SYSTEM_CALLS})
  28. message(STATUS "POSIX locking mechanisms: " ${HAVE_LOCKS})
  29. if(BLOCKS_ORGANIZATION STREQUAL "dll")
  30. message(STATUS "Block organization: Doubly-Linked Lists")
  31. else(BLOCKS_ORGANIZATION STREQUAL "dll")
  32. message(STATUS "Block organization: Singly-Linked Lists")
  33. endif(BLOCKS_ORGANIZATION STREQUAL "dll")
  34. message(STATUS "Predefined lists of fixed-sized blocks: " ${WITH_FIXED_LISTS})
  35. message(STATUS "Heap Ownership per Block: " ${WITH_OWNERSHIP})
  36. message(STATUS "Have statistics: " ${WITH_STATS})
  37. if (WITH_STATS)
  38. message(STATUS "Count memory accesses: " ${COUNT_ACCESSES})
  39. message(STATUS "Count hops per request: " ${COUNT_HOPS})
  40. endif (WITH_STATS)
  41. message(STATUS "Have knobs: " ${WITH_KNOBS})
  42. message(STATUS "Search policy: " ${SEARCH_POLICY})
  43. if(ALLOC_VAR_FIT OR HEAP_VAR_FIT)
  44. message(STATUS "Initial search policy: " ${INITIAL_SEARCH_POLICY})
  45. endif(ALLOC_VAR_FIT OR HEAP_VAR_FIT)
  46. if(GOOD_FIT)
  47. message(STATUS "Acceptable fit percentage: " ${FIT_PERCENTAGE})
  48. endif(GOOD_FIT)
  49. message(STATUS "Coalescing: " ${WITH_COALESCING})
  50. if(MAX_COALESCE_SIZE)
  51. if(WITH_COALESCING STREQUAL "fixed")
  52. message(STATUS " with max. coalescing size: " ${MAX_COALESCE_SIZE} " bytes")
  53. elseif(WITH_COALESCING STREQUAL "variable")
  54. message(STATUS " with initial max. coalescing size: " ${MAX_COALESCE_SIZE}
  55. " bytes")
  56. endif(WITH_COALESCING STREQUAL "fixed")
  57. endif(MAX_COALESCE_SIZE)
  58. message(STATUS "Splitting: " ${WITH_SPLITTING})
  59. if(MIN_SPLITTING_SIZE)
  60. if(WITH_SPLITTING STREQUAL "fixed")
  61. message(STATUS " with min. spliting size: " ${MIN_SPLITTING_SIZE} " bytes")
  62. elseif(WITH_SPLITTING STREQUAL "variable")
  63. message(STATUS " with initial min. spliting size: "
  64. ${MIN_SPLITTING_SIZE} " bytes")
  65. endif(WITH_SPLITTING STREQUAL "fixed")
  66. endif(MIN_SPLITTING_SIZE)
  67. message(STATUS "Adaptivity: " ${WITH_ADAPTIVITY})
  68. message(STATUS "Support for realloc(): " ${WITH_REALLOC})
  69. message(STATUS "Replace function calls: " ${REPLACE_MALLOC})
  70. message(STATUS "********************************************")