summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-16 18:26:37 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-01-17 13:48:28 (GMT)
commitbcb04783f7abd1e7781eda7499b53118fdbe8000 (patch)
tree4e1ae6f5c937d6af3c1cbe7b4da48a2e42cfaf58 /Modules
parent536c535cb0cf245a1785d436b0662f7fe59ef1e4 (diff)
downloadCMake-bcb04783f7abd1e7781eda7499b53118fdbe8000.zip
CMake-bcb04783f7abd1e7781eda7499b53118fdbe8000.tar.gz
CMake-bcb04783f7abd1e7781eda7499b53118fdbe8000.tar.bz2
Features: Record for SolarisStudio 12.4.
It has similar C++11 capabilities compared to GCC 4.8.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/SunPro-CXX-FeatureTests.cmake52
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake21
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake1
3 files changed, 74 insertions, 0 deletions
diff --git a/Modules/Compiler/SunPro-CXX-FeatureTests.cmake b/Modules/Compiler/SunPro-CXX-FeatureTests.cmake
new file mode 100644
index 0000000..8e97e1d
--- /dev/null
+++ b/Modules/Compiler/SunPro-CXX-FeatureTests.cmake
@@ -0,0 +1,52 @@
+
+# Based on GNU 4.8.2
+# http://docs.oracle.com/cd/E37069_01/html/E37071/gncix.html
+# Reference: http://gcc.gnu.org/projects/cxx0x.html
+
+set(_cmake_oldestSupported "__SUNPRO_CC >= 0x5130")
+
+set(SolarisStudio124_CXX11 "(__SUNPRO_CC >= 0x5130) && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_alignas "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_alignof "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_attributes "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_inheriting_constructors "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_thread_local "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_alias_templates "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_delegating_constructors "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_extended_friend_declarations "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_final "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_noexcept "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_nonstatic_member_init "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_override "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_constexpr "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_defaulted_move_initializers "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_enum_forward_declarations "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_nullptr "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_range_for "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_unrestricted_unions "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_explicit_conversions "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_lambdas "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_local_type_template_args "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_raw_string_literals "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_auto_type "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_defaulted_functions "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_deleted_functions "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_generalized_initializers "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_inline_namespaces "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_sizeof_member "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_strong_enums "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_trailing_return_types "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_unicode_literals "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_uniform_initialization "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_variadic_templates "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_decltype "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_default_function_template_args "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_long_long_type "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_right_angle_brackets "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_rvalue_references "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_static_assert "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_extern_templates "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_func_identifier "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_variadic_macros "${SolarisStudio124_CXX11}")
+
+set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus")
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index 5968712..cb37713 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -31,3 +31,24 @@ set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -
set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ")
+
+if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
+endif()
+
+set(CMAKE_CXX_STANDARD_DEFAULT 98)
+
+macro(cmake_record_cxx_compile_features)
+ macro(_get_solaris_studio_features std_version list)
+ record_compiler_features(CXX "${std_version}" ${list})
+ endmacro()
+
+ set(_result 0)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ _get_solaris_studio_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+ if (_result EQUAL 0)
+ _get_solaris_studio_features("" CMAKE_CXX98_COMPILE_FEATURES)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index a6ff475..e81bc08 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -321,6 +321,7 @@ function(write_compiler_detection_header
GNU
Clang
AppleClang
+ SunPro
)
set(_hex_compilers ADSP Borland Embarcadero SunPro)