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

Add option to build library as a shared object. #150

Open
ZzEeKkAa opened this issue Jun 4, 2024 · 2 comments
Open

Add option to build library as a shared object. #150

ZzEeKkAa opened this issue Jun 4, 2024 · 2 comments

Comments

@ZzEeKkAa
Copy link

ZzEeKkAa commented Jun 4, 2024

I see currently library is being built as a static library. That makes every project that uses this library inject the code inside their program. Instead it can be built as a dynamic library (.so on linux and .dll on windows) and link dynamically on the runtime. It will reduce size of the result binaries and will get an option to users to update ittapi library without updating application (if the ABI is compatible).

My question is if it possible to add shared target to the build? It should be as easy as removing STATIC keyword from add_library and then it can be controlled with BUILD_SHARED_LIBS argument. Or there is a reason why it can't be loaded as a shared library?

@Andy51
Copy link

Andy51 commented Jun 4, 2024

In short, ittapi being a static library is a design decision and converting it to a shared library would break a lot of things. ittapi has to distinguish the dynamic library it was being called from in some cases and the simplest way was to do it was to link statically to each of the instrumented exes/dlls.

@ZzEeKkAa
Copy link
Author

ZzEeKkAa commented Jun 4, 2024

Thank you @Andy51 !

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