diff options
Diffstat (limited to 'Tests/BuildDepends/CMakeLists.txt')
-rw-r--r-- | Tests/BuildDepends/CMakeLists.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 2be59b6..7b7353c 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -69,6 +69,9 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_exe.h "#define link_depends_no_shared_exe_value 0\n") set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_check.txt) +file(WRITE ${BuildDepends_BINARY_DIR}/Project/object_depends.txt "0\n") +set(object_depends_check_txt ${BuildDepends_BINARY_DIR}/Project/object_depends_check.txt) + file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in original\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp original\n") @@ -246,6 +249,8 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_lib.h "#define link_depends_no_shared_lib_value 0\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/object_depends.txt "1\n") + if(TEST_LINK_DEPENDS) file(WRITE ${TEST_LINK_DEPENDS} "2") endif() @@ -359,6 +364,20 @@ else() "Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.") endif() +if(EXISTS "${object_depends_check_txt}") + file(STRINGS "${object_depends_check_txt}" object_depends_check LIMIT_COUNT 1) + if("${object_depends_check}" STREQUAL "1") + message(STATUS "object_depends exe is newer than object_depends.txt as expected.") + elseif(CMAKE_GENERATOR MATCHES "Visual Studio|Xcode") + message(STATUS "Known limitation: OBJECT_DEPENDS does not work on ${CMAKE_GENERATOR}") + else() + message(SEND_ERROR "Project did not rebuild properly: object_depends exe is not newer than object_depends.txt.") + endif() +else() + message(SEND_ERROR "Project did not rebuild properly. " + "object_depends exe and object_depends.txt are not both present.") +endif() + if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out) file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out) if("${external_out}" STREQUAL "external changed") |