Skip to content

Commit

Permalink
[Test] Move define of WIN32_LEAN_AND_MEAN and NOMINMAX in CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Oct 26, 2023
1 parent 1248d22 commit 47319c4
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ target_include_directories( ${LIB_TARGET} PRIVATE "${PROJECT_SOURCE_DIR}/include
# 7-zip compilation definitions
target_compile_definitions( ${LIB_TARGET} PRIVATE UNICODE _UNICODE )
if( WIN32 )
target_compile_definitions( ${LIB_TARGET} PRIVATE _WINDOWS )
target_compile_definitions( ${LIB_TARGET} PRIVATE _WINDOWS WIN32_LEAN_AND_MEAN NOMINMAX )
target_link_libraries( ${LIB_TARGET} PUBLIC oleaut32 )
endif()

Expand Down
7 changes: 0 additions & 7 deletions include/bit7z/bitwindows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
#define BITWINDOWS_HPP

#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#include <propidl.h>
#else
Expand Down
4 changes: 0 additions & 4 deletions src/bitinputarchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

#ifndef NOMINMAX
#define NOMINMAX
#endif

#include "bitinputarchive.hpp"

#include "biterror.hpp"
Expand Down
4 changes: 0 additions & 4 deletions src/internal/cmultivolumeinstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

#ifndef NOMINMAX
#define NOMINMAX
#endif

#include "internal/cmultivolumeinstream.hpp"

#include "bittypes.hpp"
Expand Down
3 changes: 3 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ if( WIN32 )
message( STATUS "Using legacy string encoding for tests: ON" )
target_sources( ${TESTS_TARGET} PRIVATE res/encodingLegacy.${RES_EXTENSION} )
target_sources( ${TESTS_TARGET_PUBLIC} PRIVATE res/encodingLegacy.${RES_EXTENSION} )

target_compile_definitions( ${TESTS_TARGET} PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX )
target_compile_definitions( ${TESTS_TARGET_PUBLIC} PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX )
endif()

# Catch2
Expand Down
3 changes: 0 additions & 3 deletions tests/src/test_bitpropvariant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifdef _WIN32
#define NOMINMAX
#endif

#include <catch2/catch.hpp>

Expand Down
3 changes: 0 additions & 3 deletions tests/src/test_cbufferinstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifdef _WIN32
#define NOMINMAX
#endif

#include <catch2/catch.hpp>

Expand Down
4 changes: 0 additions & 4 deletions tests/src/utils/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
#include <bit7z/bitfs.hpp>
#include <bit7z/bittypes.hpp>

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#ifdef _WIN32
#include <array>
#include <Windows.h>
Expand Down

0 comments on commit 47319c4

Please sign in to comment.