mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Add CMake option to not use parallel STL.
This commit is contained in:
parent
a3b63bb468
commit
d9fe3ed9a6
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
|
|
||||||
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
||||||
option(NO_STATISTICS "Disable calculation of statistics" ON)
|
option(NO_STATISTICS "Disable calculation of statistics" ON)
|
||||||
|
option(NO_PARALLEL_STL "Disable parallel STL" OFF)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||||
|
|
||||||
|
@ -34,6 +34,6 @@ if(NO_STATISTICS)
|
|||||||
target_compile_definitions(TracyServer PUBLIC TRACY_NO_STATISTICS)
|
target_compile_definitions(TracyServer PUBLIC TRACY_NO_STATISTICS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
|
if(NOT NO_PARALLEL_STL AND UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
|
||||||
target_link_libraries(TracyServer PRIVATE TracyTbb)
|
target_link_libraries(TracyServer PRIVATE TracyTbb)
|
||||||
endif()
|
endif()
|
||||||
|
@ -208,27 +208,31 @@ if (NOT NO_FILESELECTOR AND NOT EMSCRIPTEN)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# TBB
|
# TBB
|
||||||
|
if (NO_PARALLEL_STL)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_PARALLEL_SORT")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_PARALLEL_SORT")
|
||||||
|
else()
|
||||||
|
if (UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
|
||||||
|
# Tracy does not use TBB directly, but the implementation of parallel algorithms
|
||||||
|
# in some versions of libstdc++ depends on TBB. When it does, you must
|
||||||
|
# explicitly link against -ltbb.
|
||||||
|
#
|
||||||
|
# Some distributions have pgk-config files for TBB, others don't.
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
|
pkg_check_modules(TBB tbb)
|
||||||
# Tracy does not use TBB directly, but the implementation of parallel algorithms
|
if (TBB_FOUND)
|
||||||
# in some versions of libstdc++ depends on TBB. When it does, you must
|
add_library(TracyTbb INTERFACE)
|
||||||
# explicitly link against -ltbb.
|
target_include_directories(TracyTbb INTERFACE ${TBB_INCLUDE_DIRS})
|
||||||
#
|
target_link_libraries(TracyTbb INTERFACE ${TBB_LINK_LIBRARIES})
|
||||||
# Some distributions have pgk-config files for TBB, others don't.
|
else()
|
||||||
|
CPMAddPackage(
|
||||||
pkg_check_modules(TBB tbb)
|
NAME tbb
|
||||||
if (TBB_FOUND)
|
GITHUB_REPOSITORY oneapi-src/oneTBB
|
||||||
add_library(TracyTbb INTERFACE)
|
GIT_TAG v2021.12.0-rc2
|
||||||
target_include_directories(TracyTbb INTERFACE ${TBB_INCLUDE_DIRS})
|
OPTIONS "TBB_TEST OFF"
|
||||||
target_link_libraries(TracyTbb INTERFACE ${TBB_LINK_LIBRARIES})
|
)
|
||||||
else()
|
add_library(TracyTbb INTERFACE)
|
||||||
CPMAddPackage(
|
target_link_libraries(TracyTbb INTERFACE tbb)
|
||||||
NAME tbb
|
endif()
|
||||||
GITHUB_REPOSITORY oneapi-src/oneTBB
|
|
||||||
GIT_TAG v2021.12.0-rc2
|
|
||||||
OPTIONS "TBB_TEST OFF"
|
|
||||||
)
|
|
||||||
add_library(TracyTbb INTERFACE)
|
|
||||||
target_link_libraries(TracyTbb INTERFACE tbb)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
||||||
|
option(NO_PARALLEL_STL "Disable parallel STL" OFF)
|
||||||
|
|
||||||
set(NO_STATISTICS OFF)
|
set(NO_STATISTICS OFF)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||||
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
|
|
||||||
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
||||||
option(NO_STATISTICS "Disable calculation of statistics" ON)
|
option(NO_STATISTICS "Disable calculation of statistics" ON)
|
||||||
|
option(NO_PARALLEL_STL "Disable parallel STL" OFF)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
|
|
||||||
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
||||||
option(NO_STATISTICS "Disable calculation of statistics" ON)
|
option(NO_STATISTICS "Disable calculation of statistics" ON)
|
||||||
|
option(NO_PARALLEL_STL "Disable parallel STL" OFF)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ option(LEGACY "Instead of Wayland, use the legacy X11 backend on Linux" OFF)
|
|||||||
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
||||||
option(NO_STATISTICS "Disable calculation of statistics" OFF)
|
option(NO_STATISTICS "Disable calculation of statistics" OFF)
|
||||||
option(SELF_PROFILE "Enable self-profiling" OFF)
|
option(SELF_PROFILE "Enable self-profiling" OFF)
|
||||||
|
option(NO_PARALLEL_STL "Disable parallel STL" OFF)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
|
|
||||||
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
||||||
option(NO_STATISTICS "Disable calculation of statistics" ON)
|
option(NO_STATISTICS "Disable calculation of statistics" ON)
|
||||||
|
option(NO_PARALLEL_STL "Disable parallel STL" OFF)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user