Skip to content

Commit

Permalink
fix typo + add MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon committed Apr 20, 2024
1 parent 27745f9 commit 7ad5b92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ cmake_dependent_option(
option(PCAPPP_BUILD_TESTS "Build Tests" ${PCAPPP_MAIN_PROJECT})
option(PCAPPP_BUILD_COVERAGE "Generate Coverage Report" OFF)
option(PCAPPP_BUILD_FUZZERS "Build Fuzzers binaries" OFF)
option(PCAPPP_BUILD_REPRODUCTIBLE "Build a reproductible version" OFF)
option(PCAPPP_BUILD_REPRODUCIBLE "Build a reproductible version" OFF)

option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)

Expand Down Expand Up @@ -250,16 +250,17 @@ if(PCAPPP_TARGET_COMPILER_CLANG
add_compile_options(-Wall)
endif()

if (PCAPPP_BUILD_REPRODUCTIBLE)
add_definitions(-DPCAPPP_BUILD_REPRODUCTIBLE)
# We should not use __DATE__ nor __TIME__ in case of reproductible build
add_compile_options($<$<BOOL:${PCAPPP_TARGET_COMPILER_GCC}>:-Wdate-time>)
if (PCAPPP_BUILD_REPRODUCIBLE)
add_definitions(-DPCAPPP_BUILD_REPRODUCIBLE)
if(APPLE)
if (NOT $ENV{ZERO_AR_DATE})
message(FATAL_ERROR "You need to set `export ZERO_AR_DATE=1`")
endif()
elseif(MSVC)
add_link_options(/Brepro)
else()
add_link_options(-D)
# We should not use __DATE__ nor __TIME__ in case of reproducible build
add_compile_options(-Wdate-time)
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion Common++/header/PcapPlusPlusVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace pcpp
/**
* @return The build date and time in a format of "Mmm dd yyyy hh:mm:ss"
*/
#if PCAPPP_BUILD_REPRODUCTIBLE
#if PCAPPP_BUILD_REPRODUCIBLE
inline std::string getBuildDateTime() { return std::string("") + " " + std::string(""); }
#else
inline std::string getBuildDateTime() { return std::string(__DATE__) + " " + std::string(__TIME__); }
Expand Down

0 comments on commit 7ad5b92

Please sign in to comment.