From bc691cac934f1d7944ccf9c1037dd7794aa527db Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Mon, 23 Jan 2023 18:29:12 -0800 Subject: [PATCH] Adds `using namespace std` to fmt's smoke test This generates a compiler error w/ nvcc. It's preprocessor replaces `std:runtime_error` with `class std::runtime_error' and then complains that `return class std::runtime_error' is invalid. Credit: Ryan Quinlan provided this simple reproducer and the key to a simple fix Co-Authored-By: Ryan Quinlan --- src/thirdparty/tests/CMakeLists.txt | 5 ++++- src/thirdparty/tests/fmt_smoke.cpp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/thirdparty/tests/CMakeLists.txt b/src/thirdparty/tests/CMakeLists.txt index 8567c8fa88..0add0fa0cf 100644 --- a/src/thirdparty/tests/CMakeLists.txt +++ b/src/thirdparty/tests/CMakeLists.txt @@ -130,11 +130,14 @@ endif() #------------------------------------------------------------------------------ # Smoke test for fmt third party library #------------------------------------------------------------------------------ +set(fmt_smoke_dependencies fmt gtest) +blt_list_append( TO fmt_smoke_dependencies ELEMENTS cuda IF ENABLE_CUDA) + blt_add_executable( NAME fmt_smoke_test SOURCES fmt_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON fmt gtest + DEPENDS_ON ${fmt_smoke_dependencies} FOLDER axom/thirdparty/tests ) axom_add_test(NAME fmt_smoke diff --git a/src/thirdparty/tests/fmt_smoke.cpp b/src/thirdparty/tests/fmt_smoke.cpp index 95fb7d6035..4604674f73 100644 --- a/src/thirdparty/tests/fmt_smoke.cpp +++ b/src/thirdparty/tests/fmt_smoke.cpp @@ -16,6 +16,10 @@ #include "gtest/gtest.h" +// Note: The following line generates an error with nvcc on fmt@9.1 +// Axom has a patch to workaround this error. +using namespace std; + //----------------------------------------------------------------------------- TEST(fmt_smoke, basic_use) {