-
Notifications
You must be signed in to change notification settings - Fork 31
WIP Draft: Convert exemplar into an INTERFACE library #262
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
Draft
ednolan
wants to merge
6
commits into
main
Choose a base branch
from
enolan_interface1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f4b55ec
WIP Draft: Convert exemplar into an INTERFACE library
ednolan 71e97d9
remove dynamic CI config
wusatosi 3019cff
update README to reflect new dir structure
wusatosi e0141a1
update cookiecutter
wusatosi bf74f21
update file tree
wusatosi 36dd20f
update cookie cutter to allow production of both interface and static…
wusatosi 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/usr/bin/env python3 | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| """Post-generation hook to clean up template files based on library_type.""" | ||
|
|
||
| import shutil | ||
| from pathlib import Path | ||
|
|
||
| # Get the library type from cookiecutter context | ||
| library_type = "{{ cookiecutter.library_type }}" | ||
|
|
||
| # If interface library, remove the src/ directory (not needed for header-only) | ||
| if library_type == "interface": | ||
| src_dir = Path("src") | ||
| if src_dir.exists(): | ||
| shutil.rmtree(src_dir) | ||
| print("✓ Removed src/ directory (not needed for interface library)") | ||
|
|
||
| print("✓ Template generation complete") |
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -7,9 +7,12 @@ on: | |
| schedule: | ||
| - cron: "0 16 * * 0" | ||
|
|
||
| {% raw -%} | ||
| jobs: | ||
| auto-update-pre-commit: | ||
| uses: bemanproject/infra-workflows/.github/workflows/[email protected] | ||
| secrets: | ||
| APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }} | ||
| PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }} | ||
| {%- endraw %} | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
4 changes: 4 additions & 0 deletions
4
...cutter/{{cookiecutter.project_name}}/src/beman/{{cookiecutter.project_name}}/identity.cpp
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| #include <beman/{{cookiecutter.project_name}}/identity.hpp> | ||
|
|
||
| // Implementation file for static library build. | ||
| // For a simple identity function, there's nothing to implement here, | ||
| // but this file exists to demonstrate the static library structure. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
It's interesting how the header list moves to the top-level directory when it's a header-only library. This has two drawbacks:
What are your thoughts on peeing the
src/beman/exemplardirectory and having it contain only aCMakeLists.txtthat builds the target?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.
It shouldn't be necessary to have the list of files in the root, but I have found that creating the library and naming the header set at the root makes it more local.
https://github.com/steve-downey/optional/blob/main/CMakeLists.txt#L23-L28
and
https://github.com/steve-downey/optional/blob/main/include/beman/optional/CMakeLists.txt#L4-L15