Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-10-25 10:21:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-10-25 10:21:38 +0400
commit93edbf3510927a02cfb01f5569eb0f3838670f08 (patch)
tree0f5add71a65e1a2973b97e87dab356736b46e6ce
parent4aa02d8038ccb9062b4ab522c41e54cacb0217ce (diff)
add check for cmake that source files are not included multiple times
-rw-r--r--build_files/cmake/macros.cmake23
-rw-r--r--source/blender/render/CMakeLists.txt1
2 files changed, 23 insertions, 1 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 9ded803f45b..fdc0fb63c8e 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -48,6 +48,24 @@ macro(list_insert_before
unset(_index)
endmacro()
+function (list_assert_duplicates
+ list_id
+ )
+
+ # message(STATUS "list data: ${list_id}")
+
+ list(LENGTH list_id _len_before)
+ list(REMOVE_DUPLICATES list_id)
+ list(LENGTH list_id _len_after)
+ # message(STATUS "list size ${_len_before} -> ${_len_after}")
+ if(NOT _len_before EQUAL _len_after)
+ message(FATAL_ERROR "duplicate found in list which should not contain duplicates: ${list_id}")
+ endif()
+ unset(_len_before)
+ unset(_len_after)
+endfunction()
+
+
# foo_bar.spam --> foo_barMySuffix.spam
macro(file_suffix
file_name_new file_name file_suffix
@@ -177,6 +195,11 @@ macro(blender_add_lib_nolist
# listed is helpful for IDE's (QtCreator/MSVC)
blender_source_group("${sources}")
+ list_assert_duplicates("${sources}")
+ list_assert_duplicates("${includes}")
+ # Not for system includes because they can resolve to the same path
+ # list_assert_duplicates("${includes_sys}")
+
endmacro()
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt
index 94a95974009..db23cd97b74 100644
--- a/source/blender/render/CMakeLists.txt
+++ b/source/blender/render/CMakeLists.txt
@@ -98,7 +98,6 @@ set(SRC
intern/include/raycounter.h
intern/include/rayobject.h
intern/include/rayintersection.h
- intern/include/raycounter.h
intern/include/render_types.h
intern/include/render_result.h
intern/include/rendercore.h