llvm.org GIT mirror llvm / 5a0169f
Only modify lto.exports.def when contents have changed. Patch by Greg Bedwell. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192182 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
1 changed file(s) with 9 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1414 # 'EXPORTS'. The file "lto.exports" already contains the list, so we
1515 # massage it into the correct format here to create "lto.exports.def".
1616 set(LTO_EXPORTS_DEF ${CMAKE_CURRENT_BINARY_DIR}/lto.exports.def)
17 set(LTO_EXPORTS_DEF_TEMP ${LTO_EXPORTS_DEF}.txt)
1718 file(READ "lto.exports" exports_list)
18 file(WRITE ${LTO_EXPORTS_DEF} "LIBRARY LTO\n")
19 file(APPEND ${LTO_EXPORTS_DEF} "EXPORTS\n")
20 file(APPEND ${LTO_EXPORTS_DEF} ${exports_list})
19 file(WRITE ${LTO_EXPORTS_DEF_TEMP} "LIBRARY LTO\n")
20 file(APPEND ${LTO_EXPORTS_DEF_TEMP} "EXPORTS\n")
21 file(APPEND ${LTO_EXPORTS_DEF_TEMP} ${exports_list})
22
23 # Copy the file only if it has changed.
24 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
25 ${LTO_EXPORTS_DEF_TEMP} ${LTO_EXPORTS_DEF})
26
2127 set(SHARED_LIB_SOURCES ${SOURCES} ${LTO_EXPORTS_DEF})
2228 else()
2329 set(SHARED_LIB_SOURCES ${SOURCES})