Skip to content
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
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")

enable_language(RC)
target_sources(Main PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/source/resource.rc"
"${CMAKE_CURRENT_SOURCE_DIR}/source/Platform/Windows/resource.rc"
)
Comment on lines 143 to 145
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Instead of hardcoding the platform-specific path in the source code, it is better to add the platform directory to the target's include paths. This keeps the source code cleaner and more consistent with the conventions of the projects mentioned in the PR description (like Godot or SDL), where platform-specific headers are typically resolved via include paths rather than hardcoded relative paths in the source.

  target_include_directories(Main PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/source/Platform/Windows")
  target_sources(Main PRIVATE
    "${CMAKE_CURRENT_SOURCE_DIR}/source/Platform/Windows/resource.rc"
  )

endif()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/source/Winmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "ZzzLodTerrain.h"
#include "DSPlaySound.h"

#include "resource.h"
#include "Platform/Windows/resource.h"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If the platform-specific directory is added to the include path in CMakeLists.txt (as suggested in the corresponding review comment), you can continue using a simple include here. This avoids leaking the internal directory structure into the source code and makes future refactoring (like moving Winmain.cpp itself into the Platform/Windows directory) easier.

#include "resource.h"

#include <imm.h>
#include "ZzzPath.h"
#include "Local.h"
Expand Down
Loading