Skip to content

Commit 9b6d0f7

Browse files
committed
win32: require MSVC ml to build MASM .asm file
1 parent f31ff5e commit 9b6d0f7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.28)
22

33
project(native_client C CXX ASM)
44

5+
if (WIN32 AND NOT MINGW)
6+
enable_language(ASM_MASM)
7+
endif()
8+
59
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
610

711
include(DaemonPlatform/Platform)

src/trusted/service_runtime/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ elseif (ARCH STREQUAL "amd64")
103103
# This use of win64_asm_env causes an invocation of MSVC, even if sel_ldr
104104
# would not otherwise be actually built. So don't include it if we aren't
105105
# actually building sel_ldr
106-
#TODO: NACL_SWITCH_UNWIND_WIN_ASM = win64_asm_env.ComponentObject('arch/x86_64/nacl_switch_unwind_win.asm')
107-
# list(APPEND LDR_INPUTS ${NACL_SWITCH_UNWIND_WIN_ASM})
106+
if (MSVC)
107+
add_library(nacl_switch_unwind_win OBJECT "arch/x86_64/nacl_switch_unwind_win.asm")
108+
list(APPEND LDR_LIBS nacl_switch_unwind_win)
109+
else()
110+
message(WARNING "Cannot build nacl_switch_unwind_win without MSVC ml")
111+
endif()
108112
endif()
109113
else()
110114
list(APPEND LDR_INPUTS "arch/x86_64/sel_addrspace_posix_x86_64.c")
@@ -509,7 +513,6 @@ if (LINUX AND NOT BUILD_ELSEWHERE)
509513
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/nacl_bootstrap.dir/linux/nacl_bootstrap.c.o"
510514
)
511515

512-
513516
add_custom_target(nacl_bootstrap_raw
514517
COMMAND env CXX="${CMAKE_CXX_COMPILER}" "${PYTHON}"
515518
${NACL_BOOTSTRAP_RAW_ARGS}

0 commit comments

Comments
 (0)