Skip to content

Commit cc6ba9d

Browse files
committed
clean up comments
1 parent 3b9cc90 commit cc6ba9d

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

packages/common/amplify_db_common/windows/CMakeLists.txt

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ add_library(${PLUGIN_NAME} SHARED
1616
"amplify_db_common_plugin.cpp"
1717
)
1818

19-
###
19+
# ##
2020
# Below here, keep in sync with: https://github.com/simolus3/sqlite3.dart/blob/main/sqlite3_flutter_libs/windows/CMakeLists.txt
21-
###
21+
# ##
2222

2323
# Essentially, the idea of this build script is to compile a sqlite3.dll
2424
# and make Fluter bundle that with the final app.
2525
# It looks like we can't avoid building a sqlite3_flutter_libs.dll too,
2626
# but that's not on me.
27-
2827
apply_standard_settings(${PLUGIN_NAME})
2928
set_target_properties(${PLUGIN_NAME} PROPERTIES
3029
CXX_VISIBILITY_PRESET hidden)
@@ -33,12 +32,14 @@ target_include_directories(${PLUGIN_NAME} INTERFACE
3332
"${CMAKE_CURRENT_SOURCE_DIR}/include")
3433
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin)
3534

36-
# Include FetchContent for sqlite3 if not already available.
3735
include(FetchContent)
3836

3937
# Only add the sqlite3 library if it hasn't been defined already.
40-
if (NOT TARGET sqlite3)
41-
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
38+
if(NOT TARGET sqlite3)
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.
4243
FetchContent_Declare(
4344
sqlite3
4445
URL https://sqlite.org/2023/sqlite-autoconf-3430000.tar.gz
@@ -55,8 +56,7 @@ if (NOT TARGET sqlite3)
5556

5657
# Define the sqlite3 library only if it wasn't already defined.
5758
add_library(sqlite3 SHARED "sqlite3_flutter.c")
58-
59-
# Configure sqlite3 compilation options.
59+
6060
target_include_directories(sqlite3 PRIVATE "${sqlite3_SOURCE_DIR}")
6161
target_compile_options(sqlite3 PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O2>" "/w")
6262

@@ -83,18 +83,16 @@ if (NOT TARGET sqlite3)
8383
SQLITE_HAVE_LOCALTIME_R
8484
SQLITE_HAVE_LOCALTIME_S
8585
)
86-
87-
# Create an alias for this version of sqlite3 for your plugin's use.
86+
87+
# Create an alias for this version of sqlite3.
8888
add_library(sqlite3_amplify_db_common ALIAS sqlite3)
8989
else()
90-
# If sqlite3 already exists, create an alias for your plugin to avoid duplication.
90+
# If sqlite3 already exists, create an alias for amplify plugin to avoid duplication.
9191
add_library(sqlite3_amplify_db_common ALIAS sqlite3)
9292
endif()
9393

94-
# Link your plugin to the sqlite3 alias.
9594
target_link_libraries(${PLUGIN_NAME} PRIVATE sqlite3_amplify_db_common)
9695

97-
# Ensure sqlite3 actually gets built.
9896
add_dependencies(${PLUGIN_NAME} sqlite3_amplify_db_common)
9997

10098
# List of absolute paths to libraries that should be bundled with the plugin.

0 commit comments

Comments
 (0)