diff --git a/bspinfo/CMakeLists.txt b/bspinfo/CMakeLists.txt index 025f6350..a8987d74 100644 --- a/bspinfo/CMakeLists.txt +++ b/bspinfo/CMakeLists.txt @@ -3,6 +3,8 @@ target_link_libraries(bspinfo common fmt::fmt) # HACK: copy .dll dependencies add_custom_command(TARGET bspinfo POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$") + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + ) install(TARGETS bspinfo RUNTIME DESTINATION bin) diff --git a/bsputil/CMakeLists.txt b/bsputil/CMakeLists.txt index e45d1301..8489c43b 100644 --- a/bsputil/CMakeLists.txt +++ b/bsputil/CMakeLists.txt @@ -4,10 +4,12 @@ set(BSPUTIL_SOURCES decompile.cpp) add_executable(bsputil ${BSPUTIL_SOURCES}) -target_link_libraries(bsputil common TBB::tbb fmt::fmt) +target_link_libraries(bsputil common TBB::tbb TBB::tbbmalloc fmt::fmt) # HACK: copy .dll dependencies add_custom_command(TARGET bsputil POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$") + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + ) install(TARGETS bsputil RUNTIME DESTINATION bin) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index f53ee8a4..ba15d8cf 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -35,4 +35,4 @@ add_library(common STATIC ${CMAKE_SOURCE_DIR}/include/common/prtfile.hh ${CMAKE_SOURCE_DIR}/include/common/vectorutils.hh) -target_link_libraries(common ${CMAKE_THREAD_LIBS_INIT} TBB::tbb fmt::fmt nlohmann_json::nlohmann_json) +target_link_libraries(common ${CMAKE_THREAD_LIBS_INIT} TBB::tbb TBB::tbbmalloc fmt::fmt nlohmann_json::nlohmann_json) diff --git a/light/CMakeLists.txt b/light/CMakeLists.txt index ed756b04..6615a83e 100644 --- a/light/CMakeLists.txt +++ b/light/CMakeLists.txt @@ -75,7 +75,9 @@ if (embree_FOUND) add_custom_command(TARGET light POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$") + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + ) if (NOT EMBREE_LICENSE STREQUAL EMBREE_LICENSE-NOTFOUND) add_custom_command(TARGET light POST_BUILD @@ -103,9 +105,18 @@ if (embree_FOUND) message(STATUS "TBB .so file: ${TBB_SO_FILE}") install(FILES ${TBB_SO_FILE} DESTINATION bin) + + # tbbmalloc + get_target_property(TBBMALLOC_SO_FILE_SYMLINK TBB::tbbmalloc IMPORTED_LOCATION_RELEASE) + get_filename_component(TBBMALLOC_SO_FILE "${TBBMALLOC_SO_FILE_SYMLINK}" REALPATH) + + message(STATUS "TBBMALLOC .so file: ${TBBMALLOC_SO_FILE}") + + install(FILES ${TBBMALLOC_SO_FILE} DESTINATION bin) else() # preferred method install(FILES $ DESTINATION bin) + install(FILES $ DESTINATION bin) endif() if (NOT EMBREE_LICENSE STREQUAL EMBREE_LICENSE-NOTFOUND) diff --git a/qbsp/CMakeLists.txt b/qbsp/CMakeLists.txt index 092b7095..21aebb4d 100644 --- a/qbsp/CMakeLists.txt +++ b/qbsp/CMakeLists.txt @@ -31,7 +31,7 @@ set(QBSP_SOURCES ${QBSP_INCLUDES}) add_library(libqbsp STATIC ${QBSP_SOURCES}) -target_link_libraries(libqbsp common ${CMAKE_THREAD_LIBS_INIT} TBB::tbb fmt::fmt nlohmann_json::nlohmann_json pareto) +target_link_libraries(libqbsp common ${CMAKE_THREAD_LIBS_INIT} TBB::tbb TBB::tbbmalloc fmt::fmt nlohmann_json::nlohmann_json pareto) add_executable(qbsp main.cc) target_link_libraries(qbsp libqbsp) @@ -40,4 +40,5 @@ install(TARGETS qbsp RUNTIME DESTINATION bin) # HACK: copy .dll dependencies add_custom_command(TARGET qbsp POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$") + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 83c864ba..b0761edb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -23,12 +23,14 @@ if (NOT EMBREE_TBB_DLL STREQUAL EMBREE_TBB_DLL-NOTFOUND) message(STATUS "Found embree EMBREE_TBB_DLL: ${EMBREE_TBB_DLL}") endif() -target_link_libraries(tests libqbsp liblight libvis common TBB::tbb Catch2::Catch2WithMain fmt::fmt nanobench::nanobench) +target_link_libraries(tests libqbsp liblight libvis common TBB::tbb TBB::tbbmalloc Catch2::Catch2WithMain fmt::fmt nanobench::nanobench) # HACK: copy .dll dependencies add_custom_command(TARGET tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$") + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + ) if (NOT EMBREE_TBB_DLL STREQUAL EMBREE_TBB_DLL-NOTFOUND) add_custom_command(TARGET tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${EMBREE_TBB_DLL}" "$") diff --git a/vis/CMakeLists.txt b/vis/CMakeLists.txt index 1177b87a..20525f5a 100644 --- a/vis/CMakeLists.txt +++ b/vis/CMakeLists.txt @@ -23,6 +23,8 @@ target_link_libraries(vis PRIVATE common libvis) # HACK: copy .dll dependencies add_custom_command(TARGET vis POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$") + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + ) install(TARGETS vis RUNTIME DESTINATION bin)