mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-26 08:01:51 +08:00
Add support for building with Apple LLVM clang version < 8.0 (#82)
* Add support for building with pre 2016 Apple LLVM clang * Automatically detect Apple clang that do not support thread_local * Clarify clang thread_local support code comment
This commit is contained in:
parent
86be4c9d59
commit
e5fd86f9c8
@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.12.1)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(easy_profiler CXX)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
@ -15,6 +15,10 @@ if (NOT WIN32)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.3")
|
||||
set(NO_CXX11_THREAD_LOCAL_SUPPORT TRUE)
|
||||
endif ()
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0")
|
||||
set(NO_CXX11_THREAD_LOCAL_SUPPORT TRUE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# TODO: Check thread_local keyword support for other compilers for Unix
|
||||
|
@ -88,8 +88,8 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Clang Compiler
|
||||
|
||||
# if (__clang_major__ == 3 && __clang_minor__ < 3) || (__clang_major__ < 3)
|
||||
// There is no support for C++11 thread_local keyword prior to clang 3.3. Use __thread instead.
|
||||
# if (__clang_major__ == 3 && __clang_minor__ < 3) || (__clang_major__ < 3) || (defined __APPLE_CC__ && __APPLE_CC__ < 8000)
|
||||
// There is no support for C++11 thread_local keyword prior to clang 3.3 and Apple LLVM clang 8.0. Use __thread instead.
|
||||
# define EASY_THREAD_LOCAL __thread
|
||||
# endif
|
||||
|
||||
|
@ -41,7 +41,8 @@ The Apache License, Version 2.0 (the "License");
|
||||
**/
|
||||
|
||||
#include "nonscoped_block.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
NonscopedBlock::NonscopedBlock(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName, bool)
|
||||
: profiler::Block(_desc, _runtimeName, false), m_runtimeName(nullptr)
|
||||
|
@ -46,6 +46,7 @@ The Apache License, Version 2.0 (the "License");
|
||||
#include "nonscoped_block.h"
|
||||
#include <list>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
|
||||
#ifdef max
|
||||
#undef max
|
||||
|
Loading…
x
Reference in New Issue
Block a user