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

Use cmake's target_sources(), and general cmake file cleanup. #291

Merged
merged 12 commits into from
Dec 5, 2022

Conversation

floooh
Copy link
Owner

@floooh floooh commented Dec 3, 2022

Second attempt to use the 'new-ish' cmake target_sources() command. Main difference is that an (empty) target is now already created in the fips_begin_* calls, not in fips_end(). This allows a much simpler internal structure because target items can now be added immediately in the other fips functions instead of being stored until fips_end_*() is called.

Cleanup changes:

  • merge the platform-specific cmake helper file into a single fips_platform.cmake file
  • fips_project() is deprecated, use project() instead
  • fips_finish() is deprecated, can be removed entirely
  • fips_begin_module() and fips_end_module() are deprecated, and are now aliases for fips_begin_lib/fips_end_lib
  • likewise, fips_deps() is now an alias for fips_libs() (but not deprecated)
  • fips_include_dirs() is deprecated, use target_include_directories() instead
  • fips_add_subdirectory() is deprecated, use add_subdirectory() instead
  • fips_vs_warning_level() and fips_vs_disable_warning() are deprecated, use target_compile_options() instead (and the default warning level for MSVC configs has been bumped to /W3)

(all deprecated functions now print a warning message, but still work - but will be removed in the next cleanup round)

TODO:

  • fips.yml: header dirs and module exports in fips.yml should be deprecated, this should all be defined via cmake => add deprecation messages for this! (header exports are needed for header-only libs, but figure out if module exports are actually still needed) => module exports make sense because they basically just trigger the generation of an 'add_subdirectory()' in the toplevel project, the naming is just a bit unfortunate (should be exported targets instead)
  • FIPS_OSX_STANDARD_FRAMEWORKS should be removed eh, just keep it in, Win32 has tons of standard link libraries too
  • add a fips_target() function which returns the current target between begin/end, and otherwise fails (but do NOT clear the CurTargetName variable in fips_end() for backward compatibility, instead use a separate flag) no such thing as return values in cmake, and the alternatives would be too messy
  • add a FIPS_APPLE_CLANG variable to differentiate between vanilla and Apple clang
  • update documentation

@floooh floooh merged commit ed111db into master Dec 5, 2022
@floooh floooh deleted the cmake-target-sources-2 branch December 5, 2022 16:04
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