GenerateExportHeader: add release notes, tests for include guard changes

This commit is contained in:
Kyle Edwards 2018-01-09 11:34:38 -05:00 committed by Brad King
parent f4082b0e9b
commit b1ae9aaf79
20 changed files with 54 additions and 14 deletions

View File

@ -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.

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -0,0 +1,10 @@
#include "@EXPORT_HEADER@"
int main()
{
#if defined(@DEF_SYMBOL@) && !defined(@NDEF_SYMBOL@)
return 0;
#else
return 1;
#endif
}

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSHARED_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSTATIC_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSHARED_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSTATIC_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSHARED_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSTATIC_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSHARED_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSTATIC_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSHARED_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSTATIC_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSHARED_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSTATIC_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSHARED_EXPORT_H */

View File

@ -39,4 +39,4 @@
# endif
#endif
#endif
#endif /* LIBSTATIC_EXPORT_H */