diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-06-11 13:36:10 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-15 10:51:59 +0000 |
commit | 3e8ea87ef8eb8dc3f429d7c7469d9113702b067f (patch) | |
tree | cf378d9c087435b3c0dff19a3bbff9a6d5b319dc /src | |
parent | 36d693eb4eff766322aea4c301ceeadc724625a7 (diff) |
Adjust the EntryPoint target name according to the internal module naming policy
Task-number: QTBUG-87775
Change-Id: I1d6097c950f97e102c44e2952edc98caa4deb6c6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 02855ff6e076d04b7ae748c2485f1e098c32d698)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/entrypoint/CMakeLists.txt | 32 |
2 files changed, 26 insertions, 18 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index ac7df9b9a4..52679b591f 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1331,10 +1331,10 @@ qt_internal_apply_gc_binaries_conditional(Core PUBLIC) # Add entry-point on platforms that need it. A project can opt-out of using the # entrypoint by setting the qt_no_entrypoint property to TRUE on a target. if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "iOS") - # find_package(Qt6Core) should call find_package(Qt6EntryPoint) so that we can - # link against EntryPoint. Normally this is handled automatically for deps, but - # for some reason it doesn't work for the EntryPoint, so we need to add it manually. - qt_record_extra_qt_package_dependency(Core EntryPoint "${PROJECT_VERSION}") + # find_package(Qt6Core) should call find_package(Qt6EntryPointPrivate) so that we can + # link against EntryPointPrivate. Normally this is handled automatically for deps, but + # for some reason it doesn't work for the EntryPointPrivate, so we need to add it manually. + qt_record_extra_qt_package_dependency(Core EntryPointPrivate "${PROJECT_VERSION}") set(entrypoint_conditions "$<NOT:$<BOOL:$<TARGET_PROPERTY:qt_no_entrypoint>>>") list(APPEND entrypoint_conditions "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>") @@ -1346,7 +1346,9 @@ if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "iOS") list(JOIN entrypoint_conditions "," entrypoint_conditions) set(entrypoint_conditions "$<AND:${entrypoint_conditions}>") - target_link_libraries(Core INTERFACE "$<${entrypoint_conditions}:${QT_CMAKE_EXPORT_NAMESPACE}::EntryPoint>") + target_link_libraries(Core INTERFACE + "$<${entrypoint_conditions}:${QT_CMAKE_EXPORT_NAMESPACE}::EntryPointPrivate>" + ) endif() # Record darwin minimum deployment target. diff --git a/src/entrypoint/CMakeLists.txt b/src/entrypoint/CMakeLists.txt index 5242337ee4..c173870e92 100644 --- a/src/entrypoint/CMakeLists.txt +++ b/src/entrypoint/CMakeLists.txt @@ -4,14 +4,14 @@ if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS") return() endif() -# The EntryPoint package consists of two targets: one for CMake consumption, +# The EntryPointPrivate package consists of two targets: one for CMake consumption, # and one internal that produces the static library. Together these form the # entrypoint module in qmake terms. This split allows us to inject library # dependencies that need to go _before_ the static library, to work around # CMake's lack of whole archive. # ---- The header-only target produces the actual module ---- -qt_internal_add_module(EntryPoint +qt_internal_add_module(EntryPointPrivate HEADER_MODULE INTERNAL_MODULE NO_SYNC_QT @@ -20,9 +20,9 @@ qt_internal_add_module(EntryPoint NO_ADDITIONAL_TARGET_INFO ) -set(export_targets EntryPoint) +set(export_targets EntryPointPrivate) # We don't need any include paths or default module defines -set_target_properties(EntryPoint PROPERTIES +set_target_properties(EntryPointPrivate PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "" INTERFACE_COMPILE_DEFINITIONS "" ) @@ -70,28 +70,34 @@ if(WIN32) # The mingw32 library needs to come before the entry-point library in the # linker line, so that the static linker will pick up the WinMain symbol # from the entry-point library. - target_link_libraries(EntryPoint INTERFACE mingw32) - set_property(TARGET EntryPoint APPEND PROPERTY INTERFACE_QT_MODULE_LDFLAGS "-lmingw32") + target_link_libraries(EntryPointPrivate INTERFACE mingw32) + set_property(TARGET EntryPointPrivate + APPEND PROPERTY INTERFACE_QT_MODULE_LDFLAGS "-lmingw32" + ) - target_compile_definitions(EntryPoint INTERFACE QT_NEEDS_QMAIN) + target_compile_definitions(EntryPointPrivate INTERFACE QT_NEEDS_QMAIN) qt_internal_extend_target(EntryPointImplementation DEFINES QT_NEEDS_QMAIN) endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "iOS") - set_target_properties(EntryPoint PROPERTIES INTERFACE_LINK_OPTIONS "-Wl,-e,_qt_main_wrapper") - set_property(TARGET EntryPoint APPEND PROPERTY INTERFACE_QT_MODULE_LDFLAGS "-Wl,-e,_qt_main_wrapper") + set_target_properties(EntryPointPrivate PROPERTIES + INTERFACE_LINK_OPTIONS "-Wl,-e,_qt_main_wrapper" + ) + set_property(TARGET EntryPointPrivate + APPEND PROPERTY INTERFACE_QT_MODULE_LDFLAGS "-Wl,-e,_qt_main_wrapper" + ) endif() # ---- Finally, make sure the static library can be consumed by clients ----- if(using_entrypoint_library) - target_link_libraries(EntryPoint INTERFACE Qt6::EntryPointImplementation) + target_link_libraries(EntryPointPrivate INTERFACE Qt6::EntryPointImplementation) qt_internal_get_target_property(entrypoint_implementation_ldflags EntryPointImplementation QT_MODULE_LDFLAGS) - set_target_properties(EntryPoint PROPERTIES + set_target_properties(EntryPointPrivate PROPERTIES INTERFACE_QT_MODULE_PRI_EXTRA_CONTENT " QT.entrypoint_implementation.name = QtEntryPointImplementation QT.entrypoint_implementation.module = Qt6EntryPoint${QT_LIBINFIX} @@ -102,12 +108,12 @@ QT.entrypoint_implementation.module_config = staticlib v2 internal_module INTERFACE_QT_MODULE_DEPENDS "entrypoint_implementation" ) - set(export_name "${INSTALL_CMAKE_NAMESPACE}EntryPointTargets") + set(export_name "${INSTALL_CMAKE_NAMESPACE}EntryPointPrivateTargets") qt_install(TARGETS EntryPointImplementation EXPORT ${export_name}) qt_generate_prl_file(EntryPointImplementation "${INSTALL_LIBDIR}") endif() -set(export_name_prefix "${INSTALL_CMAKE_NAMESPACE}EntryPoint") +set(export_name_prefix "${INSTALL_CMAKE_NAMESPACE}EntryPointPrivate") qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${export_name_prefix}) qt_internal_export_additional_targets_file( TARGETS ${export_targets} |