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

Refactor: CMake Support #889

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

BenjamenMeyer
Copy link
Member

  • move the core of the CMake Support to the root
  • move our CMake modules into a dedicated directory
  • move all binary targets to a single build directory
  • disable old CPU optimizations for CPUs that are generally too old to care about any more; compilers tend to do the right thing now
  • remove unnecessary CMake directives sets; we no longer need to UNSET variables, the CMake Modules should take care of that
  • Remove all the stuff previously commented out on this branch
  • Update Windows GH Actions
  • Update README

Replaces #802

- move the core of the CMake Support to the root
- move our CMake modules into a dedicated directory
- move all binary targets to a single build directory
- disable old CPU optimizations for CPUs that are generally too old to
  care about any more; compilers tend to do the right thing now
- remove unnecessary CMake directives sets; we no longer need to
  UNSET variables, the CMake Modules should take care of that
- Remove all the stuff previously commented out on this branch
- Update Windows GH Actions
- Update README
@BenjamenMeyer BenjamenMeyer requested a review from royfalk October 4, 2024 13:11
@BenjamenMeyer BenjamenMeyer self-assigned this Oct 4, 2024
${Vega_Strike_SOURCE_DIR}/src/resource
${Vega_Strike_SOURCE_DIR}/src/components
${Vega_Strike_BINARY_DIR}
${Vega_Strike_BINARY_DIR}/src
Copy link
Member Author

Choose a reason for hiding this comment

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

NOTE: This gets replaced by the TARGET_INCLUDE_DIRECTORIES on each executable. They don't recommend using INCLUDE_DIRECTORIES any more too.

OPTION(CPUINTEL_prescott "Enable Intel P4 (sse3) optimizations" OFF )
OPTION(CPUINTEL_nocona "Enable Intel P4 (64bit) optimizations" OFF )
OPTION(CPUINTEL_core2 "Enable Intel Core2 optimizations" OFF )
OPTION(CPUINTEL_native "Enable host-specific optimizations for this machine" OFF )
Copy link
Member Author

Choose a reason for hiding this comment

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

there are mainly older processors that I would be shocked if someone still had around and was using them to game; also compilers are generally smart enough now to figure out the right optimizations.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised we dropped Sparc and Alpha.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm surprised we dropped Sparc and Alpha.

probably never got migrated to CMake...but yeah...

Copy link
Contributor

@royfalk royfalk left a comment

Choose a reason for hiding this comment

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

I'm no CMake expert. I mostly hack changes as needed without understanding the big picture. However, I like the separation, if only because it started getting very big.
LGTM.

OPTION(CPUINTEL_prescott "Enable Intel P4 (sse3) optimizations" OFF )
OPTION(CPUINTEL_nocona "Enable Intel P4 (64bit) optimizations" OFF )
OPTION(CPUINTEL_core2 "Enable Intel Core2 optimizations" OFF )
OPTION(CPUINTEL_native "Enable host-specific optimizations for this machine" OFF )
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised we dropped Sparc and Alpha.

The `test_asset` directory changed location; update the tests.

Also enable the tests at the parent level so it will always be
available.
- move more of the GTest functionality to the root CMakeLists.txt
- fix the location of the XML output file to reliably be where the
  tests are being run from
@@ -45,5 +45,5 @@ else
fi

pushd build
GTEST_OUTPUT=xml:test-results ctest -V
GTEST_OUTPUT=xml:$(pwd)/test-results ctest -V
Copy link
Member Author

Choose a reason for hiding this comment

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

tests were getting dumped under the engine directory from what I can tell; this should enforce them being in where we expect them to be

@BenjamenMeyer
Copy link
Member Author

@royfalk so my goal with the CMake refactor is to start splitting up the source tree a little and enable the ability to separate out things into libraries and binaries in a more flat structure. This first one is just to refactor it into a more standard CMake approach where the CMakeLists.txt lives at the Project Root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants