Skip to content

Commit

Permalink
ares: move generated sources out of ares.hpp (#1704)
Browse files Browse the repository at this point in the history
Random fix from CMake work.

Precompiled headers under CMake are currently buggy and unreliable on
Windows, largely because the precompiled `<ares/ares.hpp>` header
includes `<ares/resource/resource.hpp>`, which is generated by
`sourcery` as part of the build process.

While sourcery will almost never meaningfully change the contents of
this `resource.hpp` file, Windows may insert its own line endings
depending on the user's environment, and despite enforcing uniform line
endings as part of our `.gitattributes` file, some compilers will throw
a fit about the precompiled header being modified from underneath it.

Since the `resource.hpp` file is simple, short, and not included in that
many places, we can just refactor it out of `<ares/ares.hpp>` without
issue, and precompiled headers will work again regardless of system line
ending convention or environment.

Tested to build locally on macOS; CI run definitely recommended.
  • Loading branch information
jcm93 authored Dec 2, 2024
1 parent 7cc6d51 commit 687bfe8
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion ares/ares/ares.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@ namespace ares {
#include <ares/memory/fixed-allocator.hpp>
#include <ares/memory/readable.hpp>
#include <ares/memory/writable.hpp>
#include <ares/resource/resource.hpp>
1 change: 1 addition & 0 deletions ares/fc/controller/controller.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <fc/fc.hpp>
#include <ares/resource/resource.hpp>

namespace ares::Famicom {

Expand Down
1 change: 1 addition & 0 deletions ares/ms/controller/controller.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <ms/ms.hpp>
#include <ares/resource/resource.hpp>

namespace ares::MasterSystem {

Expand Down
1 change: 1 addition & 0 deletions ares/sfc/controller/controller.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <sfc/sfc.hpp>
#include <ares/resource/resource.hpp>

namespace ares::SuperFamicom {

Expand Down
1 change: 1 addition & 0 deletions ares/ws/ppu/ppu.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <ws/ws.hpp>
#include <ares/resource/resource.hpp>

namespace ares::WonderSwan {

Expand Down
1 change: 1 addition & 0 deletions desktop-ui/desktop-ui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using namespace hiro;

#include <ares/ares.hpp>
#include <ares/resource/resource.hpp>
#include <nall/gdb/server.hpp>
#include <mia/mia.hpp>

Expand Down
1 change: 1 addition & 0 deletions mia/mia.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ using namespace hiro;
#endif

#include <ares/ares.hpp>
#include <ares/resource/resource.hpp>
#include <mia/resource/resource.hpp>

namespace mia {
Expand Down

0 comments on commit 687bfe8

Please sign in to comment.