Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always define winversion #6863

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions CMake/Platforms.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if(WIN32)
include(platforms/windows)
endif()

if(HAIKU)
include(platforms/haiku)
endif()
Expand Down Expand Up @@ -35,6 +31,8 @@ elseif(TARGET_PLATFORM STREQUAL "miyoo_mini")
include(platforms/miyoo_mini)
elseif(TARGET_PLATORM STREQUAL "windows9x")
include(platforms/windows9x)
elseif(WIN32)
include(platforms/windows)
endif()

if(NINTENDO_SWITCH)
Expand Down
2 changes: 2 additions & 0 deletions CMake/platforms/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ list(APPEND DEVILUTIONX_PLATFORM_LINK_LIBRARIES
wininet
)

add_definitions(-DWINVER=0x0601 -D_WIN32_WINDOWS=0x0601 -D_WIN32_WINNT=0x0601)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also do this in windows9x.cmake, hopefully this doesn't break it (don't see why it should)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When both (windows and windows9x) would be added, it would break. Only the first definition stays (at least in MSVC; I tested it).

That's why I changed Platforms.cmake to only include "windows.cmake" or "windows9x.cmake".
As far as I have seen "windows9x.cmake" includes everything that is also in "windows.cmake" + some windows 9x specific changes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, makes sense, thanks!
These days treating windows 9x as a completely separate platform from modern Windows is sensible


if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
list(APPEND DEVILUTIONX_PLATFORM_COMPILE_OPTIONS "/W3" "/Zc:__cplusplus" "/utf-8")
list(APPEND DEVILUTIONX_PLATFORM_COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS)
Expand Down
Loading