File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ cmake_dependent_option(
9191option (PCAPPP_BUILD_TESTS "Build Tests" ${PCAPPP_MAIN_PROJECT} )
9292option (PCAPPP_BUILD_COVERAGE "Generate Coverage Report" OFF )
9393option (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
9696option (BUILD_SHARED_LIBS "Build using shared libraries" OFF )
9797
@@ -250,16 +250,17 @@ if(PCAPPP_TARGET_COMPILER_CLANG
250250 add_compile_options (-Wall)
251251endif ()
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 ()
264265endif ()
265266
Original file line number Diff line number Diff 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__); }
You can’t perform that action at this time.
0 commit comments