build monero-java on windows using --export-all-symbols

combine build script
This commit is contained in:
woodser
2023-04-02 16:08:29 -04:00
parent c1ddd1c4d7
commit 8d97dea0b2
5 changed files with 24 additions and 17 deletions
+4
View File
@@ -335,6 +335,10 @@ if (BUILD_LIBRARY)
${EXTRA_LIBRARIES}
)
if (WIN32)
target_link_options(monero-cpp PUBLIC "-Wl,--enable-auto-import,--export-all-symbols")
endif()
INSTALL(FILES src/daemon/monero_daemon.h
src/daemon/monero_daemon_model.h
DESTINATION include/daemon)
+4 -4
View File
@@ -211,19 +211,19 @@ For example, [monero-java](https://github.com/monero-ecosystem/monero-java) comp
1. Download and install [MSYS2](https://www.msys2.org/).
2. Press the Windows button and launch `MSYS2 MINGW64` for 64 bit systems or `MSYS2 MINGW32` for 32 bit.
3. Update packages: `pacman -Syu` and `pacman -Syy`
3. Update packages: `pacman -Syu` and confirm at prompts.
4. Relaunch MSYS2 (if necessary) and install dependencies:
For 64 bit:
```
pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-unbound mingw-w64-x86_64-protobuf git mingw-w64-x86_64-libusb make gettext base-devel
pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-unbound mingw-w64-x86_64-protobuf git mingw-w64-x86_64-libusb gettext base-devel
```
For 32 bit:
```
pacman -S mingw-w64-i686-toolchain make mingw-w64-i686-cmake mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-zeromq mingw-w64-i686-libsodium mingw-w64-i686-hidapi mingw-w64-i686-unbound mingw-w64-i686-protobuf git mingw-w64-i686-libusb make gettext base-devel
pacman -S mingw-w64-i686-toolchain make mingw-w64-i686-cmake mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-zeromq mingw-w64-i686-libsodium mingw-w64-i686-hidapi mingw-w64-i686-unbound mingw-w64-i686-protobuf git mingw-w64-i686-libusb gettext base-devel
```
5. Clone repo if installing standalone (skip if building as part of another repo like monero-java or monero-javascript): `git clone --recursive https://github.com/monero-ecosystem/monero-cpp.git`
6. Update submodules: `cd <path/to/monero-cpp> && ./bin/update_submodules.sh`
@@ -233,7 +233,7 @@ For example, [monero-java](https://github.com/monero-ecosystem/monero-java) comp
For 64 bit: `make release-static-win64`
For 32 bit: `make release-static-win32`
10. Build as a shared library in ./build/: `cd ../../ && ./bin/build_libmonero_cpp_dll.sh`
10. Build as a shared library to ./build/: `cd ../../ && ./bin/build_libmonero_cpp.sh`
## Related projects
+15 -2
View File
@@ -1,10 +1,23 @@
#!/bin/sh
# build monero-project dependencies
HOST_NCORES=$(nproc 2>/dev/null || shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
cd ./external/monero-project/ || exit 1
git submodule update --init --force || exit 1
make release-static -j$HOST_NCORES || exit 1
HOST_NCORES=$(nproc 2>/dev/null || shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
if [[ "$OSTYPE" == "msys" ]]; then
bit=$(getconf LONG_BIT)
if [ "$bit" == "64" ]; then
make release-static-win64 -j$HOST_NCORES || exit 1
else
make release-static-win32 -j$HOST_NCORES || exit 1
fi
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "monero-project supports building on Windows only with MSYS"
exit 1
else
# OS is not windows
make release-static -j$HOST_NCORES || exit 1
fi
cd ../../
# build libmonero-cpp shared library
-10
View File
@@ -1,10 +0,0 @@
#!/bin/sh
HOST_NCORES=$(nproc 2>/dev/null || shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
# build libmonero-cpp shared library
mkdir -p build &&
cd build &&
cmake .. &&
cmake --build . &&
make .
+1 -1
View File
@@ -693,7 +693,7 @@ namespace monero {
* Set a subaddress label.
*
* @param account_idx index of the account to set the label for
* @param subaddressIdx index of the subaddress to set the label for
* @param subaddress_idx index of the subaddress to set the label for
* @param label the label to set
*/
virtual void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string& label = "") {