diff --git a/cpp/BoostParts/CMakeLists.txt b/cpp/BoostParts/CMakeLists.txt index 14e37a4e..6b0d3675 100644 --- a/cpp/BoostParts/CMakeLists.txt +++ b/cpp/BoostParts/CMakeLists.txt @@ -118,3 +118,8 @@ if( MSVC ) set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL" ) set_target_properties( ${PROJECT_NAME} PROPERTIES STATIC_LIBRARY_FLAGS "/LTCG" ) endif() + +if( SYSTEM_IS_SUNOS ) + # SunOS needs this setting for thread support + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads" ) +endif() diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 7afe590b..fecda10b 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -28,6 +28,10 @@ if ( ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" ) set( SYSTEM_IS_FREEBSD true ) endif() +if ( ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" ) + set( SYSTEM_IS_SUNOS true ) +endif() + # Check if platform is 64 bit if( CMAKE_SIZEOF_VOID_P EQUAL 4 ) set( 64_BIT_PLATFORM 0 ) diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt index 52e7afd6..44ea8717 100644 --- a/cpp/ycm/CMakeLists.txt +++ b/cpp/ycm/CMakeLists.txt @@ -313,4 +313,9 @@ endif() ############################################################################# +if( SYSTEM_IS_SUNOS ) + # SunOS needs this setting for thread support + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads" ) +endif() + add_subdirectory( tests )