Skip to content

Commit

Permalink
build: copy tbb shared lib for win32
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed Apr 18, 2022
1 parent c5efb31 commit 0d6f9f1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 11 deletions.
4 changes: 3 additions & 1 deletion 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ endif()
CPMAddPackage(NAME tbb GITHUB_REPOSITORY oneapi-src/oneTBB VERSION 2021.5.0 EXCLUDE_FROM_ALL YES
OPTIONS "TBB_TEST=OFF" "TBB_EXAMPLES=OFF" "TBB_STRICT=OFF"
)

if(WIN32)

SET(BUILD_SHARED_LIBS OFF)
endif()

if (tbb_ADDED)
if (TARGET tbbmalloc_proxy)
add_library(tbbmalloc_proxy_wrapper ALIAS tbbmalloc_proxy)
else()
add_library(tbbmalloc_proxy_wrapper INTERFACE)
Expand Down
10 changes: 6 additions & 4 deletions packaging/windows/7z_pdb_listfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
.\release\klogg.pdb
.\release\klogg_portable.exe
.\release\klogg_portable.pdb
.\release\klogg_tbbmalloc.dll
.\release\klogg_tbbmalloc_proxy.dll
.\release\klogg_tbbmalloc.pdb
.\release\klogg_tbbmalloc_proxy.pdb
.\release\tbb12.dll
.\release\tbb12.pdb
.\release\tbbmalloc.dll
.\release\tbbmalloc_proxy.dll
.\release\tbbmalloc.pdb
.\release\tbbmalloc_proxy.pdb

6 changes: 4 additions & 2 deletions packaging/windows/klogg.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ Section "klogg" klogg
File release\klogg.exe
File release\klogg_crashpad_handler.exe
File release\klogg_minidump_dump.exe
File release\klogg_tbbmalloc.dll
File release\klogg_tbbmalloc_proxy.dll
File release\tbb12.dll
File release\tbbmalloc.dll
File release\tbbmalloc_proxy.dll

File COPYING
File NOTICE
Expand Down Expand Up @@ -186,6 +187,7 @@ Section "Uninstall"
Delete "$INSTDIR\msvcp140_1.dll"
Delete "$INSTDIR\vcruntime140.dll"
Delete "$INSTDIR\vcruntime140_1.dll"
Delete "$INSTDIR\tbb12.dll"
Delete "$INSTDIR\tbbmalloc.dll"
Delete "$INSTDIR\tbbmalloc_proxy.dll"
Delete "$INSTDIR\klogg_tbbmalloc.dll"
Expand Down
10 changes: 6 additions & 4 deletions packaging/windows/prepare_release.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\mimalloc.pdb %KLOGG_WORKSPACE%
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\mimalloc-redirect.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\mimalloc-redirect32.dll %KLOGG_WORKSPACE%\release\ /y

xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\klogg_tbbmalloc.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\klogg_tbbmalloc.pdb %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\klogg_tbbmalloc_proxy.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\klogg_tbbmalloc_proxy.pdb %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\tbb12.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\tbb12.pdb %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\tbbmalloc.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\tbbmalloc.pdb %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\tbbmalloc_proxy.dll %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\output\tbbmalloc_proxy.pdb %KLOGG_WORKSPACE%\release\ /y

xcopy %KLOGG_WORKSPACE%\%KLOGG_BUILD_ROOT%\generated\documentation.html %KLOGG_WORKSPACE%\release\ /y
xcopy %KLOGG_WORKSPACE%\COPYING %KLOGG_WORKSPACE%\release\ /y
Expand Down
21 changes: 21 additions & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,27 @@ install(TARGETS
BUNDLE DESTINATION .
)

if(TARGET tbb)
add_custom_command(TARGET klogg POST_BUILD
COMMAND cmake -E copy $<TARGET_FILE:tbb> $<TARGET_FILE_DIR:klogg>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Copy tbb"
)
endif()

if(TARGET tbbmalloc_proxy)
add_custom_command(TARGET klogg POST_BUILD
COMMAND cmake -E copy $<TARGET_FILE:tbbmalloc> $<TARGET_FILE_DIR:klogg>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Copy tbbmalloc"
)
add_custom_command(TARGET klogg POST_BUILD
COMMAND cmake -E copy $<TARGET_FILE:tbbmalloc_proxy> $<TARGET_FILE_DIR:klogg>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Copy tbbmalloc_proxy"
)
endif()

if(KLOGG_USE_SENTRY)
if (NOT WIN32)

Expand Down

0 comments on commit 0d6f9f1

Please sign in to comment.