On 23/01/13 13:29, Vincent Cai wrote:
         I have a Qt project which is linked with a static library.

When I updated the static library, and try build the project, the project can't detect that the library is updated and need to rebuild.


qmake does not write out dependencies between the target and anything it links to.

This is most noticeable with static libraries but it can also be a problem with shared libraries.

I imagine qmake doesn't do this because of how difficult it is to know exactly which libs the linker will use when linking.

The easiest solution is to force the linker to run again.

If you know (or can find out) the proper paths to your target and libs, you can create explicit rules for your Makefile.

I've used something like this in the past.

defineTest(forcedep) {
    eval($${1}.depends = $$2)
    QMAKE_EXTRA_TARGETS += $$1
    export($${1}.depends)
    export(QMAKE_EXTRA_TARGETS)
}
forcedep($$OUT_PWD/$$TARGET, $$PWD/somelib.a)

--
Link

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to