306796e862
Build a shared library and an executable linking to it inside the inner test. Set LINK_DEPENDS_NO_SHARED on the executable. Add a custom target to compare the output file times. Verify that on the first build the executable is newer than the library. Then modify a library source file. Verify that on the second build the library is newer because the executable did not have a dependency to re-link.
8 lines
184 B
CMake
8 lines
184 B
CMake
if(NOT EXISTS "${lib}" OR NOT EXISTS "${exe}")
|
|
file(REMOVE "${out}")
|
|
elseif("${exe}" IS_NEWER_THAN "${lib}")
|
|
file(WRITE "${out}" "1\n")
|
|
else()
|
|
file(WRITE "${out}" "0\n")
|
|
endif()
|