1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
enable_tnt_compile_flags()
include_directories(${LUAJIT_INCLUDE_DIRS})
include_directories(${MSGPUCK_INCLUDE_DIRS})
function(build_module module files)
add_library(${module} SHARED ${files})
set_target_properties(${module} PROPERTIES PREFIX "")
add_dependencies(${module} api)
if(TARGET_OS_DARWIN)
set_target_properties(${module} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(TARGET_OS_DARWIN)
endfunction()
function(build_lualib lib sources)
add_library(${lib} SHARED ${sources})
set_target_properties(${lib} PROPERTIES PREFIX "")
if(TARGET_OS_DARWIN)
set_target_properties(${lib} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(TARGET_OS_DARWIN)
endfunction()
add_compile_flags("C;CXX"
"-Wno-unused-parameter")
# WARNING: This change affects current cmake variable scope and so
# a user should care to don't use it in a top level scope.
# The dynamic libraries will be loaded from tarantool executable
# and will use symbols from it. So it is completely okay to have
# unresolved symbols at build time.
string(REPLACE "-Wl,--no-undefined" ""
CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
if(POLICY CMP0037)
if(CMAKE_VERSION VERSION_LESS 3.11)
# cmake below 3.11 reserves name test. Use old policy.
# https://cmake.org/cmake/help/v3.11/release/3.11.html#other-changes
cmake_policy(SET CMP0037 OLD)
else()
# Starting from cmake 3.11 name test reserved in special
# cases and can be used as target name.
cmake_policy(SET CMP0037 NEW)
endif()
endif(POLICY CMP0037)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${PROJECT_SOURCE_DIR}/third_party/luajit/test
${CMAKE_CURRENT_BINARY_DIR}/luajit-tap)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/small
COMMAND ${CMAKE_COMMAND} -E create_symlink
${PROJECT_SOURCE_DIR}/src/lib/small/test/
${CMAKE_CURRENT_BINARY_DIR}/small
COMMENT Create a symlink for libsmall to fix out-of-source tests)
add_custom_target(symlink_small_tests ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small)
add_custom_target(test
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small
${CMAKE_CURRENT_BINARY_DIR}/luajit-tap
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py
--builddir=${PROJECT_BINARY_DIR}
--vardir=${PROJECT_BINARY_DIR}/test/var)
add_custom_target(test-force
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small
${CMAKE_CURRENT_BINARY_DIR}/luajit-tap
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py
--builddir=${PROJECT_BINARY_DIR}
--vardir=${PROJECT_BINARY_DIR}/test/var
--force)
add_subdirectory(app)
add_subdirectory(app-tap)
add_subdirectory(box)
add_subdirectory(box-tap)
add_subdirectory(unit)
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/luajit/test/gh-4427-ffi-sandwich ${PROJECT_BINARY_DIR}/third_party/luajit/test/gh-4427-ffi-sandwich)
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/luajit/test/lj-flush-on-trace ${PROJECT_BINARY_DIR}/third_party/luajit/test/lj-flush-on-trace)
# Move tarantoolctl config
if (NOT ${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
configure_file(
"${PROJECT_SOURCE_DIR}/test/.tarantoolctl"
"${PROJECT_BINARY_DIR}/test/.tarantoolctl"
)
endif()
# Disable connector_c for 1.6
#add_subdirectory(connector_c)
|