diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index 9f4f278138..c2d1d89dd4 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -35,9 +35,7 @@ jobs: - name: XML validation run: | sudo apt-get install -y libxml2-utils - for i in xml/issue*.xml ; do - xmllint --noout --nowarning --dtdvalid xml/lwg-issue.dtd $i - done + bin/lint.sh - name: Generate HTML lists run: make lists diff --git a/.gitignore b/.gitignore index 0165c6b637..2aa865a4c7 100644 --- a/.gitignore +++ b/.gitignore @@ -12,8 +12,11 @@ /bin/list_issues /bin/set_status.exe /bin/set_status +/build +/out /src/*.[do] /mailing +/.vs /.vscode .DS_Store R*-mailing.zip diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..d87d7fe6df --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,99 @@ +cmake_minimum_required(VERSION 3.28) + +project(lwg) + +### Configuration + +set(mailing_directory ${CMAKE_CURRENT_SOURCE_DIR}/mailing) + +# Tell MSVC to behave +add_compile_options("$<$:/utf-8;/Zc:__cplusplus;\ +$<$,20>:/permissive->>") + +# Enable ASan (and UBSan with non-MSVC) for Debug builds +set(sanitizer_options "$<$:\ +-fsanitize=address$<$>:$undefined>>") +add_compile_options(${sanitizer_options}) +add_link_options(${sanitizer_options}) + +# Enable Standard Library assertions +include(CheckCXXSymbolExists) + +if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + set(cxx_detect_header version) +else() + set(cxx_detect_header ciso646) +endif() + +check_cxx_symbol_exists(__GLIBCXX__ ${cxx_detect_header} stl_is_libstdcxx) +if(${stl_is_libstdcxx}) + add_compile_definitions(_GLIBCXX_ASSERTIONS_ $<$:_GLIBCXX_DEBUG>) +endif() + +check_cxx_symbol_exists(_LIBCPP_VERSION ${cxx_detect_header} stl_is_libcxx) +if(${stl_is_libcxx}) + # Untested: + add_compile_definitions(_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE$,_DEBUG,_FAST>) +endif() + +check_cxx_symbol_exists(_MSVC_STL_VERSION ${cxx_detect_header} stl_is_msvcstl) +if(${stl_is_msvcstl}) + add_compile_definitions(_CONTAINER_DEBUG_LEVEL) +endif() + +# LTO, because why not +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE On) +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO On) + +### Program targets +add_library(lwg + src/date.cpp src/issues.cpp src/mailing_info.cpp src/metadata.cpp + src/report_generator.cpp src/sections.cpp src/status.cpp) +target_sources(lwg PUBLIC FILE_SET headers TYPE HEADERS BASE_DIRS src + FILES src/date.h src/html_utils.h src/issues.h src/mailing_info.h + src/metadata.h src/report_generator.h src/sections.h src/status.h) +target_compile_features(lwg PUBLIC cxx_std_17) + +add_executable(list_issues src/list_issues.cpp) +target_link_libraries(list_issues lwg) + +add_executable(lists src/lists.cpp) +target_link_libraries(lists lwg) + +add_executable(section_data src/section_data.cpp) +target_link_libraries(section_data lwg) + +add_executable(set_status src/set_status.cpp) +target_link_libraries(set_status lwg) + +add_executable(toc_diff src/toc_diff.cpp) +target_link_libraries(toc_diff lwg) + +file(GLOB issue_files CONFIGURE_DEPENDS xml/issue*.xml) +add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/meta-data/dates + COMMENT "Refreshing 'Last modified' timestamps for issues..." + COMMAND git whatchanged --no-show-signature --pretty=%ct | python bin/make_dates.py > meta-data/dates + VERBATIM + MAIN_DEPENDENCY bin/make_dates.py DEPENDS ${issue_files} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +### Utility targets +add_custom_target(build_lists COMMAND lists DEPENDS lists mailing + COMMENT "Generating HTML lists" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_custom_target(dates DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/meta-data/dates) + +add_custom_target(distclean DEPENDS clean COMMAND cmake -E rm -rf ${mailing_directory} VERBATIM) + +add_custom_target(lint COMMAND bash -c bin/lint.sh VERBATIM + COMMENT "Validating XML issue files" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_custom_target(pgms DEPENDS lists section_data toc_diff list_issues set_status) + +add_custom_target(history COMMAND lists revision history VERBATIM DEPENDS lists + COMMENT "Generating revision history" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_custom_target(mailing COMMAND ${CMAKE_COMMAND} -E make_directory ${mailing_directory} VERBATIM) diff --git a/bin/lint.sh b/bin/lint.sh new file mode 100755 index 0000000000..7842c6e3de --- /dev/null +++ b/bin/lint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +find xml -name 'issue*.xml' -print0 \ + | xargs -0 -P $(getconf _NPROCESSORS_ONLN) -n 128 \ + xmllint --noout --nowarning --dtdvalid xml/lwg-issue.dtd diff --git a/src/msvc/lists/lists.vcxproj b/src/msvc/lists/lists.vcxproj deleted file mode 100644 index 9a0ddef59a..0000000000 --- a/src/msvc/lists/lists.vcxproj +++ /dev/null @@ -1,159 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F} - Win32Proj - lists - 8.1 - - - - Application - true - v140 - Unicode - - - Application - false - v140 - true - Unicode - - - Application - true - v140 - Unicode - - - Application - false - v140 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - - - Level3 - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - {03a5e4d3-0113-4d45-807f-bafb7d006f69} - - - - - - \ No newline at end of file diff --git a/src/msvc/lwg_issues.sln b/src/msvc/lwg_issues.sln deleted file mode 100644 index 40d80a3166..0000000000 --- a/src/msvc/lwg_issues.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwg_issues_dll", "lwg_issues_dll\lwg_issues_dll.vcxproj", "{03A5E4D3-0113-4D45-807F-BAFB7D006F69}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lists", "lists\lists.vcxproj", "{3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {03A5E4D3-0113-4D45-807F-BAFB7D006F69}.Debug|x64.ActiveCfg = Debug|x64 - {03A5E4D3-0113-4D45-807F-BAFB7D006F69}.Debug|x64.Build.0 = Debug|x64 - {03A5E4D3-0113-4D45-807F-BAFB7D006F69}.Debug|x86.ActiveCfg = Debug|Win32 - {03A5E4D3-0113-4D45-807F-BAFB7D006F69}.Debug|x86.Build.0 = Debug|Win32 - {03A5E4D3-0113-4D45-807F-BAFB7D006F69}.Release|x64.ActiveCfg = Release|x64 - {03A5E4D3-0113-4D45-807F-BAFB7D006F69}.Release|x64.Build.0 = Release|x64 - {03A5E4D3-0113-4D45-807F-BAFB7D006F69}.Release|x86.ActiveCfg = Release|Win32 - {03A5E4D3-0113-4D45-807F-BAFB7D006F69}.Release|x86.Build.0 = Release|Win32 - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}.Debug|x64.ActiveCfg = Debug|x64 - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}.Debug|x64.Build.0 = Debug|x64 - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}.Debug|x86.ActiveCfg = Debug|Win32 - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}.Debug|x86.Build.0 = Debug|Win32 - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}.Release|x64.ActiveCfg = Release|x64 - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}.Release|x64.Build.0 = Release|x64 - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}.Release|x86.ActiveCfg = Release|Win32 - {3D6C4C23-3DF5-40D0-A59A-8AB682993B0F}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/msvc/lwg_issues_dll/lwg_issues_dll.vcxproj b/src/msvc/lwg_issues_dll/lwg_issues_dll.vcxproj deleted file mode 100644 index 0d55065dc7..0000000000 --- a/src/msvc/lwg_issues_dll/lwg_issues_dll.vcxproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {03A5E4D3-0113-4D45-807F-BAFB7D006F69} - Win32Proj - lwg_issues_dll - 8.1 - - - - DynamicLibrary - true - v140 - Unicode - - - DynamicLibrary - false - v140 - true - Unicode - - - DynamicLibrary - true - v140 - Unicode - - - DynamicLibrary - false - v140 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;LWG_ISSUES_DLL_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - - - - - - - Level3 - Disabled - _DEBUG;_WINDOWS;_USRDLL;LWG_ISSUES_DLL_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LWG_ISSUES_DLL_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_WINDOWS;_USRDLL;LWG_ISSUES_DLL_EXPORTS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - - - - - - - - - - - - - \ No newline at end of file