Skip to content

Commit

Permalink
Support building assembly files for mingw-w64 on arm64 with CMake.
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune authored Dec 15, 2024
1 parent 46effe4 commit f82483d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,22 @@ if(MSVC)
else()
set(_default_asm masm)
endif()
elseif(BOOST_CONTEXT_ARCHITECTURE STREQUAL arm64 AND MINGW)
set(_default_asm armclang)
else()
set(_default_asm gas)
endif()

set(BOOST_CONTEXT_ASSEMBLER "${_default_asm}" CACHE STRING "Boost.Context assembler (masm, gas, armasm)")
set_property(CACHE BOOST_CONTEXT_ASSEMBLER PROPERTY STRINGS masm gas armasm)
set(BOOST_CONTEXT_ASSEMBLER "${_default_asm}" CACHE STRING "Boost.Context assembler (masm, gas, armasm, armclang)")
set_property(CACHE BOOST_CONTEXT_ASSEMBLER PROPERTY STRINGS masm gas armasm armclang)

unset(_default_asm)

## Assembler source suffix

if(BOOST_CONTEXT_BINARY_FORMAT STREQUAL pe)
if(BOOST_CONTEXT_ASSEMBLER STREQUAL armclang)
set(_default_ext .S)
elseif(BOOST_CONTEXT_BINARY_FORMAT STREQUAL pe)
set(_default_ext .asm)
elseif(BOOST_CONTEXT_ASSEMBLER STREQUAL gas)
set(_default_ext .S)
Expand Down Expand Up @@ -135,7 +139,7 @@ message(STATUS "Boost.Context: "
# Enable the right assembler

if(BOOST_CONTEXT_IMPLEMENTATION STREQUAL "fcontext")
if(BOOST_CONTEXT_ASSEMBLER STREQUAL gas)
if(BOOST_CONTEXT_ASSEMBLER STREQUAL gas OR BOOST_CONTEXT_ASSEMBLER STREQUAL armclang)
if(CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin")
enable_language(ASM-ATT)
else()
Expand Down

0 comments on commit f82483d

Please sign in to comment.