In certain cases when usleep is passed a small value, there is a race condition that would cause the process to hang and then when an attempt to quit the thread was made new contexts would be allocated rapidly filling all available memory.
141 lines
4.2 KiB
CMake
141 lines
4.2 KiB
CMake
PROJECT( fc )
|
|
|
|
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.0 )
|
|
|
|
SET( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" )
|
|
SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" )
|
|
|
|
INCLUDE( VersionMacros )
|
|
INCLUDE( SetupTargetMacros )
|
|
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
|
|
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include )
|
|
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/cyoencode-1.0.2/src )
|
|
|
|
SET( DEFAULT_HEADER_INSTALL_DIR include/\${target} )
|
|
SET( DEFAULT_LIBRARY_INSTALL_DIR lib/ )
|
|
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
|
|
SET( CMAKE_DEBUG_POSTFIX _debug )
|
|
SET( BUILD_SHARED_LIBS NO )
|
|
|
|
if( WIN32 )
|
|
set( RPCRT4 Rpcrt4 )
|
|
#boost
|
|
SET( Boost_INCLUDE_DIR $ENV{BOOST_ROOT} )
|
|
#Using shared libs for boost on windows
|
|
else(WIN32)
|
|
SET(Boost_USE_STATIC_LIBS ON)
|
|
FIND_PACKAGE(Boost 1.51 COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context )
|
|
endif( WIN32 )
|
|
|
|
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
|
|
|
|
IF( WIN32 )
|
|
ADD_DEFINITIONS( -DWIN32 )
|
|
ADD_DEFINITIONS( -DNOMINMAX )
|
|
ADD_DEFINITIONS( -D_WIN32_WINNT=0x0501 )
|
|
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
|
ADD_DEFINITIONS( -D_SCL_SERCURE_NO_WARNINGS )
|
|
|
|
# Activate C++ exception handling
|
|
IF (NOT CMAKE_CXX_FLAGS MATCHES "/EHsc")
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
|
|
ENDIF()
|
|
ELSE(WIN32)
|
|
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include )
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-unused-local-typedefs -fmax-errors=3" )
|
|
ENDIF(WIN32)
|
|
|
|
if( UNIX )
|
|
if( NOT APPLE )
|
|
set(rt_library rt )
|
|
set(pthread_library pthread)
|
|
endif()
|
|
endif()
|
|
|
|
option( UNITY_BUILD OFF )
|
|
|
|
FIND_PACKAGE( OpenSSL )
|
|
include_directories( ${Boost_INCLUDE_DIR} )
|
|
include_directories( ${OPENSSL_INCLUDE_DIR} )
|
|
|
|
SET( ALL_OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE})
|
|
|
|
set( fc_sources
|
|
src/uint128.cpp
|
|
src/variant.cpp
|
|
src/exception.cpp
|
|
src/variant_object.cpp
|
|
src/thread/thread.cpp
|
|
src/thread/future.cpp
|
|
src/thread/task.cpp
|
|
src/thread/spin_lock.cpp
|
|
src/thread/spin_yield_lock.cpp
|
|
src/thread/mutex.cpp
|
|
src/asio.cpp
|
|
src/string.cpp
|
|
src/shared_ptr.cpp
|
|
src/time.cpp
|
|
src/io/iostream.cpp
|
|
src/io/datastream.cpp
|
|
src/io/buffered_iostream.cpp
|
|
src/io/fstream.cpp
|
|
src/io/sstream.cpp
|
|
src/io/json.cpp
|
|
src/io/varint.cpp
|
|
src/filesystem.cpp
|
|
src/interprocess/process.cpp
|
|
src/interprocess/file_mapping.cpp
|
|
src/interprocess/mmap_struct.cpp
|
|
src/rpc/json_connection.cpp
|
|
src/log/log_message.cpp
|
|
src/log/logger.cpp
|
|
src/log/appender.cpp
|
|
src/log/console_appender.cpp
|
|
src/log/file_appender.cpp
|
|
src/log/logger_config.cpp
|
|
src/crypto/openssl.cpp
|
|
src/crypto/aes.cpp
|
|
src/crypto/crc.cpp
|
|
src/crypto/city.cpp
|
|
src/crypto/base32.cpp
|
|
src/crypto/base36.cpp
|
|
src/crypto/base58.cpp
|
|
src/crypto/base64.cpp
|
|
src/crypto/bigint.cpp
|
|
src/crypto/hex.cpp
|
|
src/crypto/sha1.cpp
|
|
src/crypto/ripemd160.cpp
|
|
src/crypto/sha256.cpp
|
|
src/crypto/sha224.cpp
|
|
src/crypto/sha512.cpp
|
|
src/crypto/dh.cpp
|
|
src/crypto/blowfish.cpp
|
|
src/crypto/elliptic.cpp
|
|
src/network/tcp_socket.cpp
|
|
src/network/udp_socket.cpp
|
|
src/network/http/http_connection.cpp
|
|
src/network/http/http_server.cpp
|
|
src/network/ip.cpp
|
|
src/network/resolve.cpp
|
|
src/network/url.cpp
|
|
src/compress/smaz.cpp
|
|
vendor/cyoencode-1.0.2/src/CyoDecode.c
|
|
vendor/cyoencode-1.0.2/src/CyoEncode.c
|
|
)
|
|
|
|
set( sources
|
|
${fc_sources}
|
|
)
|
|
add_subdirectory( vendor/easylzma )
|
|
|
|
setup_library( fc SOURCES ${sources} LIBRARY_TYPE STATIC )
|
|
|
|
set( BOOST_LIBRARIES ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_CHRONO_LIBRARY} ${ALL_OPENSSL_LIBRARIES} ${Boost_COROUTINE_LIBRARY} ${Boost_CONTEXT_LIBRARY} )
|
|
|
|
#add_executable( test_compress tests/compress.cpp )
|
|
#target_link_libraries( test_compress fc ${BOOST_LIBRARIES} )
|
|
#add_executable( test_aes tests/aes_test.cpp )
|
|
#target_link_libraries( test_aes fc ${BOOST_LIBRARIES} )
|
|
#add_executable( test_sleep tests/sleep.cpp )
|
|
#target_link_libraries( test_sleep fc ${BOOST_LIBRARIES} )
|
|
|