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

Build artifacts and include files are copied during cmake and make #129

Open
shibir007 opened this issue Aug 24, 2023 · 1 comment
Open

Comments

@shibir007
Copy link

We have found that during the cmake stage itself all the header files of tdi and its third-party are copied to ${CMAKE_INSTALL_PREFIX}/include/
Few instances here:
https://github.com/p4lang/tdi/blob/22cb07ac887491450d2efdb65cca727f99ecd317/CMakeLists.txt#L15C1-L17C26
https://github.com/p4lang/target-utils/blob/455fc4787a199978e0ae53bd2a6eb0cd2af1b790/CMakeLists.txt#L54

Also during make, libraries are copied to ${CMAKE_INSTALL_PREFIX}/lib. Such as below:
├── libcjson.a
├── libclish.so
├── libtarget_sys.so
├── libtarget_utils.so
├── libtdi_json_parser.so
├── libtdi_pna.so
├── libtdi_psa.so
├── libtdi.so
└── libtdi_tna.so

Is this a standard practice?

From a usability point, these are the following customer requirements we are not able to meet (because of it):

  1. until make install is called the customer wants ${CMAKE_INSTALL_PREFIX} to be untouched.
  2. make uninstall should clean any file copied or created in ${CMAKE_INSTALL_PREFIX}

Probable alternative:
Copy all the libs/artifacts to ${CMAKE_BINARY_DIR} so that we can internally include/link and proceed with the build.
Only "make install" should ideally copy the artifacts.

In this way we can reverse everything done by make install by using make uninstall.

@saynb
Copy link
Collaborator

saynb commented Sep 20, 2023

Feel free to take it up as long as the same artifacts are installed during make install

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

No branches or pull requests

2 participants