projects
/
platform
/
upstream
/
glog.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #245 from DariuszOstolski/issue211
[platform/upstream/glog.git]
/
CMakeLists.txt
diff --git
a/CMakeLists.txt
b/CMakeLists.txt
index
061c182
..
2fd5351
100644
(file)
--- a/
CMakeLists.txt
+++ b/
CMakeLists.txt
@@
-194,6
+194,11
@@
int main() { return i; }
" HAVE_NAMESPACES)
check_cxx_source_compiles ("
" HAVE_NAMESPACES)
check_cxx_source_compiles ("
+__thread int tls;
+int main() { }
+" HAVE_GCC_TLS)
+
+check_cxx_source_compiles ("
__declspec(thread) int tls;
int main() { }
" HAVE_MSVC_TLS)
__declspec(thread) int tls;
int main() { }
" HAVE_MSVC_TLS)
@@
-203,19
+208,15
@@
thread_local int tls;
int main() { }
" HAVE_CXX11_TLS)
int main() { }
" HAVE_CXX11_TLS)
-check_cxx_source_compiles ("
-__attribute__((thread)) int tls;
-int main() { }
-" HAVE_CYGWIN_TLS)
-
if (WITH_TLS)
if (WITH_TLS)
- if (HAVE_CYGWIN_TLS)
- set (GLOG_THREAD_LOCAL_STORAGE "__attribute__((thread))")
+ # Cygwin does not support the thread attribute. Don't bother.
+ if (HAVE_GCC_TLS)
+ set (GLOG_THREAD_LOCAL_STORAGE "__thread")
elseif (HAVE_MSVC_TLS)
set (GLOG_THREAD_LOCAL_STORAGE "__declspec(thread)")
elseif (HAVE_CXX11_TLS)
set (GLOG_THREAD_LOCAL_STORAGE thread_local)
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 (HAVE_
GCC
_TLS)
endif (WITH_TLS)
set (_PC_FIELDS
endif (WITH_TLS)
set (_PC_FIELDS