X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=CMakeLists.txt;h=89e8f819e6cc65e5db9538c24239494d28ede126;hb=2df0ca34aa3000dadf76633ca700abf0bf50756d;hp=a32cb00761e28b61a4bd013a41201661050384cd;hpb=f46e0745a842b2edc924b6d384acf01fd7034c62;p=platform%2Fupstream%2Fglog.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a32cb00..89e8f81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ set (CPACK_PACKAGE_VERSION ${GLOG_VERSION}) option (WITH_GFLAGS "Use gflags" ON) option (WITH_THREADS "Enable multithreading support" ON) +option (WITH_TLS "Enable Thread Local Storage (TLS) support" ON) list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) @@ -183,6 +184,31 @@ using namespace Outer::Inner;; int main() { return i; } " HAVE_NAMESPACES) +check_cxx_source_compiles (" +__declspec(thread) int tls; +int main() { } +" HAVE_MSVC_TLS) + +check_cxx_source_compiles (" +thread_local int tls; +int main() { } +" HAVE_CXX11_TLS) + +check_cxx_source_compiles (" +__attribute__((thread)) int tls; +int main() { } +" HAVE_CYGWIN_TLS) + +if (WITH_TLS) + if (HAVE_CYGWIN_TLS) + set (GLOG_THREAD_LOCAL_STORAGE "__attribute__((thread))") + elseif (HAVE_MSVC_TLS) + set (GLOG_THREAD_LOCAL_STORAGE "__declspec(thread)") + elseif (HAVE_CXX11_TLS) + set (GLOG_THREAD_LOCAL_STORAGE thread_local) + endif (HAVE_CYGWIN_TLS) +endif (WITH_TLS) + set (_PC_FIELDS "gregs[REG_PC]" "gregs[REG_EIP]"