2013-04-17 00:00:25 -04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
set(tokuportability_srcs
|
|
|
|
file.c
|
|
|
|
memory.c
|
|
|
|
os_malloc.c
|
|
|
|
portability.c
|
|
|
|
toku_assert.c
|
|
|
|
toku_pthread.c
|
2013-04-17 00:00:31 -04:00
|
|
|
toku_fair_rwlock.c
|
2013-04-17 00:00:25 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(${LIBTOKUPORTABILITY} SHARED ${tokuportability_srcs})
|
|
|
|
add_library(${LIBTOKUPORTABILITY}_static STATIC ${tokuportability_srcs})
|
|
|
|
maybe_add_gcov_to_libraries(${LIBTOKUPORTABILITY} ${LIBTOKUPORTABILITY}_static)
|
2013-04-17 00:00:26 -04:00
|
|
|
set_property(TARGET ${LIBTOKUPORTABILITY} ${LIBTOKUPORTABILITY}_static APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
|
2013-04-17 00:00:49 -04:00
|
|
|
add_space_separated_property(TARGET ${LIBTOKUPORTABILITY}_static COMPILE_FLAGS -fPIC)
|
2013-04-17 00:00:49 -04:00
|
|
|
target_link_libraries(${LIBTOKUPORTABILITY} LINK_PUBLIC ${CMAKE_THREAD_LIBS_INIT} dl)
|
2013-04-17 00:00:25 -04:00
|
|
|
|
2013-04-17 00:00:49 -04:00
|
|
|
if (CMAKE_C_COMPILER_ID STREQUAL Intel)
|
2013-04-17 00:00:27 -04:00
|
|
|
## ignore warning about cilkrts linking dynamically
|
2013-04-17 00:00:49 -04:00
|
|
|
add_space_separated_property(TARGET ${LIBTOKUPORTABILITY} LINK_FLAGS "-diag-disable 10237")
|
|
|
|
endif ()
|
2013-04-17 00:00:27 -04:00
|
|
|
|
2013-04-17 00:00:58 -04:00
|
|
|
set_property(SOURCE file.c memory.c os_malloc.c portability.c toku_assert.c toku_rwlock.c APPEND PROPERTY
|
|
|
|
COMPILE_DEFINITIONS TOKU_ALLOW_DEPRECATED=1)
|
2013-04-17 00:00:25 -04:00
|
|
|
|
|
|
|
install(
|
|
|
|
FILES toku_os_types.h toku_time.h
|
|
|
|
DESTINATION include
|
|
|
|
)
|
|
|
|
install(
|
|
|
|
TARGETS ${LIBTOKUPORTABILITY} ${LIBTOKUPORTABILITY}_static
|
|
|
|
DESTINATION lib
|
|
|
|
)
|
|
|
|
|
2013-04-17 00:00:27 -04:00
|
|
|
add_subdirectory(tests)
|