summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-04-22 14:59:35 -0700
committerThiago Macieira <thiago.macieira@intel.com>2022-05-19 23:00:35 -0700
commit6ed4b9e4eafd81358fd86a112183561ce1572df4 (patch)
treec737f165a006b388e604295e0827bf31c0a17219
parent7932b2acbb85b516114a4062715fc23651c9bdbf (diff)
CMake: use the --build-macro option to qtwaylandscanner
So we get correct exports different from imports, which are required for GCC 12 with -mno-direct-extern-access and protected visibility. Change-Id: If05aeeb7176e4f13af9afffd16e856de1f4f68d6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--src/client/Qt6WaylandClientMacros.cmake18
-rw-r--r--src/compositor/Qt6WaylandCompositorMacros.cmake17
2 files changed, 31 insertions, 4 deletions
diff --git a/src/client/Qt6WaylandClientMacros.cmake b/src/client/Qt6WaylandClientMacros.cmake
index 568c33494..1f2dd272d 100644
--- a/src/client/Qt6WaylandClientMacros.cmake
+++ b/src/client/Qt6WaylandClientMacros.cmake
@@ -14,6 +14,11 @@ function(qt6_generate_wayland_protocol_client_sources target)
message(FATAL_ERROR "qtwaylandscanner executable not found. Most likely there is an issue with your Qt installation.")
endif()
+ string(TOUPPER "${target}" module_define_infix)
+ string(REPLACE "-" "_" module_define_infix "${module_define_infix}")
+ string(REPLACE "." "_" module_define_infix "${module_define_infix}")
+ set(build_macro "QT_BUILD_${module_define_infix}_LIB")
+
foreach(protocol_file IN LISTS arg_FILES)
get_filename_component(protocol_name "${protocol_file}" NAME_WLE)
@@ -49,7 +54,11 @@ function(qt6_generate_wayland_protocol_client_sources target)
add_custom_command(
OUTPUT "${qtwaylandscanner_header_output}"
- COMMAND Qt6::qtwaylandscanner client-header "${protocol_file}" "${wayland_include_dir}" > "${qtwaylandscanner_header_output}"
+ COMMAND Qt6::qtwaylandscanner client-header
+ "${protocol_file}"
+ --build-macro=${build_macro}
+ --header-path="${wayland_include_dir}"
+ > "${qtwaylandscanner_header_output}"
DEPENDS ${protocol_file} Qt6::qtwaylandscanner
)
@@ -60,7 +69,12 @@ function(qt6_generate_wayland_protocol_client_sources target)
add_custom_command(
OUTPUT "${qtwaylandscanner_code_output}"
- COMMAND Qt6::qtwaylandscanner client-code "${protocol_file}" --header-path='${wayland_include_dir}' --add-include='${qtwaylandscanner_code_include}' > "${qtwaylandscanner_code_output}"
+ COMMAND Qt6::qtwaylandscanner client-code
+ "${protocol_file}"
+ --build-macro=${build_macro}
+ --header-path='${wayland_include_dir}'
+ --add-include='${qtwaylandscanner_code_include}'
+ > "${qtwaylandscanner_code_output}"
DEPENDS ${protocol_file} Qt6::qtwaylandscanner
)
diff --git a/src/compositor/Qt6WaylandCompositorMacros.cmake b/src/compositor/Qt6WaylandCompositorMacros.cmake
index 92ad04696..91d0d2830 100644
--- a/src/compositor/Qt6WaylandCompositorMacros.cmake
+++ b/src/compositor/Qt6WaylandCompositorMacros.cmake
@@ -14,6 +14,11 @@ function(qt6_generate_wayland_protocol_server_sources target)
message(FATAL_ERROR "qtwaylandscanner executable not found. Most likely there is an issue with your Qt installation.")
endif()
+ string(TOUPPER "${target}" module_define_infix)
+ string(REPLACE "-" "_" module_define_infix "${module_define_infix}")
+ string(REPLACE "." "_" module_define_infix "${module_define_infix}")
+ set(build_macro "QT_BUILD_${module_define_infix}_LIB")
+
foreach(protocol_file IN LISTS arg_FILES)
get_filename_component(protocol_name "${protocol_file}" NAME_WLE)
@@ -47,12 +52,20 @@ function(qt6_generate_wayland_protocol_server_sources target)
add_custom_command(
OUTPUT "${qtwaylandscanner_header_output}"
- COMMAND Qt6::qtwaylandscanner server-header "${protocol_file}" "${wayland_include_dir}" > "${qtwaylandscanner_header_output}"
+ COMMAND Qt6::qtwaylandscanner server-header
+ "${protocol_file}"
+ --build-macro=${build_macro}
+ --header-path='${wayland_include_dir}'
+ > "${qtwaylandscanner_header_output}"
)
add_custom_command(
OUTPUT "${qtwaylandscanner_code_output}"
- COMMAND Qt6::qtwaylandscanner server-code "${protocol_file}" "${wayland_include_dir}" > "${qtwaylandscanner_code_output}"
+ COMMAND Qt6::qtwaylandscanner server-code
+ "${protocol_file}"
+ --build-macro=${build_macro}
+ --header-path='${wayland_include_dir}'
+ > "${qtwaylandscanner_code_output}"
)
target_sources(${target} PRIVATE