mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
GenerateExportHeader: add release notes, tests for include guard changes
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
GenerateExportHeader-include-guard
|
||||
----------------------------------
|
||||
|
||||
* The :module:`GenerateExportHeader` module learned an optional
|
||||
``INCLUDE_GUARD_NAME`` parameter to change the name of the include guard
|
||||
symbol written to the generated export header.
|
||||
Additionally, it now adds a comment after the closing ``#endif`` on the
|
||||
generated export header's include guard.
|
||||
@@ -85,6 +85,7 @@ macro_add_test_library(libshared)
|
||||
macro_add_test_library(libstatic)
|
||||
|
||||
add_subdirectory(nodeprecated)
|
||||
add_subdirectory(includeguard)
|
||||
if(NOT BORLAND)
|
||||
add_subdirectory(c_identifier)
|
||||
endif()
|
||||
|
||||
@@ -12,6 +12,8 @@ function(run_GEH)
|
||||
run_cmake(GEH)
|
||||
run_cmake_command(GEH-build ${CMAKE_COMMAND} --build . --config Debug)
|
||||
run_cmake_command(GEH-run ${RunCMake_TEST_BINARY_DIR}/GenerateExportHeader)
|
||||
run_cmake_command(GEH-incguard-macro-run ${RunCMake_TEST_BINARY_DIR}/test_includeguard_macro)
|
||||
run_cmake_command(GEH-incguard-custom-run ${RunCMake_TEST_BINARY_DIR}/test_includeguard_custom)
|
||||
|
||||
file(STRINGS "${RunCMake_TEST_BINARY_DIR}/failure_test_targets"
|
||||
failure_test_targets)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
set(libincludeguard_SRC libincludeguard.cpp)
|
||||
|
||||
add_library(includeguard_macro ${libincludeguard_SRC})
|
||||
generate_export_header(includeguard_macro)
|
||||
|
||||
set(EXPORT_HEADER includeguard_macro_export.h)
|
||||
set(DEF_SYMBOL INCLUDEGUARD_MACRO_EXPORT_H)
|
||||
set(NDEF_SYMBOL CUSTOM_GUARD)
|
||||
configure_file(main.cpp.in main_macro.cpp)
|
||||
add_executable(test_includeguard_macro ${CMAKE_CURRENT_BINARY_DIR}/main_macro.cpp)
|
||||
|
||||
add_library(includeguard_custom ${libincludeguard_SRC})
|
||||
generate_export_header(includeguard_custom INCLUDE_GUARD_NAME CUSTOM_GUARD)
|
||||
|
||||
set(EXPORT_HEADER includeguard_custom_export.h)
|
||||
set(DEF_SYMBOL CUSTOM_GUARD)
|
||||
set(NDEF_SYMBOL INCLUDEGUARD_CUSTOM_EXPORT_H)
|
||||
configure_file(main.cpp.in main_custom.cpp)
|
||||
add_executable(test_includeguard_custom ${CMAKE_CURRENT_BINARY_DIR}/main_custom.cpp)
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "@EXPORT_HEADER@"
|
||||
|
||||
int main()
|
||||
{
|
||||
#if defined(@DEF_SYMBOL@) && !defined(@NDEF_SYMBOL@)
|
||||
return 0;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSHARED_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSTATIC_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSHARED_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSTATIC_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSHARED_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSTATIC_EXPORT_H */
|
||||
|
||||
+1
-1
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSHARED_EXPORT_H */
|
||||
|
||||
+1
-1
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSTATIC_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSHARED_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSTATIC_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSHARED_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSTATIC_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSHARED_EXPORT_H */
|
||||
|
||||
@@ -39,4 +39,4 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* LIBSTATIC_EXPORT_H */
|
||||
|
||||
Reference in New Issue
Block a user