cmake HAVE_THREAD_LOCAL examples

GreatSQL/GreatSQL cmake/compiler_features.cmake :150

CHECK_CXX_SOURCE_RUNS("
#if defined(_MSC_VER) && !defined(__thread)
#define __thread __declspec(thread)
#endif
int main() {
  static __thread int tls;
  return 0;
}
" HAVE_THREAD_LOCAL)

GreatSQL/GreatSQL storage/rocksdb/CMakeLists.txt :365

CHECK_CXX_SOURCE_COMPILES("
#if defined(_MSC_VER) && !defined(__thread)
#define __thread __declspec(thread)
#endif
int main() {
  static __thread int tls __attribute__((unused));
}
" HAVE_THREAD_LOCAL)

percona/percona-server cmake/compiler_features.cmake :123

CHECK_CXX_SOURCE_RUNS("
  #if defined(_MSC_VER) && !defined(__thread)
  #define __thread __declspec(thread)
  #endif
  int main() {
    static __thread int tls;
    return 0;
  }
  " HAVE_THREAD_LOCAL)

facebook/mysql-5.6 cmake/compiler_features.cmake :123

CHECK_CXX_SOURCE_RUNS("
  #if defined(_MSC_VER) && !defined(__thread)
  #define __thread __declspec(thread)
  #endif
  int main() {
    static __thread int tls;
    return 0;
  }
  " HAVE_THREAD_LOCAL)

steemit/steem libraries/vendor/rocksdb/CMakeLists.txt :246

CHECK_CXX_SOURCE_COMPILES("
#if defined(_MSC_VER) && !defined(__thread)
#define __thread __declspec(thread)
#endif
int main() {
  static __thread int tls;
}
" HAVE_THREAD_LOCAL)

mozilla/mozjpeg CMakeLists.txt :540

check_c_source_compiles("static ${THREAD_LOCAL} int i;  int main(void) { i = 0;  return i; }"
  HAVE_THREAD_LOCAL)

orbbec/OrbbecSDK_v2 3rdparty/libjpeg/src/CMakeLists.txt :503

check_c_source_compiles("${THREAD_LOCAL} int i;  int main(void) { i = 0;  return i; }" HAVE_THREAD_LOCAL)

Tencent/Tendis src/thirdparty/rocksdb-5.13.4/rocksdb/CMakeLists.txt :243

CHECK_CXX_SOURCE_COMPILES("
#if defined(_MSC_VER) && !defined(__thread)
#define __thread __declspec(thread)
#endif
int main() {
  static __thread int tls;
}
" HAVE_THREAD_LOCAL)

bytedance/terarkdb CMakeLists.txt :325

CHECK_CXX_SOURCE_COMPILES("
#if defined(_MSC_VER) && !defined(__thread)
#define __thread __declspec(thread)
#endif
int main() {
  static __thread int tls;
}
" HAVE_THREAD_LOCAL)

SpanDB/SpanDB CMakeLists.txt :268

CHECK_CXX_SOURCE_COMPILES("
#if defined(_MSC_VER) && !defined(__thread)
#define __thread __declspec(thread)
#endif
int main() {
  static __thread int tls;
}
" HAVE_THREAD_LOCAL)

percona/percona-xtradb-cluster cmake/compiler_features.cmake :123

CHECK_CXX_SOURCE_RUNS("
  #if defined(_MSC_VER) && !defined(__thread)
  #define __thread __declspec(thread)
  #endif
  int main() {
    static __thread int tls;
    return 0;
  }
  " HAVE_THREAD_LOCAL)

Tencent/wwsearch deps/rocksdb/CMakeLists.txt :237

CHECK_CXX_SOURCE_COMPILES("
#if defined(_MSC_VER) && !defined(__thread)
#define __thread __declspec(thread)
#endif
int main() {
  static __thread int tls;
}
" HAVE_THREAD_LOCAL)