@@ -16,43 +16,42 @@ add_library(${PLUGIN_NAME} SHARED
16
16
"amplify_db_common_plugin.cpp"
17
17
)
18
18
19
- ###
19
+ # ##
20
20
# Below here, keep in sync with: https://github.com/simolus3/sqlite3.dart/blob/main/sqlite3_flutter_libs/windows/CMakeLists.txt
21
- ###
21
+ # ##
22
22
23
- # Essentially, the idea of this build script is to compile a sqlite3.dll
24
- # and make Flutter bundle that with the final app.
25
- # It looks like we can't avoid building a sqlite3_flutter_libs.dll too,
26
- # but that's not on me.
27
-
28
- apply_standard_settings (${PLUGIN_NAME} )
29
- set_target_properties (${PLUGIN_NAME} PROPERTIES
30
- CXX_VISIBILITY_PRESET hidden )
31
- target_compile_definitions (${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL )
32
- target_include_directories (${PLUGIN_NAME} INTERFACE
33
- "${CMAKE_CURRENT_SOURCE_DIR} /include" )
34
- target_link_libraries (${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin )
23
+ # Only fetch and build sqlite3 if it hasn't been added yet
24
+ if (NOT TARGET sqlite3 )
25
+ # Essentially, the idea of this build script is to compile a sqlite3.dll
26
+ # and make Flutter bundle that with the final app.
27
+ # It looks like we can't avoid building a sqlite3_flutter_libs.dll too,
28
+ # but that's not on me.
29
+ apply_standard_settings (${PLUGIN_NAME} )
30
+ set_target_properties (${PLUGIN_NAME} PROPERTIES
31
+ CXX_VISIBILITY_PRESET hidden )
32
+ target_compile_definitions (${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL )
33
+ target_include_directories (${PLUGIN_NAME} INTERFACE
34
+ "${CMAKE_CURRENT_SOURCE_DIR} /include" )
35
+ target_link_libraries (${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin )
35
36
36
- include (FetchContent )
37
+ include (FetchContent )
37
38
38
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0" )
39
- # cmake 3.24.0 added the `DOWNLOAD_EXTRACT_TIMESTAMP` and prints an ugly warning when
40
- # the default is used, so override it to the recommended behavior.
41
- # We can't really ask users to use a cmake that recent, so there's this if here.
42
- FetchContent_Declare (
43
- sqlite3
44
- URL https://sqlite.org/2024/sqlite-autoconf-3460000.tar.gz
45
- DOWNLOAD_EXTRACT_TIMESTAMP NEW
46
- )
47
- else ()
48
- FetchContent_Declare (
49
- sqlite3
50
- URL https://sqlite.org/2024/sqlite-autoconf-3460000.tar.gz
51
- )
52
- endif ()
39
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0" )
40
+ # cmake 3.24.0 added the `DOWNLOAD_EXTRACT_TIMESTAMP` and prints an ugly warning when
41
+ # the default is used, so override it to the recommended behavior.
42
+ # We can't really ask users to use a cmake that recent, so there's this if here.
43
+ FetchContent_Declare (
44
+ sqlite3
45
+ URL https://sqlite.org/2024/sqlite-autoconf-3460000.tar.gz
46
+ DOWNLOAD_EXTRACT_TIMESTAMP NEW
47
+ )
48
+ else ()
49
+ FetchContent_Declare (
50
+ sqlite3
51
+ URL https://sqlite.org/2024/sqlite-autoconf-3460000.tar.gz
52
+ )
53
+ endif ()
53
54
54
- # Only fetch and build sqlite3 if it hasn't been added yet
55
- if (NOT TARGET sqlite3 )
56
55
FetchContent_MakeAvailable (sqlite3 )
57
56
58
57
add_library (sqlite3 SHARED "sqlite3_flutter.c" )
0 commit comments