Skip to content

Commit

Permalink
Add WERROR to older wireshark versions
Browse files Browse the repository at this point in the history
  • Loading branch information
oshaked1 committed Jul 7, 2024
1 parent c077339 commit f04507e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ debug: all install
# prepare build directory (needed before building for the first time)
cmake: clean copy-all
@rm -rf wireshark/build && mkdir wireshark/build
# Wireshark changed DISABLE_WERROR to ENABLE_WERROR at some point. Use both for compatibility (even though it causes a cmake warning to be thrown)
ifeq ($(WERROR),y)
@cmake -G Ninja -DTRACEESHARK_VERSION=$(TRACEESHARK_VERSION) -DENABLE_CCACHE=Yes -DENABLE_WERROR=ON -S wireshark -B wireshark/build
@cmake -G Ninja -DTRACEESHARK_VERSION=$(TRACEESHARK_VERSION) -DENABLE_CCACHE=Yes -DENABLE_WERROR=ON -DDISABLE_WERROR=OFF -S wireshark -B wireshark/build
else
@cmake -G Ninja -DTRACEESHARK_VERSION=$(TRACEESHARK_VERSION) -DENABLE_CCACHE=Yes -DENABLE_WERROR=OFF -S wireshark -B wireshark/build
@cmake -G Ninja -DTRACEESHARK_VERSION=$(TRACEESHARK_VERSION) -DENABLE_CCACHE=Yes -DENABLE_WERROR=OFF -DDISABLE_WERROR=ON -S wireshark -B wireshark/build
endif

dist: all
Expand Down
7 changes: 5 additions & 2 deletions scripts/make_cmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ copy /Y CMakeListsCustom.txt wireshark
rmdir /S /Q build
mkdir build
pushd build

rem Wireshark changed DISABLE_WERROR to ENABLE_WERROR at some point. Use both for compatibility (even though it causes a cmake warning to be thrown)
if "%WERROR%"=="y" (
cmake -G "Visual Studio 17 2022" -A x64 -DTRACEESHARK_VERSION=%TRACEESHARK_VERSION% -DENABLE_CCACHE=Yes -DENABLE_WERROR=ON ..\wireshark
cmake -G "Visual Studio 17 2022" -A x64 -DTRACEESHARK_VERSION=%TRACEESHARK_VERSION% -DENABLE_CCACHE=Yes -DENABLE_WERROR=ON -DDISABLE_WERROR=OFF ..\wireshark
) else (
cmake -G "Visual Studio 17 2022" -A x64 -DTRACEESHARK_VERSION=%TRACEESHARK_VERSION% -DENABLE_CCACHE=Yes -DENABLE_WERROR=OFF ..\wireshark
cmake -G "Visual Studio 17 2022" -A x64 -DTRACEESHARK_VERSION=%TRACEESHARK_VERSION% -DENABLE_CCACHE=Yes -DENABLE_WERROR=OFF -DDISABLE_WERROR=OFF ..\wireshark
)

popd

endlocal

0 comments on commit f04507e

Please sign in to comment.