Skip to content

Commit 97e05c4

Browse files
hjmjohnsoncdunn2001
authored andcommitted
COMP: Provide C++11 feature testing during config
Test compiler feature sets early so that required features are validated before long compilation process is started.
1 parent b3b92df commit 97e05c4

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Diff for: src/lib_json/CMakeLists.txt

+50
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,56 @@ if(APPLE)
8383
set_target_properties( jsoncpp_lib PROPERTIES INSTALL_RPATH "@loader_path/." )
8484
endif()
8585

86+
# Specify compiler features required when compiling a given target.
87+
# See https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html#prop_gbl:CMAKE_CXX_KNOWN_FEATURES
88+
# for complete list of features available
89+
target_compile_features(jsoncpp_lib PUBLIC
90+
cxx_std_11 # Compiler mode is aware of C++ 11.
91+
#MSVC 1900 cxx_alignas # Alignment control alignas, as defined in N2341.
92+
#MSVC 1900 cxx_alignof # Alignment control alignof, as defined in N2341.
93+
#MSVC 1900 cxx_attributes # Generic attributes, as defined in N2761.
94+
cxx_auto_type # Automatic type deduction, as defined in N1984.
95+
#MSVC 1900 cxx_constexpr # Constant expressions, as defined in N2235.
96+
cxx_decltype # Decltype, as defined in N2343.
97+
cxx_default_function_template_args # Default template arguments for function templates, as defined in DR226
98+
cxx_defaulted_functions # Defaulted functions, as defined in N2346.
99+
#MSVC 1900 cxx_defaulted_move_initializers # Defaulted move initializers, as defined in N3053.
100+
cxx_delegating_constructors # Delegating constructors, as defined in N1986.
101+
#MSVC 1900 cxx_deleted_functions # Deleted functions, as defined in N2346.
102+
cxx_enum_forward_declarations # Enum forward declarations, as defined in N2764.
103+
cxx_explicit_conversions # Explicit conversion operators, as defined in N2437.
104+
cxx_extended_friend_declarations # Extended friend declarations, as defined in N1791.
105+
cxx_extern_templates # Extern templates, as defined in N1987.
106+
cxx_final # Override control final keyword, as defined in N2928, N3206 and N3272.
107+
#MSVC 1900 cxx_func_identifier # Predefined __func__ identifier, as defined in N2340.
108+
#MSVC 1900 cxx_generalized_initializers # Initializer lists, as defined in N2672.
109+
#MSVC 1900 cxx_inheriting_constructors # Inheriting constructors, as defined in N2540.
110+
#MSVC 1900 cxx_inline_namespaces # Inline namespaces, as defined in N2535.
111+
cxx_lambdas # Lambda functions, as defined in N2927.
112+
#MSVC 1900 cxx_local_type_template_args # Local and unnamed types as template arguments, as defined in N2657.
113+
cxx_long_long_type # long long type, as defined in N1811.
114+
#MSVC 1900 cxx_noexcept # Exception specifications, as defined in N3050.
115+
#MSVC 1900 cxx_nonstatic_member_init # Non-static data member initialization, as defined in N2756.
116+
cxx_nullptr # Null pointer, as defined in N2431.
117+
cxx_override # Override control override keyword, as defined in N2928, N3206 and N3272.
118+
cxx_range_for # Range-based for, as defined in N2930.
119+
cxx_raw_string_literals # Raw string literals, as defined in N2442.
120+
#MSVC 1900 cxx_reference_qualified_functions # Reference qualified functions, as defined in N2439.
121+
cxx_right_angle_brackets # Right angle bracket parsing, as defined in N1757.
122+
cxx_rvalue_references # R-value references, as defined in N2118.
123+
#MSVC 1900 cxx_sizeof_member # Size of non-static data members, as defined in N2253.
124+
cxx_static_assert # Static assert, as defined in N1720.
125+
cxx_strong_enums # Strongly typed enums, as defined in N2347.
126+
#MSVC 1900 cxx_thread_local # Thread-local variables, as defined in N2659.
127+
cxx_trailing_return_types # Automatic function return type, as defined in N2541.
128+
#MSVC 1900 cxx_unicode_literals # Unicode string literals, as defined in N2442.
129+
cxx_uniform_initialization # Uniform initialization, as defined in N2640.
130+
#MSVC 1900 cxx_unrestricted_unions # Unrestricted unions, as defined in N2544.
131+
#MSVC 1900 cxx_user_literals # User-defined literals, as defined in N2765.
132+
cxx_variadic_macros # Variadic macros, as defined in N1653.
133+
cxx_variadic_templates # Variadic templates, as defined in N2242.
134+
)
135+
86136
install( TARGETS jsoncpp_lib ${INSTALL_EXPORT}
87137
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
88138
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

0 commit comments

Comments
 (0)