Fix builds for Windows

This commit is contained in:
dsc 2022-05-04 18:18:30 +02:00
parent d332121d7c
commit f83ceb2a96
7 changed files with 40 additions and 19 deletions

View file

@ -142,18 +142,12 @@ endif()
if(MINGW)
set(Boost_THREADAPI win32)
endif()
find_package(Boost 1.58 REQUIRED COMPONENTS
system
filesystem
thread
atomic
date_time
chrono
regex
serialization
program_options
locale)
set(_BOOST_COMPONENTS system filesystem thread date_time chrono regex serialization program_options locale)
if(APPLE)
# atomic is only present/needed on Apple
list(APPEND _BOOST_COMPONENTS atomic)
endif()
find_package(Boost 1.58 REQUIRED COMPONENTS ${_BOOST_COMPONENTS})
if(UNIX AND NOT APPLE AND NOT ANDROID)
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
@ -221,7 +215,7 @@ if(TOR_BIN)
endif()
# copy the Tor executable over
set(TOR_COPY_CMD "cp -u ${TOR_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/tor")
set(TOR_COPY_CMD "cp ${TOR_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/tor")
message(STATUS "Tor cmd: ${TOR_COPY_CMD}")
execute_process(COMMAND bash -c "${TOR_COPY_CMD}" RESULT_VARIABLE ret)
@ -232,9 +226,11 @@ if(TOR_BIN)
endif()
# get Tor version while we're at it
execute_process(COMMAND bash -c "${TOR_BIN} --version --quiet | head -n1" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE out RESULT_VARIABLE ret)
if (ret EQUAL "0")
set(TOR_VERSION "${out}")
if(NOT TOR_VERSION)
execute_process(COMMAND bash -c "${TOR_BIN} --version --quiet | head -n1" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE out RESULT_VARIABLE ret)
if (ret EQUAL "0")
set(TOR_VERSION "${out}")
endif()
endif()
message(STATUS "Tor version: ${TOR_VERSION}")
configure_file("cmake/config-wowlet.h.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/src/config-wowlet.h")
@ -245,6 +241,8 @@ else()
endif()
if(MINGW)
find_package(Iconv REQUIRED)
string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}")
message(STATUS "MSYS location: ${msys2_install_path}")
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")

View file

@ -415,3 +415,5 @@ RUN mkdir linuxdeployqt && \
chmod +x linuxdeployqt-7-x86_64.AppImage && \
./linuxdeployqt-7-x86_64.AppImage --appimage-extract && \
rm linuxdeployqt-7-x86_64.AppImage
RUN git config --global --add safe.directory /wowlet

View file

@ -237,7 +237,6 @@ CMD set -ex \
-DUSE_SINGLE_BUILDDIR=ON \
-DMANUAL_SUBMODULES=1 \
-DUSE_SINGLE_BUILDDIR=ON \
-DQML=ON \
-DANDROID=ON \
../../.. \
&& PATH=${HOST_PATH} make generate_translations_header \

View file

@ -6,6 +6,7 @@ ENV SOURCE_DATE_EPOCH=1397818193
ENV OPENSSL_ROOT_DIR=/usr/local/openssl/
ENV TOR_BIN=/usr/local/tor/bin/tor.exe
ENV TOR_VERSION='tor-0.4.5.7'
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y curl nano wget zip automake build-essential cmake gcc-mingw-w64 g++-mingw-w64 gettext git libtool pkg-config \
@ -184,3 +185,4 @@ RUN git clone https://git.wownero.com/wowlet/monero-seed.git && \
make -Cbuild install && \
rm -rf $(pwd)
RUN git config --global --add safe.directory /wowlet

View file

@ -54,7 +54,7 @@ depends:
windows:
mkdir -p build/$(target)/release
cd build/$(target)/release && cmake -D STATIC=ON -DZLIB_ROOT=/usr/x86_64-w64-mingw32/ -DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH},OFF) -DTOR_VERSION=$(or ${TOR_VERSION}, OFF) -DOPENVR=ON -DQML=ON -DWITH_SCANNER=ON -DTOR_BIN=$(or ${TOR_BIN},OFF) -D DEV_MODE=$(or ${DEV_MODE},OFF) -D BUILD_TAG=$(tag) -D CMAKE_BUILD_TYPE=Debug -D CMAKE_TOOLCHAIN_FILE=$(root)/$(target)/share/toolchain.cmake ../../.. && $(MAKE)
cd build/$(target)/release && cmake -D STATIC=ON -DZLIB_ROOT=/usr/x86_64-w64-mingw32/ -DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH},OFF) -DTOR_VERSION=$(or ${TOR_VERSION}, OFF) -DOPENVR=ON -DWITH_SCANNER=ON -DTOR_BIN=$(or ${TOR_BIN},OFF) -D DEV_MODE=$(or ${DEV_MODE},OFF) -D BUILD_TAG=$(tag) -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$(root)/$(target)/share/toolchain.cmake ../../.. && $(MAKE)
windows-mxe-release: CMAKEFLAGS += -DBUILD_TAG="win-x64"

View file

@ -141,6 +141,7 @@ target_include_directories(wowlet PUBLIC
${X11_INCLUDE_DIR}
${QRENCODE_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${Iconv_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
@ -237,6 +238,7 @@ target_link_libraries(wowlet PUBLIC
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${CMAKE_DL_LIBS}
${Iconv_LIBRARIES}
${EXTRA_LIBRARIES})
# Link Qt libraries
@ -365,3 +367,20 @@ message(STATUS "[+] Include Valve's OpenVR library: ${OPENVR}")
message(STATUS "[+] This build is for Android: ${ANDROID}")
message(STATUS "[+] This build is for testing the Android app on desktop: ${ANDROID_DEBUG}")
message(STATUS "[+] TOR_BIN: ${TOR_BIN}")
message(STATUS "[+] OpenSSL")
message(STATUS " - version: ${OPENSSL_VERSION}")
message(STATUS " - dirs: ${OPENSSL_INCLUDE_DIR}")
message(STATUS " - libs: ${OPENSSL_LIBRARIES} ${OPENSSL_SSL_LIBRARIES}")
message(STATUS "[+] Boost")
message(STATUS " - version: ${Boost_VERSION}")
message(STATUS " - dirs: ${Boost_INCLUDE_DIRS}")
message(STATUS " - libs: ${Boost_LIBRARIES}")
if(Iconv_FOUND)
message(STATUS "[+] Iconv")
message(STATUS " - version: ${Iconv_VERSION}")
message(STATUS " - libs: ${Iconv_LIBRARIES}")
message(STATUS " - dirs: ${Iconv_INCLUDE_DIRS}")
endif()

View file

@ -615,7 +615,8 @@ Rectangle {
color: "black"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
//font.family: ComicMonoBold.name;
font.pointSize: 14
font.family: ComicMonoBold.name;
}
}
}