llvm.org GIT mirror llvm / d87c2fc
CMake: make __DATE__, __TIME__ etc. macro usage an error When LLVM_ENABLE_TIMESTAMPS has been disabled we can prevent the preprocessor from embedding dates, times and file timestamps. There are a few motivations for this: 1) Validate the recent CMake feature detection bugfix from LLVM r212586 with a flag that's not actually available everywhere. 2) Dogfood clang's new -Wdate-time warning from r210511 when bootstrapping. 3) Encourage reproducible builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212587 91177308-0d34-0410-b5e6-96231b3b80d8 Alp Toker 5 years ago
1 changed file(s) with 3 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
301301 endif()
302302 endif (LLVM_ENABLE_WARNINGS)
303303 append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
304 if (NOT LLVM_ENABLE_TIMESTAMPS)
305 add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
306 endif ()
304307 if (LLVM_ENABLE_CXX1Y)
305308 check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
306309 append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)