Skip to content

Commit 643456d

Browse files
NxirdaNxirda
andauthored
Ensure wrong C++ version is fatal (#69)
Co-authored-by: Nxirda <Nxirda@nothing.com>
1 parent 770c07f commit 643456d

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ copa_setup_precommit_hooks(${QUIET_OPTION})
4747
## Install Process setup
4848
##======================================================================================================================
4949
copa_setup_install( LIBRARY spy
50-
FEATURES cxx_std_17
50+
FEATURES cxx_std_20
5151
DOC ${PROJECT_SOURCE_DIR}/LICENSE.md
5252
INCLUDE ${PROJECT_SOURCE_DIR}/include/spy
5353
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# SPY: C++ Information Broker
44

5-
[![Licence](https://img.shields.io/github/license/jfalcou/spy?style=plastic)](https://img.shields.io/github/license/jfalcou/spy?style=plastic)
5+
[![License](https://img.shields.io/badge/license-BSL-green?style=plastic)](./LICENSE.md)
66
[![Discord](https://img.shields.io/discord/692734675726237696?style=plastic)](https://discord.gg/a9qVaEMeXd8)
77
[![CI Status](https://github.com/jfalcou/spy/actions/workflows/unit.yml/badge.svg)](https://github.com/jfalcou/spy/actions/workflows/unit.yml)
88

include/spy/spy.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ namespace spy
3535
}
3636
}
3737

38+
#if defined(_MSC_VER)
39+
#if _MSVC_LANG < 202002L
40+
#error "SPY C++ version error"
41+
#include "SPY requires C++20 or higher. Use /std:c++20 or higher to enable C++20 features."
42+
#endif
43+
#else
44+
#if __cplusplus < 202002L
45+
#error "SPY C++ version error"
46+
#include "SPY requires C++20 or higher. Use -std=c++20 or higher to enable C++20 features."
47+
#endif
48+
#endif
49+
3850
#include <spy/detail.hpp>
3951

4052
#include <spy/accelerator.hpp>

0 commit comments

Comments
 (0)