diff options
Diffstat (limited to 'tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports')
4 files changed, 62 insertions, 0 deletions
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt new file mode 100644 index 0000000000..0e446dd108 --- /dev/null +++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_module(TestAutogeneratingCppExports + NO_UNITY_BUILD + GENERATE_CPP_EXPORTS + SOURCES + module_api.h + module_api.cpp + PUBLIC_LIBRARIES + Qt::Core +) + +qt_internal_extend_target(TestAutogeneratingCppExports + CONDITION GCC OR MINGW + COMPILE_OPTIONS + -fvisibility=hidden +) + +add_executable(TestAutogeneratingCppExportsApp use_api.cpp) +target_link_libraries(TestAutogeneratingCppExportsApp PRIVATE TestAutogeneratingCppExports) +set_target_properties(TestAutogeneratingCppExportsApp PROPERTIES UNITY_BUILD OFF) diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.cpp b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.cpp new file mode 100644 index 0000000000..e77895e719 --- /dev/null +++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.cpp @@ -0,0 +1,9 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include "module_api.h" + +void TestApi::dummy() +{ + // Do nothing +} diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.h b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.h new file mode 100644 index 0000000000..6c8112c617 --- /dev/null +++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.h @@ -0,0 +1,20 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#ifndef MODULE_API_H +#define MODULE_API_H + +#if 0 +#pragma qt_sync_skip_header_check +#pragma qt_sync_stop_processing +#endif + +#include <QtTestAutogeneratingCppExports/qttestautogeneratingcppexportsexports.h> + +struct Q_TESTAUTOGENERATINGCPPEXPORTS_EXPORT TestApi +{ + TestApi() = default; + void dummy(); +}; + +#endif //MODULE_API_H diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/use_api.cpp b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/use_api.cpp new file mode 100644 index 0000000000..f84931300f --- /dev/null +++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/use_api.cpp @@ -0,0 +1,11 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include "module_api.h" + +int main(int, char*[]) +{ + TestApi api; + api.dummy(); + return 0; +} |