mirror of
https://github.com/reactos/CMake.git
synced 2024-12-15 15:48:52 +00:00
ce331bab92
We use cmGlobalGenerator::GetDirectoryContent to avoid repeating directory listings. However, GetDirectoryContent loads content from disk at most once. This breaks find_library calls that occur when disk content has changed since preceding find_library calls. Teach cmGlobalGenerator::GetDirectoryContent to save the directory modification time when content is loaded and re-load content if it changes. Create a RunCMake.find_library test with a case covering this.
17 lines
521 B
CMake
17 lines
521 B
CMake
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
|
|
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
|
|
find_library(CREATED_LIBRARY
|
|
NAMES created
|
|
PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib
|
|
NO_DEFAULT_PATH
|
|
)
|
|
message("CREATED_LIBRARY='${CREATED_LIBRARY}'")
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created")
|
|
find_library(CREATED_LIBRARY
|
|
NAMES created
|
|
PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib
|
|
NO_DEFAULT_PATH
|
|
)
|
|
message("CREATED_LIBRARY='${CREATED_LIBRARY}'")
|