mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 15:18:26 -05:00
81f670fa83
The Ninja and Makefile generators honor `target_compile_options` and friends for MASM `.asm` sources. Teach the VS generator to honor them too for consistency. Fixes: #24289
13 lines
430 B
CMake
13 lines
430 B
CMake
cmake_minimum_required(VERSION 3.25) # Enable CMP0141
|
|
project(VSMASM C ASM_MASM)
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
add_definitions(-DTESTx64)
|
|
else()
|
|
add_definitions(-DTESTi386)
|
|
string(APPEND CMAKE_ASM_MASM_FLAGS " /safeseh")
|
|
endif()
|
|
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)
|