Skip to content

Commit 48b4768

Browse files
committed
fix(userspace/falco): fixed windows build by enforcing NOMINMAX compile definition.
Also, minified config schema, since the big schema string leads to an MSVC compiler error. Signed-off-by: Federico Di Pierro <[email protected]>
1 parent 358491b commit 48b4768

File tree

2 files changed

+12
-577
lines changed

2 files changed

+12
-577
lines changed

cmake/modules/CompilerFlags.cmake

+5-3
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,17 @@ else() # MSVC
8888
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
8989

9090
# The WIN32_LEAN_AND_MEAN define avoids possible macro pollution
91-
# when a libsinsp consumer includes the windows.h header.
92-
# See: https://stackoverflow.com/a/28380820
93-
91+
# when a libsinsp consumer includes the windows.h header:
92+
# https://stackoverflow.com/a/28380820
93+
# Same goes for NOMINMAX:
94+
# https://stackoverflow.com/questions/5004858/why-is-stdmin-failing-when-windows-h-is-included
9495
add_compile_definitions(
9596
_HAS_STD_BYTE=0
9697
_CRT_SECURE_NO_WARNINGS
9798
WIN32
9899
MINIMAL_BUILD
99100
WIN32_LEAN_AND_MEAN
101+
NOMINMAX
100102
)
101103

102104
set(FALCOSECURITY_LIBS_COMMON_FLAGS "/EHsc /W3 /Zi /std:c++17")

0 commit comments

Comments
 (0)