From faadb864748219152f9a026be5ef08d135f18173 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 11 Jun 2024 15:08:57 -0700 Subject: ASM_MASM: Add support for masm-only static libraries Set correct command to create a static library for Microsoft assembly dialects. Fixes: #18889 --- Modules/CMakeASM_MARMASMInformation.cmake | 1 + Modules/CMakeASM_MASMInformation.cmake | 1 + Tests/VSMARMASM/CMakeLists.txt | 1 + Tests/VSMARMASM/empty.asm | 1 + Tests/VSMASM/CMakeLists.txt | 1 + Tests/VSMASM/empty.asm | 1 + 6 files changed, 6 insertions(+) create mode 100644 Tests/VSMARMASM/empty.asm create mode 100644 Tests/VSMASM/empty.asm diff --git a/Modules/CMakeASM_MARMASMInformation.cmake b/Modules/CMakeASM_MARMASMInformation.cmake index a47f7c2..51bd313 100644 --- a/Modules/CMakeASM_MARMASMInformation.cmake +++ b/Modules/CMakeASM_MARMASMInformation.cmake @@ -9,6 +9,7 @@ set(ASM_DIALECT "_MARMASM") set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm) set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o ") +set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY " /out: ") # The ASM_MARMASM compiler id for this compiler is "MSVC", so fill out the runtime library table. set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "") diff --git a/Modules/CMakeASM_MASMInformation.cmake b/Modules/CMakeASM_MASMInformation.cmake index 11b83662..64ae070 100644 --- a/Modules/CMakeASM_MASMInformation.cmake +++ b/Modules/CMakeASM_MASMInformation.cmake @@ -9,6 +9,7 @@ set(ASM_DIALECT "_MASM") set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm) set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -c -Fo ") +set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY " /out: ") # The ASM_MASM compiler id for this compiler is "MSVC", so fill out the runtime library table. set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "") diff --git a/Tests/VSMARMASM/CMakeLists.txt b/Tests/VSMARMASM/CMakeLists.txt index 85740de..7498461 100644 --- a/Tests/VSMARMASM/CMakeLists.txt +++ b/Tests/VSMARMASM/CMakeLists.txt @@ -4,3 +4,4 @@ add_executable(VSMARMASM main.c foo.asm) target_compile_options(VSMARMASM PRIVATE "$<$:SHELL:-predefine \"zero SETA 0\">" ) +add_library(empty STATIC empty.asm) diff --git a/Tests/VSMARMASM/empty.asm b/Tests/VSMARMASM/empty.asm new file mode 100644 index 0000000..a6a9baf --- /dev/null +++ b/Tests/VSMARMASM/empty.asm @@ -0,0 +1 @@ +end diff --git a/Tests/VSMASM/CMakeLists.txt b/Tests/VSMASM/CMakeLists.txt index 49bd24a..bf9a4b8 100644 --- a/Tests/VSMASM/CMakeLists.txt +++ b/Tests/VSMASM/CMakeLists.txt @@ -10,3 +10,4 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) add_executable(VSMASM main.c foo.asm) target_compile_definitions(VSMASM PUBLIC DEF_FOO) target_compile_options(VSMASM PUBLIC -DDEF_BAR) +add_library(empty STATIC empty.asm) diff --git a/Tests/VSMASM/empty.asm b/Tests/VSMASM/empty.asm new file mode 100644 index 0000000..a6a9baf --- /dev/null +++ b/Tests/VSMASM/empty.asm @@ -0,0 +1 @@ +end -- cgit v0.12