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

CMake: enable dynamic-link library for libavrdude #826

Merged
merged 2 commits into from
Jan 11, 2022

Conversation

yegorich
Copy link
Contributor

Add on option BUILD_SHARED_LIBS to also build a DLL variant
of the libavrdude library. Turn it off by default to preserve
current behavior.

Add on option BUILD_SHARED_LIBS to also build a DLL variant
of the libavrdude library. Turn it off by default to preserve
current behavior.
@dl8dtl
Copy link
Contributor

dl8dtl commented Jan 11, 2022

Speaking of that, I noticed that the static library built is named liblibavrdude.a.
There seems to be one "lib" too much. ;-)
Could we perhaps fix that at the same time?

@yegorich
Copy link
Contributor Author

This could be a problem. CMake doesn't like the fact that two targets have the same name. I'd suggest to rename the library into, for example, either avrdudesdk or avrdudecore. But this is a matter of another PR.

@dl8dtl
Copy link
Contributor

dl8dtl commented Jan 11, 2022

Strange behaviour of CMake. As they append the "lib" theirselves, they should also consider that a different target.

Actually, I just verified the FreeBSD port, we did ship libavrdude.a and libavrdude.so already in the past (with the automake system).

Googled a bit around,
SET_TARGET_PROPERTIES(libavrdude PROPERTIES PREFIX "")
should do the trick.

CMake adds "lib" prefix to the library name and hence we get the
following name "liblibavrdude". Use set_target_properties to
set the prefix to "".
@yegorich
Copy link
Contributor Author

It really does. Learned something new.

@dl8dtl
Copy link
Contributor

dl8dtl commented Jan 11, 2022

It really does. Learned something new.

👍

@dl8dtl dl8dtl merged commit 4e1bbf0 into avrdudes:main Jan 11, 2022
dl8dtl added a commit that referenced this pull request Jan 11, 2022
@mcuee mcuee added the enhancement New feature or request label Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants