Skip to content

Commit 2df02d2

Browse files
Fix various issues with build on Windows (#1720)
1 parent 61cfd83 commit 2df02d2

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

examples/common/cmake/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ endmacro()
5050
macro(add_benchmark_target TARGET_NAME TARGET_DEPENDENCIES EXECUTABLE ARGS)
5151
find_program(GAWK gawk NO_CACHE)
5252
if(NOT GAWK)
53-
message(WARNING "AWK tool is not forund: no benchmark reports will be composed by ${TARGET_NAME}.")
53+
message(WARNING "AWK tool is not found: no benchmark reports will be composed by ${TARGET_NAME}.")
5454
else()
5555
message("AWK tool to compose data reports by ${TARGET_NAME}: ${GAWK}")
5656
find_file(TARGET_NAME_FILTER

examples/common/utility/measurements.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class measurements {
5353
double computeRelError() {
5454
// Accumulate the total duration in microseconds using std::accumulate with a lambda function
5555
assert(0 != _time_intervals.size());
56-
auto total_duration = std::accumulate(
56+
unsigned long long total_duration = std::accumulate(
5757
_time_intervals.begin(),
5858
_time_intervals.end(),
59-
0, // Start with 0 count
59+
0ull, // Start with 0 count
6060
[](long long total, const std::pair<time_point, time_point>& interval) {
6161
// Compute the difference and add it to the total
6262
return total + std::chrono::duration_cast<std::chrono::microseconds>(

examples/parallel_for/seismic/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ add_subdirectory(../../common/gui gui)
2626

2727
target_link_libraries(seismic PUBLIC TBB::tbb Threads::Threads UI_LIB_seismic)
2828
target_compile_options(seismic PRIVATE ${TBB_CXX_STD_FLAG})
29+
if (MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM)
30+
target_compile_options(seismic PRIVATE /EHsc)
31+
endif()
2932

3033
if (EXAMPLES_UI_MODE STREQUAL "con")
3134
target_compile_definitions(seismic PRIVATE _CONSOLE)

examples/parallel_for/tachyon/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ add_subdirectory(../../common/gui gui)
6363

6464
target_link_libraries(tachyon TBB::tbb Threads::Threads UI_LIB_tachyon)
6565
target_compile_options(tachyon PRIVATE ${TBB_CXX_STD_FLAG})
66-
67-
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM)
66+
if (MSVC)
67+
if (CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM)
6868
target_compile_options(tachyon PRIVATE -D_CRT_SECURE_NO_WARNINGS)
69+
else()
70+
target_compile_options(tachyon PRIVATE /EHsc)
71+
endif()
6972
endif()
7073

7174
set(EXECUTABLE "$<TARGET_FILE:tachyon>")

examples/parallel_reduce/primes/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ add_executable(primes main.cpp primes.cpp)
2424

2525
target_link_libraries(primes TBB::tbb Threads::Threads)
2626
target_compile_options(primes PRIVATE ${TBB_CXX_STD_FLAG})
27+
if (MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM)
28+
target_compile_options(primes PRIVATE /EHsc)
29+
endif()
2730

2831
set(EXECUTABLE "$<TARGET_FILE:primes>")
2932
set(ARGS "")

examples/task_group/sudoku/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ add_executable(sudoku sudoku.cpp)
2424

2525
target_link_libraries(sudoku TBB::tbb Threads::Threads)
2626
target_compile_options(sudoku PRIVATE ${TBB_CXX_STD_FLAG})
27-
28-
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM)
27+
if (MSVC)
28+
if (CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM)
2929
target_compile_options(sudoku PRIVATE -D_CRT_SECURE_NO_WARNINGS)
30+
else()
31+
target_compile_options(sudoku PRIVATE /EHsc)
32+
endif()
3033
endif()
3134

3235
set(EXECUTABLE "$<TARGET_FILE:sudoku>")

0 commit comments

Comments
 (0)