Skip to content

Commit 482e844

Browse files
committed
cmake: Warn about not encapsulated build properties
1 parent 3736470 commit 482e844

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,17 @@ if(configure_warnings)
280280
endforeach()
281281
message(" ******\n")
282282
endif()
283+
284+
# We want all build properties to be encapsulated properly.
285+
get_directory_property(global_compile_definitions COMPILE_DEFINITIONS)
286+
if(global_compile_definitions)
287+
message(AUTHOR_WARNING "The directory's COMPILE_DEFINITIONS property is not empty: ${global_compile_definitions}")
288+
endif()
289+
get_directory_property(global_compile_options COMPILE_OPTIONS)
290+
if(global_compile_options)
291+
message(AUTHOR_WARNING "The directory's COMPILE_OPTIONS property is not empty: ${global_compile_options}")
292+
endif()
293+
get_directory_property(global_link_options LINK_OPTIONS)
294+
if(global_link_options)
295+
message(AUTHOR_WARNING "The directory's LINK_OPTIONS property is not empty: ${global_link_options}")
296+
endif()

0 commit comments

Comments
 (0)