cmake: make __FILE__ macro value relative

This commit is contained in:
Alexandre Bouvier
2022-08-18 15:27:15 +02:00
parent 6f931d49c7
commit 92824da63b
+5
View File
@@ -528,6 +528,11 @@ if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja")
)
endif()
# Set __FILE__ macro value to a relative path for reproducible builds
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
add_compile_options("-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.")
endif()
enable_testing()
add_subdirectory(externals)
add_subdirectory(src)