-
Notifications
You must be signed in to change notification settings - Fork 46
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
Refactor cmake scripts #75
Refactor cmake scripts #75
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ahmedyarub The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Very cool ! But And I don't recommend moving "unit-test" and "plugins" directories outside the main source folder
Could you please add your code to the template file ? |
Sure I'll do that later today |
|
I went ahead and downloaded all the requirements for regenerating the C client for k8s, trying to understand how the CMake script were customized exactly by the generator, and it looks like additions were made manually in a PR like this #9. In this PR you can see that some .c files were added manually to the SRCS variable since the generator does not know about these files. I was trying to do exactly the same. So the question now is: what is the accepted solution for customizing the template? by adding changes manually to this repo? Or may I suggest including optional CMake scripts in multiple places (ex: in the beginning of the file, before find_package(), at the end of the file, etc...) so that each generated client can add its own scripts without editing the original template? |
For this PR: I only suggest addressing the # 2 (Build one of the examples using CMake) for now. But I also agree the solution including optional CMake scripts in multiple places is a good solution because this repo will not need update manually each time re-generating the C client. e.g. add below files So it's up to you: if you want to merge this PR quickly, then only need address # 2; if you want to re-organize the CMakefiles in upstream repo (openapi-generator/c-libcurl), please try it. Thank you. |
I will reorganize the CMake files and create new PR's within the next days. Thank you. |
Added a new PR OpenAPITools/openapi-generator#10249 |
Replaced with #78 |
1- Use Glob to (greatly) lower CMake's file size
2- Build one of the examples using CMake (later I'll add CMake scripts for building the other examples)
3- Move unit-tests and plugins outside the main source folder to avoid picking them up by GLOB
This has been fully tested. I'm open to any suggestions :)