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

Don't build libs twice in the STATIC_ONLY case #174

Closed
winterz opened this issue Sep 21, 2014 · 5 comments
Closed

Don't build libs twice in the STATIC_ONLY case #174

winterz opened this issue Sep 21, 2014 · 5 comments
Labels

Comments

@winterz
Copy link
Member

winterz commented Sep 21, 2014

When building static libraries only (cmake -DSTATIC_ONLY), the libraries are built twice. stop doing that.

@winterz winterz added the bug label Sep 21, 2014
@krop
Copy link
Member

krop commented Feb 7, 2016

Hey,

Can you give more information if this is still relevant ? I'm only seeing a random parallel build issue

@krop
Copy link
Member

krop commented Feb 7, 2016

Never mind, reproduced.

@krop
Copy link
Member

krop commented Feb 7, 2016

So.. this is the expected behaviour.
eg: in src/libical/CMakeLists.txt:

add_library(ical ${LIBRARY_TYPE} ${ical_LIB_SRCS})
add_dependencies(ical ical-header)
if(NOT SHARED_ONLY)
add_library(ical-static STATIC ${ical_LIB_SRCS})
[...]

You're creating two libs when SHARED_ONLY is false. After that you're installing both but rename the library if the compiler isn't MSVC.

The question is: why do you need two libraries with different names when using MSVC ?

@winterz
Copy link
Member Author

winterz commented Feb 18, 2016

heck if I remember why things are like that. However, I know I spent some time on it and never was able to come up with a satisfactory solution on Windows. I'm not sure how to respond really.

Perhaps a re-factorization of the CMake code using functions or macros would shed some light? up to you, I don't feel much like playing with it myself.

@tonytheodore
Copy link

tonytheodore commented Aug 7, 2016

The question is: why do you need two libraries with different names when using MSVC ?

With MSVC, a *.lib file can be either a static library containing object files (corresponds to *.a with gcc) or an "import library" containing references to the *.dll functions (*.dll.a with gcc/mingw). If building both shared and static libs, the static *.lib files are typically renamed to avoid clobbering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants