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

feat: system for compile feature flags #4544

Merged
merged 21 commits into from Apr 4, 2023

Conversation

jackgerrits
Copy link
Member

@jackgerrits jackgerrits commented Mar 31, 2023

Compile features are optional parts of the library or just optional features. This PR organizes them into a consistent system.

# We control library features with the feature list, including conditional
# compilation or optional parts.
#
# This feature list can be specified by:
#   - Specifying individual features with -DVW_FEAT_FEAT1=ON/OFF
#
# This allows us to enable/disable features without changing the code
# If a feature called X is enabled then:
#   - The cmake variable VW_FEAT_X is set to ON, otherwise it is OFF
#   - The C++ macro VW_FEAT_X_ENABLED is defined if the feature is enabled, otherwise it is not defined
#
# Features:
#   FLATBUFFERS: Enable flatbuffers support
#   CSV: Enable csv parser
#   LAS_SIMD: Enable large action space with explicit simd (only work with linux for now)

@@ -36,6 +36,9 @@ if (NOT CMAKE_BUILD_TYPE AND NOT GENERATOR_IS_MULTI_CONFIG)
set(CMAKE_BUILD_TYPE "Release")
endif()

# This must stay near the top of the file so compile features are properly detected.
include(VowpalWabbitFeatures)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there some sort of 'default' enabled collection or it depends if the flags are defaulted on or 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 is a default list at the top of the VowpalWabbitFeatures.cmake file

@jackgerrits
Copy link
Member Author

Scaled it back to just include the "framework"

@jackgerrits jackgerrits merged commit 5fb6ead into VowpalWabbit:master Apr 4, 2023
115 checks passed
@jackgerrits jackgerrits deleted the compile_feature_flags branch April 4, 2023 15:10
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.

None yet

2 participants