Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplifiy configuration to build using std C++17 #3219

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

eduar-hte
Copy link
Contributor

what

Leveraged autoconf again to check whether the C++ compiler supports the required standard version and build using it.

why

Simplify std C++ used to build libModSecurity codebase to minimize configuration that depends on this setting.

This streamlines updating to C++20 in the future as it needs to be changed in a single place.

changes

references

The project configuration was bumped to C++17 in PR #3079 (see commit 367a871).

- Leveraged autoconf again to check whether the C++ compiler supports
  the required standard version and build using it.
- Replaced the outdaded `ax_cxx_compile_stdcxx_11.m4` macro with the
  latest version of `ax_cxx_compile_stdcxx` which supports C++17.
  - https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
  - https://raw.githubusercontent.com/autoconf-archive/autoconf-archive/e4e5269db2764b9f53d759c24750ac6ca38e02ea/m4/ax_cxx_compile_stdcxx.m4
- This should also streamline updating to C++20 in the future.
@eduar-hte
Copy link
Contributor Author

This streamlines updating to C++20 in the future as it needs to be changed in a single place.

I've already tested this on a separate branch, which requires only the change to the following line in configure.ac:

AX_CXX_COMPILE_STDCXX(20, noext, mandatory)

NOTE: And also a similar change in vcbuild.bat, as the Windows build doesn't rely on autoconf.

Copy link

sonarcloud bot commented Aug 8, 2024

@eduar-hte eduar-hte changed the title Simplifiy configuration to build libModSecurity with std C++17 Simplifiy configuration to build using std C++17 Aug 8, 2024
Copy link
Member

@airween airween left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@airween airween merged commit 3a83196 into owasp-modsecurity:v3/master Aug 9, 2024
49 checks passed
@eduar-hte eduar-hte deleted the cpp17 branch August 9, 2024 16:20
@marcstern marcstern added the 3.x Related to ModSecurity version 3.x label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants