cmake_minimum_required (VERSION 2.8)
+
+# Use clang on MacOSX. gcc doesn't support __thread key, and Apple has
+# abandoned it for clang. This must be done before the project is defined.
+if (APPLE)
+ set (CMAKE_C_COMPILER "clang")
+ set (CMAKE_CXX_COMPILER "clang++")
+endif ()
+
+
project (apitrace)
##############################################################################
# Find dependencies
+# Ensure __thread is support
+if (NOT MSVC)
+ include (CheckCXXSourceCompiles)
+ check_cxx_source_compiles("__thread int i; int main() { return 0; }" HAVE_COMPILER_TLS)
+ if (NOT HAVE_COMPILER_TLS)
+ if (APPLE)
+ message (FATAL_ERROR "C++ compiler does not support __thread keyword. Please install XCode 4.5 or higher.")
+ else (MINGW32)
+ message (FATAL_ERROR "C++ compiler does not support __thread keyword. Please use MinGW g++ version 4.4 or higher")
+ else ()
+ message (FATAL_ERROR "C++ compiler does not support __thread keyword.")
+ endif ()
+ endif ()
+endif ()
+
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set (CMAKE_USE_PYTHON_VERSION 2.7 2.6)
if (WIN32)
# http://msdn.microsoft.com/en-us/library/aa383745.aspx
- add_definitions (-D_WIN32_WINNT=0x0501 -DWINVER=0x0501)
+ add_definitions (-D_WIN32_WINNT=0x0601 -DWINVER=0x0601)
else (WIN32)
CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" CXX_COMPILER_FLAG_VISIBILITY)
if (CXX_COMPILER_FLAG_VISIBILITY)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -O0")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ggdb")
endif ()
+
+ # Be nice to Eclipse
+ add_definitions (-fmessage-length=0)
endif ()
if (MINGW)
common/image_pnm.cpp
common/image_png.cpp
common/${os}
+ common/workqueue.cpp
)
set_target_properties (common PROPERTIES