-
Notifications
You must be signed in to change notification settings - Fork 136
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
Enable and fix for windows build by cmake project file #462
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,3 +100,6 @@ wallycore.wasm | |
*.pdb | ||
*.ilk | ||
*.exp | ||
|
||
.idea | ||
cmake-build-* | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ option(WALLYCORE_INSTALL "Enable install" OFF) | |
option(WALLYCORE_COVERAGE "Enable coverage" OFF) | ||
option(WALLYCORE_BUILD_ELEMENTS "Build elements" ON) | ||
|
||
if (NOT BUILD_SHARED_LIBS) | ||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
endif() | ||
|
||
include(cmake/utils.cmake) | ||
generate_config_file() | ||
configure_file(src/ccan_config.h ccan_config.h COPYONLY) | ||
|
@@ -23,15 +27,15 @@ set(SECP256K1_ENABLE_MODULE_ECDH ON) | |
set(SECP256K1_ENABLE_MODULE_RECOVERY ON) | ||
set(SECP256K1_ENABLE_MODULE_EXTRAKEYS ON) | ||
set(SECP256K1_ENABLE_MODULE_SCHNORRSIG ON) | ||
set(SECP256K1_ENABLE_MODULE_ELLSWIFT OFF) | ||
set(SECP256K1_ENABLE_MODULE_ELLSWIFT ON) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The enabled modules here should match the ones set by |
||
set(SECP256K1_ENABLE_MODULE_GENERATOR ON) | ||
set(SECP256K1_ENABLE_MODULE_RANGEPROOF ON) | ||
set(SECP256K1_ENABLE_MODULE_SURJECTIONPROOF ON) | ||
set(SECP256K1_ENABLE_MODULE_WHITELIST ON) | ||
set(SECP256K1_ENABLE_MODULE_MUSIG OFF) | ||
set(SECP256K1_ENABLE_MODULE_ECDSA_ADAPTOR OFF) | ||
set(SECP256K1_ENABLE_MODULE_MUSIG ON) | ||
set(SECP256K1_ENABLE_MODULE_ECDSA_ADAPTOR ON) | ||
set(SECP256K1_ENABLE_MODULE_ECDSA_S2C ON) | ||
set(SECP256K1_ENABLE_MODULE_BPPP OFF) | ||
set(SECP256K1_ENABLE_MODULE_BPPP ON) | ||
set(SECP256K1_BUILD_BENCHMARK OFF) | ||
set(SECP256K1_BUILD_TESTS OFF) | ||
set(SECP256K1_BUILD_EXHAUSTIVE_TESTS OFF) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,11 @@ | |
# endif | ||
#endif | ||
|
||
#ifdef _WIN32 | ||
#if (!defined(_SSIZE_T_DECLARED)) && (!defined(_ssize_t)) && (!defined(ssize_t)) | ||
#define ssize_t long long | ||
#endif | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've PR'd a different fix for this in #469 |
||
|
||
#include "ccan_config.h" | ||
#endif /*LIBWALLYCORE_CONFIG_H*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ file( | |
) | ||
|
||
# wallycore | ||
add_library(wallycore) | ||
add_library(wallycore STATIC) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wally can (or should be able to be) build as a DLL for windows too. |
||
target_sources(wallycore PRIVATE ${ccan_srcs} ${wallycore_srcs}) | ||
set_target_properties(wallycore PROPERTIES PUBLIC_HEADER "${wallycore_public_headers}") | ||
target_include_directories( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,9 @@ | |
#include <stdarg.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
#ifndef _WIN32 | ||
#include <unistd.h> | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is not compiled when building, so I don't think this change is needed. |
||
#include "tap.h" | ||
|
||
static int no_plan = 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,12 @@ target_include_directories(test_bech32 PRIVATE ${CMAKE_BINARY_DIR}) | |
target_link_libraries(test_bech32 PRIVATE wallycore) | ||
add_test(test_bech32 test_bech32) | ||
|
||
add_executable(test_clear test_clear.c) | ||
target_include_directories(test_clear PRIVATE ${CMAKE_BINARY_DIR}) | ||
target_link_libraries(test_clear PRIVATE wallycore pthread) | ||
add_test(test_clear test_clear) | ||
if(NOT WIN32) | ||
add_executable(test_clear test_clear.c) | ||
target_include_directories(test_clear PRIVATE ${CMAKE_BINARY_DIR}) | ||
target_link_libraries(test_clear PRIVATE wallycore pthread) | ||
add_test(test_clear test_clear) | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added to #469 |
||
|
||
add_executable(test_coinselection test_coinselection.c) | ||
target_include_directories(test_coinselection PRIVATE ${CMAKE_BINARY_DIR}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.idea
is already in this file, and cmake build directories should be placed outside the repo rather than listed here.