Skip to content

Commit

Permalink
Add Ninja + MSVC/clang-cl workaround for MARMASM
Browse files Browse the repository at this point in the history
The workaround that enables ninja + MSVC/clang-cl support in the loader
only applied to MASM, which isn't helpful for MARMASM builds.

This workaround did not get added to the build as ninja support was not
considered required for release of the ARM SDK. However, other parties
have started using the ARM build of the loader and reported the issue,
necessitating this fix.
  • Loading branch information
charles-lunarg committed Oct 16, 2024
1 parent b6a995d commit 9c0f025
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ end

# Work around bug in CMake Ninja + MSVC/clang-cl, see https://discourse.cmake.org/t/building-lib-file-from-asm-cmake-bug/1959
if (CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC"))
set(CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY "<CMAKE_AR> /OUT:<TARGET> <LINK_FLAGS> <OBJECTS>")
if(SYSTEM_PROCESSOR MATCHES "arm")
set(CMAKE_ASM_MARMASM_CREATE_STATIC_LIBRARY "<CMAKE_AR> /OUT:<TARGET> <LINK_FLAGS> <OBJECTS>")
else()
set(CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY "<CMAKE_AR> /OUT:<TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
endif()
else()
message(WARNING "Could not find working ${} assembler\n${ASM_FAILURE_MSG}")
Expand Down

0 comments on commit 9c0f025

Please sign in to comment.