CMakeLists: Define -DNOMINMAX and -DWIN32_LEAN_AND_MEAN on Windows

Avoids needing to explicitly define these in code and also allow
external targets to be unaffected by this.
This commit is contained in:
Lioncash 2019-09-07 11:43:31 -04:00
parent 30158859f7
commit b7974ffd01
3 changed files with 5 additions and 6 deletions

View File

@ -74,6 +74,11 @@ if(WIN32)
src/athena/FileWriterWin32.cpp
src/athena/FileReaderWin32.cpp
)
target_compile_definitions(athena-core PRIVATE
-DNOMINMAX
-DWIN32_LEAN_AND_MEAN
)
else()
target_sources(athena-core PRIVATE
src/athena/FileWriterNix.cpp

View File

@ -3,9 +3,6 @@
#include <algorithm>
#include <limits>
#undef min
#undef max
namespace athena::io {
FileWriter::FileWriter(std::string_view filename, bool overwrite, bool globalErr)
: m_fileHandle(0), m_globalErr(globalErr) {

View File

@ -8,9 +8,6 @@
#include <malloc.h>
#endif // HW_RVL
#undef min
#undef max
namespace athena::io {
MemoryReader::MemoryReader(const void* data, atUint64 length, bool takeOwnership, bool globalErr)
: m_data(data), m_length(length), m_position(0), m_owns(takeOwnership), m_globalErr(globalErr) {