Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit ebe3c48

Browse files
meastpg-easy
authored andcommitted
Add NOMINMAX definitions when compiling with MSVC (#283)
This adds NOMINMAX as a public/interface definition to the targets `opencensus_common_stats_object` and `opencensus_stats_core` to unbreak the build with MSVC.
1 parent 9f3e03e commit ebe3c48

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

opencensus/common/internal/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ opencensus_lib(common_random
2424

2525
opencensus_lib(common_stats_object DEPS absl::time)
2626

27+
# Define NOMINMAX to fix build errors when compiling with MSVC.
28+
target_compile_definitions(opencensus_common_stats_object INTERFACE
29+
$<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)
30+
2731
opencensus_lib(common_string_vector_hash)
2832

2933
opencensus_test(common_random_test random_test.cc common_random)

opencensus/stats/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ opencensus_lib(stats_core
5454
absl::optional
5555
absl::span)
5656

57+
# Define NOMINMAX to fix build errors when compiling with MSVC.
58+
target_compile_definitions(opencensus_stats_core PUBLIC
59+
$<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)
60+
5761
opencensus_lib(stats_recording
5862
SRCS
5963
internal/recording.cc

0 commit comments

Comments
 (0)