Skip to content

Commit

Permalink
CMake: add option for use parallel acceleration via TBB (default enable)
Browse files Browse the repository at this point in the history
add commented line for enable memory sanityzers
  • Loading branch information
eagleivg committed Dec 11, 2018
1 parent a7c7437 commit c17f024
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if(NOT WIN32)
set(CMAKE_INSTALL_PREFIX "") # Skip all *nix-style installing for a while. Use DESTDIR
endif()

option ( TBB_PARALLEL "Use tbb::parallel for prarticle and skinning acceleration on SMP." ON )

include(cotire)

function(xr_install tgt)
Expand Down Expand Up @@ -67,12 +69,22 @@ endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive --std=c++17 -Wno-attributes -pipe -Wl,--no-undefined -fvisibility=hidden")

#set (SANITIZE_FLAGS "-fsanitize=address -fsanitize=leak -fno-omit-frame-pointer -g -fsanitize=shift -fsanitize=integer-divide-by-zero -fsanitize=unreachable -fsanitize=vla-bound -fsanitize=return -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=bounds-strict -fsanitize=object-size -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=nonnull-attribute -fsanitize=returns-nonnull-attribute -fsanitize=bool")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZE_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZE_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZE_FLAGS}")
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${SANITIZE_FLAGS}")

set(LUA_LIBRARIES luajit)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()

if( TBB_PARALLEL )
add_definitions ( -DUSE_TBB_PARALLEL )
endif()

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_definitions(-DDEBUG -DMIXED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og")
Expand Down

0 comments on commit c17f024

Please sign in to comment.