2017-03-14 13:47:39 +00:00
set ( CONFIG_COMMON ${ CMAKE_CURRENT_BINARY_DIR } /include/common/config_common.h )
2017-01-25 22:24:36 +00:00
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /include/common/config_common.h.in ${ CONFIG_COMMON } )
2017-01-18 23:28:23 +00:00
2018-06-19 18:09:09 +00:00
add_library ( apple_rt
s r c / a p p l e _ r t . c p p
i n c l u d e / p o r t / c l o c k . h
)
target_include_directories ( apple_rt PUBLIC ${ COMMON_INCLUDE_DIR } )
2018-07-20 16:56:39 +00:00
if ( DEFINED APPLE_HAVE_CLOCK_GETTIME )
target_compile_definitions ( apple_rt PUBLIC -DAPPLE_HAVE_CLOCK_GETTIME= ${ APPLE_HAVE_CLOCK_GETTIME } )
endif ( )
2016-10-26 22:27:38 +00:00
2018-08-27 14:39:20 +00:00
add_library ( common ${ LINK_MODE }
2017-04-01 07:20:54 +00:00
s r c / D a t e L U T . c p p
s r c / D a t e L U T I m p l . c p p
2018-02-16 14:51:14 +00:00
s r c / p r e c i s e E x p 1 0 . c
2018-01-13 18:01:31 +00:00
s r c / s h i f t 1 0 . c p p
2017-11-16 19:17:09 +00:00
s r c / m r e m a p . c p p
2017-04-01 07:20:54 +00:00
s r c / J S O N . c p p
2017-06-22 15:57:37 +00:00
s r c / g e t M e m o r y A m o u n t . c p p
2018-04-09 13:52:39 +00:00
s r c / d e m a n g l e . c p p
2018-05-21 17:27:18 +00:00
s r c / S e t T e r m i n a l E c h o . c p p
2016-02-07 21:58:58 +00:00
2017-04-16 05:40:17 +00:00
i n c l u d e / c o m m o n / T y p e s . h
2018-09-17 03:09:56 +00:00
i n c l u d e / c o m m o n / D a y N u m . h
2017-04-01 07:20:54 +00:00
i n c l u d e / c o m m o n / D a t e L U T . h
i n c l u d e / c o m m o n / D a t e L U T I m p l . h
i n c l u d e / c o m m o n / L o c a l D a t e . h
i n c l u d e / c o m m o n / L o c a l D a t e T i m e . h
i n c l u d e / c o m m o n / E r r o r H a n d l e r s . h
2018-02-16 14:51:14 +00:00
i n c l u d e / c o m m o n / p r e c i s e E x p 1 0 . h
2018-01-13 18:01:31 +00:00
i n c l u d e / c o m m o n / s h i f t 1 0 . h
2017-11-16 19:17:09 +00:00
i n c l u d e / c o m m o n / m r e m a p . h
2017-04-01 07:20:54 +00:00
i n c l u d e / c o m m o n / l i k e l y . h
i n c l u d e / c o m m o n / l o g g e r _ u s e f u l . h
i n c l u d e / c o m m o n / s t r o n g _ t y p e d e f . h
i n c l u d e / c o m m o n / J S O N . h
2017-06-22 15:57:37 +00:00
i n c l u d e / c o m m o n / g e t M e m o r y A m o u n t . h
2018-04-09 13:52:39 +00:00
i n c l u d e / c o m m o n / d e m a n g l e . h
2018-05-21 17:27:18 +00:00
i n c l u d e / c o m m o n / S e t T e r m i n a l E c h o . h
2018-11-25 00:08:50 +00:00
i n c l u d e / c o m m o n / f i n d _ s y m b o l s . h
2018-12-30 15:54:45 +00:00
i n c l u d e / c o m m o n / c o n s t e x p r _ h e l p e r s . h
2016-02-07 21:58:58 +00:00
2017-06-07 01:48:22 +00:00
i n c l u d e / e x t / b i t _ c a s t . h
i n c l u d e / e x t / c o l l e c t i o n _ c a s t . h
i n c l u d e / e x t / e n u m e r a t e . h
i n c l u d e / e x t / f u n c t i o n _ t r a i t s . h
i n c l u d e / e x t / i d e n t i t y . h
i n c l u d e / e x t / m a p . h
i n c l u d e / e x t / r a n g e . h
i n c l u d e / e x t / s c o p e _ g u a r d . h
i n c l u d e / e x t / s i z e . h
i n c l u d e / e x t / u n l o c k _ g u a r d . h
2017-07-10 04:34:14 +00:00
i n c l u d e / e x t / s i n g l e t o n . h
2016-02-07 21:58:58 +00:00
2017-04-01 07:20:54 +00:00
$ { C O N F I G _ C O M M O N }
2016-02-07 21:58:58 +00:00
)
2018-08-02 00:20:20 +00:00
# When testing for memory leaks with Valgrind, dont link tcmalloc or jemalloc.
2017-01-27 20:00:02 +00:00
if ( USE_JEMALLOC )
2018-08-02 00:20:20 +00:00
message ( STATUS "Link jemalloc: ${JEMALLOC_LIBRARIES}" )
2017-04-01 07:20:54 +00:00
set ( MALLOC_LIBRARIES ${ JEMALLOC_LIBRARIES } )
2018-01-15 11:59:00 +00:00
2018-08-02 00:20:20 +00:00
elseif ( USE_TCMALLOC )
2018-01-15 11:59:00 +00:00
if ( DEBUG_TCMALLOC AND NOT GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG )
2018-08-02 00:20:20 +00:00
message ( FATAL_ERROR "Requested DEBUG_TCMALLOC but debug library is not found. You should install Google Perftools. Example: sudo apt-get install libgoogle-perftools-dev" )
2018-01-15 11:59:00 +00:00
endif ( )
if ( DEBUG_TCMALLOC AND GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG )
2017-04-01 07:20:54 +00:00
message ( STATUS "Link libtcmalloc_minimal_debug for testing: ${GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG}" )
set ( MALLOC_LIBRARIES ${ GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG } )
else ( )
2018-08-02 00:20:20 +00:00
message ( STATUS "Link libtcmalloc_minimal: ${GPERFTOOLS_TCMALLOC_MINIMAL}" )
2017-04-01 07:20:54 +00:00
set ( MALLOC_LIBRARIES ${ GPERFTOOLS_TCMALLOC_MINIMAL } )
endif ( )
2018-08-08 03:40:10 +00:00
elseif ( SANITIZE )
message ( STATUS "Will use ${SANITIZE} sanitizer." )
2016-12-01 22:44:59 +00:00
else ( )
2018-08-02 00:20:20 +00:00
message ( WARNING "Non default allocator is disabled. This is not recommended for production Linux builds." )
2016-12-01 22:44:59 +00:00
endif ( )
2016-02-07 21:58:58 +00:00
2017-09-15 05:27:09 +00:00
if ( USE_INTERNAL_MEMCPY )
set ( MEMCPY_LIBRARIES memcpy )
endif ( )
2017-01-11 13:40:02 +00:00
find_package ( Threads )
2017-06-23 20:22:35 +00:00
target_include_directories ( common BEFORE PRIVATE ${ CCTZ_INCLUDE_DIR } )
2017-08-03 12:44:39 +00:00
target_include_directories ( common PUBLIC ${ COMMON_INCLUDE_DIR } )
2017-06-23 14:41:07 +00:00
2018-01-18 20:33:16 +00:00
if ( NOT USE_INTERNAL_BOOST_LIBRARY )
target_include_directories ( common BEFORE PUBLIC ${ Boost_INCLUDE_DIRS } )
endif ( )
2018-11-21 19:20:27 +00:00
target_link_libraries ( common
P R I V A T E
2017-04-01 07:20:54 +00:00
p o c o e x t
2018-11-21 19:20:27 +00:00
P U B L I C
$ { P o c o _ F o u n d a t i o n _ L I B R A R Y }
2017-08-09 20:52:55 +00:00
$ { C I T Y H A S H _ L I B R A R I E S }
2018-11-21 19:20:27 +00:00
P R I V A T E
2017-06-23 14:41:07 +00:00
$ { C C T Z _ L I B R A R Y }
2017-04-01 07:20:54 +00:00
$ { B o o s t _ F I L E S Y S T E M _ L I B R A R Y }
2018-11-21 19:20:27 +00:00
P U B L I C
2018-08-21 23:57:59 +00:00
$ { B o o s t _ S Y S T E M _ L I B R A R Y }
2018-11-21 19:20:27 +00:00
P R I V A T E
2017-04-01 07:20:54 +00:00
$ { M A L L O C _ L I B R A R I E S }
2019-01-28 18:21:20 +00:00
T h r e a d s : : T h r e a d s
2017-09-15 05:27:09 +00:00
$ { M E M C P Y _ L I B R A R I E S } )
2016-05-28 00:16:28 +00:00
2018-02-26 00:19:42 +00:00
if ( RT_LIBRARY )
2018-11-21 19:20:27 +00:00
target_link_libraries ( common PRIVATE ${ RT_LIBRARY } )
2018-02-26 00:19:42 +00:00
endif ( )
2016-12-01 22:44:59 +00:00
if ( ENABLE_TESTS )
2017-04-01 07:20:54 +00:00
add_subdirectory ( src/tests )
2017-04-10 17:43:30 +00:00
endif ( )