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

CMake build system refactoring #194

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

CMake build system refactoring #194

wants to merge 2 commits into from

Conversation

Mc-Zen
Copy link

@Mc-Zen Mc-Zen commented Oct 20, 2022

CMakeLists.txt

  • Now we add_subdirectory() the max-sdk-base.
  • Add a version (0.6.0, based on the latest release on github).
  • Replace the custom API target with an interface target and set the version. Also add the include directories for this target in order to enable appending the min-api include path by linking to this target.
  • Add interface target min-api-test-headers (used for unit tests).
  • Move option "Treat warnings as errors" from min-posttarget.cmake to the main CMakeLists.txt.

c74_add_min_target.cmake

  • Replacement function c74_add_min_target() for min-pretarget.cmake/min-posttarget.cmake
  • Calls c74_add_max_target() and creates a library target as well as a project and appends some additional definitions.
  • In contrast to min-pre/posttarget.cmake: omitted duplicated configuration code which is already called from max-sdk-base (no need to set C++ standard (done by c74_add_max_target()); no need to check xcode version (done in CMakeLists.txt); no need to check OSX architectures (done in c74_add_max_target()))
  • Common code between this file and min-posttarget.cmake for setting warning flags on mac has been refactored to a separate file.

min-posttarget.cmake

  • Moved option "Treat warnings as errors" to CMakeLists.txt.
  • Replaced settings warnings flags on Mac (see above).

For uniformity:
Should/can we rename the API and the LIB library targets to min-api and min-lib to match the repo name and therefore also give them a slightly more descriptive name (an alias to the old name can be created)?

- Create a function for creating min projects for use instead of min-pretarget.cmake and min-posttarget.cmake
- Create functions for adding unit tests
- factor out some common code from min-posttarget.cmake
- move option "Treat warnings as errors" to CMakeLists.txt
- add max-sdk-base as subdirectory
- interface target min-api
- interface target min-api-test-headers
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.

1 participant