2019-08-31 22:13:02 +08:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
|
|
set(TEST_OSAL windows)
|
|
|
|
else()
|
|
|
|
set(TEST_OSAL unix)
|
|
|
|
endif()
|
2018-01-04 14:27:09 +08:00
|
|
|
|
2019-08-31 22:13:02 +08:00
|
|
|
add_executable(mdbx_test
|
2018-11-04 23:57:36 +08:00
|
|
|
base.h
|
|
|
|
cases.cc
|
|
|
|
chrono.cc
|
|
|
|
chrono.h
|
|
|
|
config.cc
|
|
|
|
config.h
|
|
|
|
copy.cc
|
|
|
|
dead.cc
|
|
|
|
hill.cc
|
|
|
|
jitter.cc
|
|
|
|
keygen.cc
|
|
|
|
keygen.h
|
|
|
|
log.cc
|
|
|
|
log.h
|
|
|
|
main.cc
|
|
|
|
osal.h
|
2019-08-31 22:13:02 +08:00
|
|
|
osal-${TEST_OSAL}.cc
|
2018-11-04 23:57:36 +08:00
|
|
|
test.cc
|
|
|
|
test.h
|
|
|
|
try.cc
|
|
|
|
utils.cc
|
|
|
|
utils.h
|
2019-02-04 03:37:57 +08:00
|
|
|
append.cc
|
2019-06-22 03:42:45 +08:00
|
|
|
ttl.cc
|
2019-10-10 04:38:44 +08:00
|
|
|
nested.cc
|
2018-11-04 23:57:36 +08:00
|
|
|
)
|
2018-01-04 14:27:09 +08:00
|
|
|
|
2019-08-31 22:13:02 +08:00
|
|
|
set_target_properties(mdbx_test PROPERTIES
|
|
|
|
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>
|
2019-10-22 17:14:26 +08:00
|
|
|
CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
|
2018-01-04 14:27:09 +08:00
|
|
|
|
2019-08-31 22:13:02 +08:00
|
|
|
if(CC_HAS_FASTMATH)
|
|
|
|
target_compile_options(mdbx_test PRIVATE "-ffast-math")
|
|
|
|
endif()
|
|
|
|
if(CC_HAS_VISIBILITY AND (LTO_ENABLED OR INTERPROCEDURAL_OPTIMIZATION))
|
|
|
|
set_target_properties(mdbx_test PROPERTIES LINK_FLAGS "-fvisibility=hidden")
|
|
|
|
endif()
|
|
|
|
|
2019-09-03 07:24:19 +08:00
|
|
|
target_link_libraries(mdbx_test mdbx ${LIB_MATH} ${CMAKE_THREAD_LIBS_INIT})
|
2019-08-31 22:13:02 +08:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
|
|
target_link_libraries(mdbx_test winmm.lib)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UNIX AND NOT SUBPROJECT)
|
|
|
|
add_subdirectory(pcrf)
|
|
|
|
endif()
|