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
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to