diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b71367..4fe44a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/easy_profiler_core/CMakeLists.txt b/easy_profiler_core/CMakeLists.txt index 4b87e79..17f405c 100644 --- a/easy_profiler_core/CMakeLists.txt +++ b/easy_profiler_core/CMakeLists.txt @@ -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 diff --git a/easy_profiler_core/include/easy/easy_compiler_support.h b/easy_profiler_core/include/easy/easy_compiler_support.h index 41b667e..7f9719b 100644 --- a/easy_profiler_core/include/easy/easy_compiler_support.h +++ b/easy_profiler_core/include/easy/easy_compiler_support.h @@ -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 diff --git a/easy_profiler_core/nonscoped_block.cpp b/easy_profiler_core/nonscoped_block.cpp index f94ae51..6fa5d77 100644 --- a/easy_profiler_core/nonscoped_block.cpp +++ b/easy_profiler_core/nonscoped_block.cpp @@ -41,7 +41,8 @@ The Apache License, Version 2.0 (the "License"); **/ #include "nonscoped_block.h" -#include +#include +#include NonscopedBlock::NonscopedBlock(const profiler::BaseBlockDescriptor* _desc, const char* _runtimeName, bool) : profiler::Block(_desc, _runtimeName, false), m_runtimeName(nullptr) diff --git a/easy_profiler_core/stack_buffer.h b/easy_profiler_core/stack_buffer.h index b3bc4d3..1425887 100644 --- a/easy_profiler_core/stack_buffer.h +++ b/easy_profiler_core/stack_buffer.h @@ -46,6 +46,7 @@ The Apache License, Version 2.0 (the "License"); #include "nonscoped_block.h" #include #include +#include #ifdef max #undef max