Skip to content

Commit

Permalink
32 bit build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaelers committed Jan 3, 2025
1 parent 94f31f1 commit a3d2a07
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1014,15 +1024,15 @@ 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)

set(DUMP_SYMS ${dump_syms_SOURCE_DIR}/target/release/dump_syms.exe)
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}
)

Expand Down
2 changes: 1 addition & 1 deletion libs/crash/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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} $<TARGET_FILE:crash> -o ${CMAKE_BINARY_DIR}/crash.sym)
COMMAND ${MSYS64_CMD} "${DUMP_SYMS} $<TARGET_FILE:crash> -o ${CMAKE_BINARY_DIR}/crash.sym")
add_dependencies(crash dump_syms)
endif()

Expand Down
3 changes: 1 addition & 2 deletions po/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ if (MINGW)

if (DUMP_SYMS)
add_custom_command(TARGET workrave POST_BUILD
COMMAND ${DUMP_SYMS} $<TARGET_FILE:workrave> -o ${CMAKE_BINARY_DIR}/workrave.sym)
COMMAND ${MSYS64_CMD} "${DUMP_SYMS} $<TARGET_FILE:workrave> -o ${CMAKE_BINARY_DIR}/workrave.sym")
add_dependencies(workrave dump_syms)
endif()

Expand Down

0 comments on commit a3d2a07

Please sign in to comment.