Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaldur Karlsson <baldurk@baldurk.org>2018-11-23 19:47:37 +0300
committerSteven Perron <stevenperron@google.com>2018-11-23 19:47:37 +0300
commit9e71de132fbcf91db836ac0c2019a5052defd37b (patch)
tree8412c43cca496f182a489fea979c80c321a632d7 /CMakeLists.txt
parent3b210d6a63f74c9249a077fe477bcbd3bf951af5 (diff)
Add cmake option to turn off SPIRV_TIMER_ENABLED (#2103)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8143123fd..a5ecb90a1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,9 +34,11 @@ include(cmake/setup_build.cmake)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 11)
+option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)
+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
add_definitions(-DSPIRV_LINUX)
- set(SPIRV_TIMER_ENABLED ON)
+ set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
add_definitions(-DSPIRV_WINDOWS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
@@ -45,7 +47,7 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
add_definitions(-DSPIRV_MAC)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
add_definitions(-DSPIRV_ANDROID)
- set(SPIRV_TIMER_ENABLED ON)
+ set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
add_definitions(-DSPIRV_FREEBSD)
else()