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

Updated CMake configuration #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wipe2238
Copy link

@wipe2238 wipe2238 commented Jul 3, 2023

  • Requires newer CMake version with more target-focused configuraton
    Minimum required version set to 3.18.4, released October 2020; available on Debian 11 (oldstable)
  • Splits current configuration into static library (int2ssl-lib) and executable (int2ssl) targets
    Different approach to integrating CFalloutScript into external application; instead of messing with code first, i'm messing with build process. That makes integration available faster as long external application provides everything required for linking.
  • Provides a way to test if int2ssl-lib is truly independent of int2ssl
    Added int2ssl-lib-test target (not built by default) which tries to use library target with absolute minimum setup required. Generated only for out-of-source builds.
  • Provides a way to add compiler/linker options for different platforms/setups without splitting them into wall of ifs
    Added helper function int2ssl_build_option() which allows...
    - selecting if flag should be added to compiler or linker
    - filtering out flags which are irrelevant (disabled options, different platforms, etc.)
    - marking flag as required
    ...all in single line, making flags easier to read/find/add/remove, as they're all in one place
  • Allows disabling building executable target
    Added option INT2SSL_BINARY (default: on)
  • Enables more compiler warnings, with option to promote them to errors (linux)
    Added compiler flags -Wall -Wextra -Wpedantic
    Added option INT2SSL_STRICT (default: off) which turns on compiler flag -Werror

Extras

  • Includes very basic info about int2ssl in project() command
    If someone includes int2ssl in their application source, finding this repository will be one click away :)
  • Allows building static executable (linux)
    Added option INT2SSL_BINARY_STATIC (default: off)
    Required compiler flag(s) are currently checked in if(UNIX) block only, simply because i'm not using MinGW right now, and have no way to test all little details. For crossplatform compilation it should probably be changed to something like if(INT2SSL_BINARY_STATIC AND CMAKE_CXX_COMPILER_ID MATCHES "GNU") or something like that, but someone needs to test it first~
  • Adds out-of-source build directory to git ignore list
    Clean worktree is happy worktree

@wipe2238 wipe2238 marked this pull request as ready for review July 8, 2023 10:16
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