CMakeLists.txt 1.52 KB
Newer Older
1 2 3
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(tokuportability_srcs
4
  huge_page_detection
5 6 7 8 9 10
  file
  memory
  os_malloc
  portability
  toku_assert
  toku_fair_rwlock
Leif Walsh's avatar
Leif Walsh committed
11
  toku_path
12 13
  toku_pthread
  toku_time
14 15 16
  )

add_library(${LIBTOKUPORTABILITY} SHARED ${tokuportability_srcs})
17
target_link_libraries(${LIBTOKUPORTABILITY} LINK_PRIVATE jemalloc)
Leif Walsh's avatar
Leif Walsh committed
18
target_link_libraries(${LIBTOKUPORTABILITY} LINK_PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
19

20 21
add_library(tokuportability_static_conv STATIC ${tokuportability_srcs})
set_target_properties(tokuportability_static_conv PROPERTIES POSITION_INDEPENDENT_CODE ON)
22
add_dependencies(tokuportability_static_conv build_jemalloc)
23
set(tokuportability_source_libs tokuportability_static_conv jemalloc ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
24
toku_merge_static_libs(${LIBTOKUPORTABILITY}_static ${LIBTOKUPORTABILITY}_static "${tokuportability_source_libs}")
25 26 27 28

maybe_add_gcov_to_libraries(${LIBTOKUPORTABILITY} tokuportability_static_conv)
set_property(TARGET ${LIBTOKUPORTABILITY} tokuportability_static_conv APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)

29
set_property(SOURCE file memory os_malloc portability toku_assert toku_rwlock APPEND PROPERTY
30
  COMPILE_DEFINITIONS TOKU_ALLOW_DEPRECATED=1)
31

32 33 34 35 36 37 38 39 40 41 42
# detect when we are being built as a subproject
if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
  install(
    FILES toku_os_types.h toku_time.h
    DESTINATION include
    )
  install(
    TARGETS ${LIBTOKUPORTABILITY} ${LIBTOKUPORTABILITY}_static
    DESTINATION lib
    )
endif ()
43

44
add_subdirectory(tests)