Skip to content

Commit befc178

Browse files
Flutter plugins: add notes, CMake min 3.10 for Linux, 3.14 for Windows.
1 parent 7ccc9d9 commit befc178

File tree

4 files changed

+101
-9
lines changed

4 files changed

+101
-9
lines changed

flutter_libs/linux/CMakeLists.txt

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,53 @@
1-
cmake_minimum_required(VERSION 3.11)
1+
# The Flutter tooling requires that developers have CMake 3.10 or later
2+
# installed. You should not increase this version, as doing so will cause
3+
# the plugin to fail to compile for some customers of the plugin.
4+
cmake_minimum_required(VERSION 3.10)
5+
6+
# Project-level configuration.
27
set(PROJECT_NAME "objectbox_flutter_libs")
38
project(${PROJECT_NAME} LANGUAGES CXX)
49

510
# This value is used when generating builds using this plugin, so it must
6-
# not be changed
11+
# not be changed.
712
set(PLUGIN_NAME "objectbox_flutter_libs_plugin")
813

14+
# Define the plugin library target. Its name must not be changed (see comment
15+
# on PLUGIN_NAME above).
16+
#
17+
# Any new source files that you add to the plugin should be added here.
918
add_library(${PLUGIN_NAME} SHARED
1019
"objectbox_flutter_libs_plugin.cc"
1120
)
21+
22+
# Apply a standard set of build settings that are configured in the
23+
# application-level CMakeLists.txt. This can be removed for plugins that want
24+
# full control over build settings.
1225
apply_standard_settings(${PLUGIN_NAME})
26+
27+
# Symbols are hidden by default to reduce the chance of accidental conflicts
28+
# between plugins. This should not be removed; any symbols that should be
29+
# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro.
1330
set_target_properties(${PLUGIN_NAME} PROPERTIES
1431
CXX_VISIBILITY_PRESET hidden)
1532
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
33+
34+
# Source include directories and library dependencies. Add any plugin-specific
35+
# dependencies here.
1636
target_include_directories(${PLUGIN_NAME} INTERFACE
1737
"${CMAKE_CURRENT_SOURCE_DIR}/include")
1838
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
1939
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
2040

21-
# List of absolute paths to libraries that should be bundled with the plugin
41+
# List of absolute paths to libraries that should be bundled with the plugin.
42+
# This list could contain prebuilt libraries, or libraries created by an
43+
# external build triggered from this build file.
2244
set(objectbox_flutter_libs_bundled_libraries
2345
""
2446
PARENT_SCOPE
2547
)
2648

2749
# ----------------------------------------------------------------------
50+
# Download and add objectbox-c prebuilt library.
2851

2952
set(OBJECTBOX_VERSION 0.18.0)
3053

@@ -48,6 +71,7 @@ if(NOT objectbox-download_POPULATED)
4871
FetchContent_Populate(objectbox-download)
4972
endif()
5073

74+
# Bundle library with Flutter plugin, see template above.
5175
set(objectbox_flutter_libs_bundled_libraries
5276
"${objectbox-download_SOURCE_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX}"
5377
PARENT_SCOPE

flutter_libs/windows/CMakeLists.txt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,51 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
# The Flutter tooling requires that developers have a version of Visual Studio
2+
# installed that includes CMake 3.14 or later. You should not increase this
3+
# version, as doing so will cause the plugin to fail to compile for some
4+
# customers of the plugin.
5+
cmake_minimum_required(VERSION 3.14)
6+
7+
# Project-level configuration.
28
set(PROJECT_NAME "objectbox_flutter_libs")
39
project(${PROJECT_NAME} LANGUAGES CXX)
410

511
# This value is used when generating builds using this plugin, so it must
612
# not be changed
713
set(PLUGIN_NAME "objectbox_flutter_libs_plugin")
814

15+
# Define the plugin library target. Its name must not be changed (see comment
16+
# on PLUGIN_NAME above).
917
add_library(${PLUGIN_NAME} SHARED
1018
"objectbox_flutter_libs_plugin.cpp"
1119
)
20+
21+
# Apply a standard set of build settings that are configured in the
22+
# application-level CMakeLists.txt. This can be removed for plugins that want
23+
# full control over build settings.
1224
apply_standard_settings(${PLUGIN_NAME})
25+
26+
# Symbols are hidden by default to reduce the chance of accidental conflicts
27+
# between plugins. This should not be removed; any symbols that should be
28+
# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro.
1329
set_target_properties(${PLUGIN_NAME} PROPERTIES
1430
CXX_VISIBILITY_PRESET hidden)
1531
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
32+
33+
# Source include directories and library dependencies. Add any plugin-specific
34+
# dependencies here.
1635
target_include_directories(${PLUGIN_NAME} INTERFACE
1736
"${CMAKE_CURRENT_SOURCE_DIR}/include")
1837
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin)
1938

20-
# List of absolute paths to libraries that should be bundled with the plugin
39+
# List of absolute paths to libraries that should be bundled with the plugin.
40+
# This list could contain prebuilt libraries, or libraries created by an
41+
# external build triggered from this build file.
2142
set(objectbox_flutter_libs_bundled_libraries
2243
""
2344
PARENT_SCOPE
2445
)
2546

2647
# ----------------------------------------------------------------------
48+
# Download and add objectbox-c prebuilt library.
2749

