I'm using cmake to build my library, when i change one of LIB_SRCS files and type make in command line it doesn't rcompile that file!
set (LIB_SRCS
${PROJECT_SOURCE_DIR}/src/A.cpp
${PROJECT_SOURCE_DIR}/src/B.cpp
${PROJECT_SOURCE_DIR}/src/C.cpp
)
add_library (mylib SHARED ${LIB_SRCS})
add_dependencies(mylib ${LIB_SRCS})
the first thing you should check is modification time of .o and .so vs .cpp When mtime of .cpp is greater than .o then it should rebuild. You can test it even without modification by 'touch' file.cpp.
In some strange scenario time can be mismatched due to many reasons and then it will not work. Possible reason can be for example some demon which plays with system time, or using network file system, and others.
However in real life scenario it is usually not make mistake but developer mistake :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With