Skip to content

Commit

Permalink
Make Visual Studio use static C runtime libs in Debug configuration
Browse files Browse the repository at this point in the history
Currently it defaults to dynamic libs which introduces a dependency
to first install them if copying the binaries to another machine.
Hence static libs simplify the developer's life.  This is not needed
for the Release configuration since the relevant dynamic libs are
already part of Windows itself.

Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler authored and elazarg committed Jun 15, 2021
1 parent 1f1c104 commit ae42271
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
set(SANITIZE_FLAGS -fsanitize=address -O1 -fno-omit-frame-pointer)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest")

# Make debug builds use static C runtime libs to avoid having
# to install them. Release builds don't need this because
# the release DLLs are included in Windows.
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif ()

add_library(ebpfverifier ${LIB_SRC})
Expand Down

0 comments on commit ae42271

Please sign in to comment.