2850
set(OBJECTBOX_VERSION 0.18.0)
2951

sync_flutter_libs/linux/CMakeLists.txt

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,53 @@
1+
# The Flutter tooling requires that developers have CMake 3.10 or later
2+
# installed. You should not increase this version, as doing so will cause
3+
# the plugin to fail to compile for some customers of the plugin.
14
cmake_minimum_required(VERSION 3.10)
5+
6+
# Project-level configuration.
27
set(PROJECT_NAME "objectbox_sync_flutter_libs")
38
project(${PROJECT_NAME} LANGUAGES CXX)
49

510
# This value is used when generating builds using this plugin, so it must
6-
# not be changed
11+
# not be changed.
712
set(PLUGIN_NAME "objectbox_sync_flutter_libs_plugin")
813

14+
# Define the plugin library target. Its name must not be changed (see comment
15+
# on PLUGIN_NAME above).
16+
#
17+
# Any new source files that you add to the plugin should be added here.
918
add_library(${PLUGIN_NAME} SHARED
1019
"objectbox_sync_flutter_libs_plugin.cc"
1120
)
21+
22+
# Apply a standard set of build settings that are configured in the
23+
# application-level CMakeLists.txt. This can be removed for plugins that want
24+
# full control over build settings.
1225
apply_standard_settings(${PLUGIN_NAME})
26+
27+
# Symbols are hidden by default to reduce the chance of accidental conflicts
28+
# between plugins. This should not be removed; any symbols that should be
29+
# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro.
1330
set_target_properties(${PLUGIN_NAME} PROPERTIES
1431
CXX_VISIBILITY_PRESET hidden)
1532
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
33+
34+
# Source include directories and library dependencies. Add any plugin-specific
35+
# dependencies here.
1636
target_include_directories(${PLUGIN_NAME} INTERFACE
1737
"${CMAKE_CURRENT_SOURCE_DIR}/include")
1838
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
1939
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
2040

21-
# List of absolute paths to libraries that should be bundled with the plugin
41+
# List of absolute paths to libraries that should be bundled with the plugin.
42+
# This list could contain prebuilt libraries, or libraries created by an
43+
# external build triggered from this build file.
2244
set(objectbox_sync_flutter_libs_bundled_libraries
2345
""
2446
PARENT_SCOPE
2547
)
2648

2749
# ----------------------------------------------------------------------
50+
# Download and add objectbox-c prebuilt library.
2851

2952
set(OBJECTBOX_VERSION 0.18.0)
3053

@@ -48,6 +71,7 @@ if(NOT objectbox-download_POPULATED)
4871
FetchContent_Populate(objectbox-download)
4972
endif()
5073

74+
# Bundle library with Flutter plugin, see template above.
5175
set(objectbox_sync_flutter_libs_bundled_libraries
5276
"${objectbox-download_SOURCE_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX}"
5377
PARENT_SCOPE

sync_flutter_libs/windows/CMakeLists.txt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,51 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
# The Flutter tooling requires that developers have a version of Visual Studio
2+
# installed that includes CMake 3.14 or later. You should not increase this
3+
# version, as doing so will cause the plugin to fail to compile for some
4+
# customers of the plugin.
5+
cmake_minimum_required(VERSION 3.14)
6+
7+
# Project-level configuration.
28
set(PROJECT_NAME "objectbox_sync_flutter_libs")
39
project(${PROJECT_NAME} LANGUAGES CXX)
410

511
# This value is used when generating builds using this plugin, so it must
612
# not be changed
713
set(PLUGIN_NAME "objectbox_sync_flutter_libs_plugin")
814

15+
# Define the plugin library target. Its name must not be changed (see comment
16+
# on PLUGIN_NAME above).
917
add_library(${PLUGIN_NAME} SHARED
1018
"objectbox_sync_flutter_libs_plugin.cpp"
1119
)
20+
21+
# Apply a standard set of build settings that are configured in the
22+
# application-level CMakeLists.txt. This can be removed for plugins that want
23+
# full control over build settings.
1224
apply_standard_settings(${PLUGIN_NAME})
25+
26+
# Symbols are hidden by default to reduce the chance of accidental conflicts
27+
# between plugins. This should not be removed; any symbols that should be
28+
# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro.
1329
set_target_properties(${PLUGIN_NAME} PROPERTIES
1430
CXX_VISIBILITY_PRESET hidden)
1531
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
32+
33+
# Source include directories and library dependencies. Add any plugin-specific
34+
# dependencies here.
1635
target_include_directories(${PLUGIN_NAME} INTERFACE
1736
"${CMAKE_CURRENT_SOURCE_DIR}/include")
1837
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin)
1938

20-
# List of absolute paths to libraries that should be bundled with the plugin
39+
# List of absolute paths to libraries that should be bundled with the plugin.
40+
# This list could contain prebuilt libraries, or libraries created by an
41+
# external build triggered from this build file.
2142
set(objectbox_sync_flutter_libs_bundled_libraries
2243
""
2344
PARENT_SCOPE
2445
)
2546

2647
# ----------------------------------------------------------------------
48+
# Download and add objectbox-c prebuilt library.
2749

2850
set(OBJECTBOX_VERSION 0.18.0)
2951

0 commit comments

Comments
 (0)