Skip to content

Commit 7ad5b92

Browse files
committed
fix typo + add MSVC
1 parent 27745f9 commit 7ad5b92

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ cmake_dependent_option(
9191
option(PCAPPP_BUILD_TESTS "Build Tests" ${PCAPPP_MAIN_PROJECT})
9292
option(PCAPPP_BUILD_COVERAGE "Generate Coverage Report" OFF)
9393
option(PCAPPP_BUILD_FUZZERS "Build Fuzzers binaries" OFF)
94-
option(PCAPPP_BUILD_REPRODUCTIBLE "Build a reproductible version" OFF)
94+
option(PCAPPP_BUILD_REPRODUCIBLE "Build a reproductible version" OFF)
9595

9696
option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
9797

@@ -250,16 +250,17 @@ if(PCAPPP_TARGET_COMPILER_CLANG
250250
add_compile_options(-Wall)
251251
endif()
252252

253-
if (PCAPPP_BUILD_REPRODUCTIBLE)
254-
add_definitions(-DPCAPPP_BUILD_REPRODUCTIBLE)
255-
# We should not use __DATE__ nor __TIME__ in case of reproductible build
256-
add_compile_options($<$<BOOL:${PCAPPP_TARGET_COMPILER_GCC}>:-Wdate-time>)
253+
if (PCAPPP_BUILD_REPRODUCIBLE)
254+
add_definitions(-DPCAPPP_BUILD_REPRODUCIBLE)
257255
if(APPLE)
258256
if (NOT $ENV{ZERO_AR_DATE})
259257
message(FATAL_ERROR "You need to set `export ZERO_AR_DATE=1`")
260258
endif()
259+
elseif(MSVC)
260+
add_link_options(/Brepro)
261261
else()
262-
add_link_options(-D)
262+
# We should not use __DATE__ nor __TIME__ in case of reproducible build
263+
add_compile_options(-Wdate-time)
263264
endif()
264265
endif()
265266

Common++/header/PcapPlusPlusVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace pcpp
3030
/**
3131
* @return The build date and time in a format of "Mmm dd yyyy hh:mm:ss"
3232
*/
33-
#if PCAPPP_BUILD_REPRODUCTIBLE
33+
#if PCAPPP_BUILD_REPRODUCIBLE
3434
inline std::string getBuildDateTime() { return std::string("") + " " + std::string(""); }
3535
#else
3636
inline std::string getBuildDateTime() { return std::string(__DATE__) + " " + std::string(__TIME__); }

0 commit comments

Comments
 (0)