Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Windows Support for v2.0 #25

Merged
merged 22 commits into from
Feb 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use find_file to find secp256k1.dll
* use find_file to find secp256k1.dll

because in testing we found that CMAKE_BINARY_DIR is usually app/build/windows/x64, but some Windows hosts use app/build/windows.  This should support both
force pushed to fix a small typo.

* remove explicit references to secp256k1.dll

* formatting

limit lines to 180 characters, align comments
sneurlax authored Jan 18, 2024
commit 1eadf99b609b7e4f4ef4e9b8e467a93f6fa2b8f4
45 changes: 34 additions & 11 deletions coinlib_flutter/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -11,16 +11,39 @@ project(${PROJECT_NAME} LANGUAGES CXX)
# Invoke the build for native code shared with the other target platforms.
# This can be changed to accommodate different builds.
# add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DIR}/shared")
# TODO re-enable the above line if/when the CMake process is made Windows-compatible. See also below.
# TODO re-enable the above line if/when the CMake process is made Windows-compatible.
# See also below.

# List of absolute paths to libraries that should be bundled with the plugin.
# This list could contain prebuilt libraries, or libraries created by an
# external build triggered from this build file.
set(coinlib_flutter_bundled_libraries
# Defined in ../src/CMakeLists.txt.
# This can be changed to accommodate different builds.
# $<TARGET_FILE:coinlib_flutter>
# TODO re-enable the above line if/when the CMake process is made Windows-compatible. See also above.
${CMAKE_BINARY_DIR}/../../secp256k1.dll
PARENT_SCOPE
# Search for secp256k1.dll in multiple possible directories.
#
# This is only necessary because in testing we have found that most Windows hosts
# have CMAKE_BINARY_DIR = app/build/windows/x64, but some use app/build/windows.
# This should search through its multiple possible locations.
find_file(SECP256K1_DLL
NAMES secp256k1.dll
PATHS
"${CMAKE_BINARY_DIR}/../" # Check one level up.
"${CMAKE_BINARY_DIR}/../../" # Check two levels up.
"${CMAKE_BINARY_DIR}/../../../" # Used for the example app.
"${CMAKE_SOURCE_DIR}/../build"
"${CMAKE_SOURCE_DIR}/../../build" # Works for the example app.
NO_DEFAULT_PATH
)

# Check if SECP256K1_DLL was found
if (SECP256K1_DLL)
# List of absolute paths to libraries that should be bundled with the plugin.
# This list could contain prebuilt libraries, or libraries created by an
# external build triggered from this build file.
set(coinlib_flutter_bundled_libraries
# Defined in ../src/CMakeLists.txt.
# This can be changed to accommodate different builds.
# $<TARGET_FILE:coinlib_flutter>
# TODO re-enable if/when the CMake process is made Windows-compatible.
# See also above.
${SECP256K1_DLL}
PARENT_SCOPE
)
else ()
message(FATAL_ERROR "Could not find secp256k1.dll.")
endif ()