[CMake] Cannot set ASM_MASM flags?

Tiago Macarios tiagomacarios at gmail.com
Thu Nov 22 02:36:21 EST 2018


I am trying to set a flag for the Microsoft assembler, but no luck. Dummy
repro below.
I tried setting target_compile_options, but that seems not to work. Then I
tried setting CMAKE_ASM_MASM_FLAGS, but that does not seem to work either.

It seems like I am hitting this issue:
https://gitlab.kitware.com/cmake/cmake/issues/14711

Which was already discussed here:
https://cmake.org/pipermail/cmake/2014-August/058422.html

If indeed this is a CMake problem. Maybe someone knows of a work around?

CMakeLists:
cmake_minimum_required(VERSION 3.11)
enable_language(ASM_MASM)
project(AsmTest)

set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /Sg" PARENT_SCOPE)

add_executable(AsmTest AsmTestFunc.asm)
#target_compile_options(AsmTest PRIVATE /Sg)
target_link_options(AsmTest PRIVATE /SAFESEH:NO)
target_link_libraries(AsmTest kernel32.lib)

File:
.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
.code
main PROC
INVOKE ExitProcess,0
main ENDP
END main
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181121/0b16baa3/attachment.html>


More information about the CMake mailing list