VS/ASM_MASM: sources not getting compile definitions added via target_compile_definitions()
The source file 'test.asm' doesn't get the compiled with the compile definition 'LANG_IS_MASM' in the following CMake:
cmake_minimum_required(VERSION 3.14)
project("problem")
enable_language(ASM_MASM)
add_library(Problem STATIC "test.asm")
target_compile_definitions(Problem PRIVATE "MY_MASM_DEFINITION")
Using VS 15 2017 Generator
Also even if set like this: set(CMAKE_ASM_MASM_FLAGS "/DMY_MASM_DEFINITION" ${CMAKE_ASM_MASM_FLAGS})
. It is still isn't compiled with the definitions, but if I do this instead set(CMAKE_ASM_MASM_FLAGS "MY_FAKE_FLAG" ${CMAKE_ASM_MASM_FLAGS})
, 'MY_FAKE_FLAG' does get passed to the compiler.
I am also seeing the same problem using set_target_properties
.
Using set_target_properties(Problem PROPERTIES COMPILE_DEFINITIONS "MY_MASM_DEFINITION")
to set the compile definition does seem to work.
Edit:
I tried this also with ASM_NASM and the same issue exists.
Edited by Brad King