-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix generate_catalog_edc_code triggered on every build #717
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,32 +6,42 @@ | |
# Set the project name. | ||
project(catalog_schema) | ||
|
||
# We name the library edc_catalog_discard because we create | ||
# an edc_catalog library inside the catalog sub directory. | ||
process_schema_internal(DATABASE_NAME catalog | ||
LIB_NAME edc_catalog_discard | ||
string(RANDOM GAIAC_CATALOG_INSTANCE_NAME) | ||
|
||
# We use a custom command to generate catalog EDC code because process_schema_internal() | ||
# creates dependencies on the generated code which would causes this target to be automatically | ||
# called. | ||
add_custom_command( | ||
COMMENT "Generating EDC code for database catalog..." | ||
OUTPUT ${GAIA_GENERATED_CODE}/catalog/gaia_catalog.cpp | ||
OUTPUT ${GAIA_GENERATED_CODE}/catalog/gaia_catalog.h | ||
OUTPUT ${GAIA_GENERATED_CODE}/catalog/catalog_generated.h | ||
COMMAND ${GAIA_PROD_BUILD}/catalog/gaiac/gaiac | ||
-t ${GAIA_PROD_BUILD}/db/core | ||
-o ${GAIA_GENERATED_CODE}/catalog | ||
-d catalog | ||
-n ${GAIAC_CATALOG_INSTANCE_NAME} | ||
-g | ||
) | ||
|
||
# Instead of using edc_catalog as a static library to link against the project targets, we copy the source code into | ||
# the gaia source tree and compile it as a normal cpp file. There are 2 reasons for this: | ||
# We copy the catalog EDC code into the gaia source tree and compile it as a normal cpp file. | ||
# There are 2 reasons for this: | ||
# 1. We don't want the catalog EDC API to change and possibly break on every modification to the catalog code. | ||
# 2. We use the catalog generated code to "observe" the changes in the EDC generation logic. | ||
# | ||
# This is a standalone command and is not automatically run as part of the build. To run it you can: | ||
# This is a standalone command and is not automatically run as part of the build. To run it you can use either of these | ||
# commands: | ||
# cmake --build build_folder --target generate_catalog_edc_code | ||
add_custom_command( | ||
COMMENT "Copying generated EDC code for catalog into Gaia source tree..." | ||
OUTPUT ${GAIA_REPO}/catalog/src/gaia_catalog.cpp | ||
OUTPUT ${GAIA_REPO}/inc/gaia_internal/catalog/gaia_catalog.h | ||
OUTPUT ${GAIA_REPO}/inc/gaia_internal/catalog/catalog_generated.h | ||
COMMAND cp ${GAIA_GENERATED_CODE}/catalog/gaia_catalog.cpp ${GAIA_REPO}/production/catalog/src/ | ||
COMMAND cp ${GAIA_GENERATED_CODE}/catalog/gaia_catalog.h ${GAIA_REPO}/production/inc/gaia_internal/catalog/ | ||
COMMAND cp ${GAIA_GENERATED_CODE}/catalog/catalog_generated.h ${GAIA_REPO}/production/inc/gaia_internal/catalog/ | ||
DEPENDS edc_catalog_discard | ||
# make generate_catalog_edc_code | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment seems rather redundant. |
||
add_custom_target(generate_catalog_edc_code | ||
COMMENT "Copying generated EDC code for catalog into Gaia source tree..." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation got messed up here too. Is your editor set incorrectly for make files? |
||
DEPENDS ${GAIA_GENERATED_CODE}/catalog/gaia_catalog.cpp | ||
DEPENDS ${GAIA_GENERATED_CODE}/catalog/gaia_catalog.h | ||
DEPENDS ${GAIA_GENERATED_CODE}/catalog/catalog_generated.h | ||
COMMAND cp ${GAIA_GENERATED_CODE}/catalog/gaia_catalog.cpp ${GAIA_REPO}/production/catalog/src/ | ||
COMMAND cp ${GAIA_GENERATED_CODE}/catalog/gaia_catalog.h ${GAIA_REPO}/production/inc/gaia_internal/catalog/ | ||
COMMAND cp ${GAIA_GENERATED_CODE}/catalog/catalog_generated.h ${GAIA_REPO}/production/inc/gaia_internal/catalog/ | ||
) | ||
|
||
add_custom_target(generate_catalog_edc_code ALL | ||
DEPENDS ${GAIA_REPO}/catalog/src/gaia_catalog.cpp | ||
DEPENDS ${GAIA_REPO}/inc/gaia_internal/catalog/gaia_catalog.h | ||
DEPENDS ${GAIA_REPO}/inc/gaia_internal/catalog/catalog_generated.h | ||
) | ||
set_target_properties(generate_catalog_edc_code PROPERTIES | ||
EXCLUDE_FROM_ALL true) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in my local branch. The fix will come in the next PR.