Unverified Commit 27e652c8 authored by stuartmorgan's avatar stuartmorgan Committed by GitHub

Fix Linux plugin template build visibility (#58069)

The CMake plugin build wasn't setting visibility to hidden by default,
which meant that plugins exported everything by default. This would make
bad interactions between plugins much more likely; only the intended API
should be exported by the shared library.
parent 8b63c654
......@@ -3,6 +3,8 @@ project(runner LANGUAGES CXX)
set(BINARY_NAME "{{projectName}}")
cmake_policy(SET CMP0063 NEW)
set(CMAKE_INSTALL_RPATH "\$ORIGIN")
# Configure build options.
......
......@@ -65,6 +65,8 @@ add_library(flutter_wrapper_plugin STATIC
apply_standard_settings(flutter_wrapper_plugin)
set_target_properties(flutter_wrapper_plugin PROPERTIES
POSITION_INDEPENDENT_CODE ON)
set_target_properties(flutter_wrapper_plugin PROPERTIES
CXX_VISIBILITY_PRESET hidden)
target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
target_include_directories(flutter_wrapper_plugin PUBLIC
"${WRAPPER_ROOT}/include"
......
......@@ -8,6 +8,9 @@ add_library(${PLUGIN_NAME} SHARED
"${PLUGIN_NAME}.cc"
)
apply_standard_settings(${PLUGIN_NAME})
set_target_properties(${PLUGIN_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden)
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
target_include_directories(${PLUGIN_NAME} INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment