diff --git a/CMakePresets.json b/CMakePresets.json index 43b346ba87..004d57b2ba 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -215,6 +215,7 @@ "displayName": "CUB: C++14", "inherits": "cub-base", "cacheVariables": { + "CUB_IGNORE_DEPRECATED_CPP_DIALECT": true, "CUB_ENABLE_DIALECT_CPP14": true } }, @@ -265,6 +266,7 @@ "displayName": "Thrust: C++14", "inherits": "thrust-base", "cacheVariables": { + "THRUST_IGNORE_DEPRECATED_CPP_DIALECT": true, "THRUST_MULTICONFIG_ENABLE_DIALECT_CPP14": true } }, diff --git a/cub/cmake/CubBuildTargetList.cmake b/cub/cmake/CubBuildTargetList.cmake index f01c6244f4..5277f59e99 100644 --- a/cub/cmake/CubBuildTargetList.cmake +++ b/cub/cmake/CubBuildTargetList.cmake @@ -178,6 +178,7 @@ function(cub_build_target_list) endmacro() add_flag_option(IGNORE_DEPRECATED_CPP_DIALECT "Don't warn about any deprecated C++ standards and compilers." OFF) add_flag_option(IGNORE_DEPRECATED_CPP_11 "Don't warn about deprecated C++11." OFF) + add_flag_option(IGNORE_DEPRECATED_CPP_14 "Don't warn about deprecated C++14." OFF) add_flag_option(IGNORE_DEPRECATED_COMPILER "Don't warn about deprecated compilers." OFF) # Build cub.compiler_interface with warning flags, etc diff --git a/cub/cub/cmake/cub-config.cmake b/cub/cub/cmake/cub-config.cmake index 718fa29a10..9f86a4ebee 100644 --- a/cub/cub/cmake/cub-config.cmake +++ b/cub/cub/cmake/cub-config.cmake @@ -103,6 +103,11 @@ if (CUB_IGNORE_DEPRECATED_CPP_11 OR target_compile_definitions(_CUB_CUB INTERFACE "CUB_IGNORE_DEPRECATED_CPP_11") endif() +if (CUB_IGNORE_DEPRECATED_CPP_14 OR + THRUST_IGNORE_DEPRECATED_CPP_14) + target_compile_definitions(_CUB_CUB INTERFACE "CUB_IGNORE_DEPRECATED_CPP_14") +endif() + if (CUB_IGNORE_DEPRECATED_COMPILER OR THRUST_IGNORE_DEPRECATED_COMPILER) target_compile_definitions(_CUB_CUB INTERFACE "CUB_IGNORE_DEPRECATED_COMPILER") diff --git a/cub/cub/util_cpp_dialect.cuh b/cub/cub/util_cpp_dialect.cuh index 449db09e03..d5beca2f6b 100644 --- a/cub/cub/util_cpp_dialect.cuh +++ b/cub/cub/util_cpp_dialect.cuh @@ -50,9 +50,12 @@ // - CUB_IGNORE_DEPRECATED_CPP_11: // Ignore deprecation warnings when compiling with C++11. C++03 and outdated // compilers will still issue warnings. +// - CUB_IGNORE_DEPRECATED_CPP_14: +// Ignore deprecation warnings when compiling with C++14. C++03 and outdated +// compilers will still issue warnings. // - CUB_IGNORE_DEPRECATED_COMPILER // Ignore deprecation warnings when using deprecated compilers. Compiling -// with C++03 and C++11 will still issue warnings. +// with C++03, C++11 and C++14 will still issue warnings. // Check for the thrust opt-outs as well: # if !defined(CUB_IGNORE_DEPRECATED_CPP_DIALECT) && defined(THRUST_IGNORE_DEPRECATED_CPP_DIALECT) @@ -67,6 +70,7 @@ # ifdef CUB_IGNORE_DEPRECATED_CPP_DIALECT # define CUB_IGNORE_DEPRECATED_CPP_11 +# define CUB_IGNORE_DEPRECATED_CPP_14 # ifndef CUB_IGNORE_DEPRECATED_COMPILER # define CUB_IGNORE_DEPRECATED_COMPILER # endif @@ -115,10 +119,13 @@ CUB_COMPILER_DEPRECATION_SOFT(MSVC 2019(19.20 / 16.0 / 14.20), MSVC 2017); // Dialect checks: # if _CCCL_STD_VER < 2011 // =2017, <2019. Soft deprecation message: -THRUST_COMPILER_DEPRECATION_SOFT(MSVC 2019 (19.20/16.0/14.20), MSVC 2017); +THRUST_COMPILER_DEPRECATION_SOFT(MSVC 2019(19.20 / 16.0 / 14.20), MSVC 2017); # endif #endif // THRUST_IGNORE_DEPRECATED_COMPILER @@ -105,12 +108,14 @@ THRUST_COMPILER_DEPRECATION_SOFT(MSVC 2019 (19.20/16.0/14.20), MSVC 2017); // Dialect checks: # if _CCCL_STD_VER < 2011 //