mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-08 02:17:43 +08:00
qt 6.5.1 original
This commit is contained in:
34
tests/auto/corelib/plugin/qpluginloader/lib/CMakeLists.txt
Normal file
34
tests/auto/corelib/plugin/qpluginloader/lib/CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## tst_qpluginloaderlib Generic Library:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_cmake_library(tst_qpluginloaderlib
|
||||
SHARED
|
||||
INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qpluginloader/bin"
|
||||
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../bin"
|
||||
SOURCES
|
||||
mylib.c
|
||||
LIBRARIES
|
||||
Qt::Core
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
# CMake sets for Windows-GNU platforms the suffix "lib"
|
||||
set_property(TARGET tst_qpluginloaderlib PROPERTY PREFIX "")
|
||||
endif()
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_extend_target(tst_qpluginloaderlib CONDITION MSVC
|
||||
DEFINES
|
||||
WIN32_MSVC
|
||||
)
|
||||
|
||||
set_target_properties(tst_qpluginloaderlib PROPERTIES
|
||||
C_VISIBILITY_PRESET "default"
|
||||
CXX_VISIBILITY_PRESET "default"
|
||||
)
|
28
tests/auto/corelib/plugin/qpluginloader/lib/mylib.c
Normal file
28
tests/auto/corelib/plugin/qpluginloader/lib/mylib.c
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
#if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR)
|
||||
#define LIB_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define LIB_EXPORT
|
||||
#endif
|
||||
|
||||
#if defined(Q_CC_BOR)
|
||||
# define BORLAND_STDCALL __stdcall
|
||||
#else
|
||||
# define BORLAND_STDCALL
|
||||
#endif
|
||||
|
||||
static int pluginVariable = 0xc0ffee;
|
||||
LIB_EXPORT int *pointerAddress()
|
||||
{
|
||||
return &pluginVariable;
|
||||
}
|
||||
|
||||
LIB_EXPORT int BORLAND_STDCALL version()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user