From a3d2a070a24951f791ade5d2c65eaac1b9abe973 Mon Sep 17 00:00:00 2001 From: Rob Caelers Date: Fri, 3 Jan 2025 20:02:53 +0100 Subject: [PATCH] 32 bit build fixes --- CMakeLists.txt | 14 ++++++++++++-- libs/crash/test/CMakeLists.txt | 2 +- po/CMakeLists.txt | 3 +-- ui/app/CMakeLists.txt | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d087e6f0b..276f98068 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,8 +154,10 @@ if (WIN32 AND (NOT MSVC) AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) string(REGEX MATCH "x86_64-.*" _clang_is_x86 ${CLANG_TRIPLE}) if (CLANG_TRIPLE MATCHES "x86_64") set(CMAKE_SYSTEM_PROCESSOR "amd64") + message(STATUS "Clang detected as x86_64") else() set(CMAKE_SYSTEM_PROCESSOR "arm64") + message(STATUS "Clang detected as arm64") endif() endif() @@ -815,6 +817,8 @@ if (WIN32) else() include(FindMsys) endif() + set(MSYS64_CMD ${MSYS_CMD} -here -mingw64 -no-start -defterm -c) + set(MSYS32_CMD ${MSYS_CMD} -here -mingw32 -no-start -defterm -c) endif() find_library(SSP_LIBRARY libssp) @@ -987,6 +991,12 @@ set(HAVE_CRASH_REPORT OFF) set(HAVE_CRASHPAD OFF) if (WITH_CRASHPAD) + if (MINGW) + if (NOT "$ENV{MSYSTEM}" STREQUAL "CLANG64") + message(FATAL_ERROR "Crashpad requires MINGW Clang64") + endif() + endif() + FetchContent_Declare_Logged( crashpad "A crash-reporting system" @@ -1014,7 +1024,7 @@ if (WITH_CRASHPAD) FetchContent_Declare( dump_syms GIT_REPOSITORY https://github.com/mozilla/dump_syms.git - GIT_TAG v2.2.1 + GIT_TAG v2.3.4 ) FetchContent_MakeAvailable(dump_syms) @@ -1022,7 +1032,7 @@ if (WITH_CRASHPAD) add_custom_target(dump_syms ALL DEPENDS ${DUMP_SYMS}) add_custom_command( OUTPUT ${DUMP_SYMS} - COMMAND ${CARGO} build --release + COMMAND ${MSYS_CMD} -here -mingw64 -no-start -defterm -c "cargo build --release" WORKING_DIRECTORY ${dump_syms_SOURCE_DIR} ) diff --git a/libs/crash/test/CMakeLists.txt b/libs/crash/test/CMakeLists.txt index f0cd589b2..7847ecaf3 100644 --- a/libs/crash/test/CMakeLists.txt +++ b/libs/crash/test/CMakeLists.txt @@ -11,7 +11,7 @@ if (HAVE_CRASHPAD AND HAVE_TESTS) if (MINGW) if (DUMP_SYMS) add_custom_command(TARGET crash POST_BUILD - COMMAND ${DUMP_SYMS} $ -o ${CMAKE_BINARY_DIR}/crash.sym) + COMMAND ${MSYS64_CMD} "${DUMP_SYMS} $ -o ${CMAKE_BINARY_DIR}/crash.sym") add_dependencies(crash dump_syms) endif() diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index f38ee397d..aa3c2cd0e 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -49,10 +49,9 @@ foreach (po_file ${POFILES}) TARGET update-po POST_BUILD COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --no-wrap --backup=none -s ${po_file} ${POTFILE} - DEPENDS ${POTFILE} VERBATIM ) - + add_custom_command( OUTPUT ${gmo_file} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} ${OPT_USE_FUZZY} -c -o ${gmo_file} ${po_file} diff --git a/ui/app/CMakeLists.txt b/ui/app/CMakeLists.txt index 14988f856..10a6991dc 100644 --- a/ui/app/CMakeLists.txt +++ b/ui/app/CMakeLists.txt @@ -217,7 +217,7 @@ if (MINGW) if (DUMP_SYMS) add_custom_command(TARGET workrave POST_BUILD - COMMAND ${DUMP_SYMS} $ -o ${CMAKE_BINARY_DIR}/workrave.sym) + COMMAND ${MSYS64_CMD} "${DUMP_SYMS} $ -o ${CMAKE_BINARY_DIR}/workrave.sym") add_dependencies(workrave dump_syms) endif()