Visual Studio 17 2022 Win64: $<COMPILE_LANGUAGE:C> evaluating as true for ASM_NASM compiler with .asm source file.
This is with CMake 3.22.2.
I have the following (simplified) cmakelists.txt
project(openssl C ASM_NASM)
target_compile_definitions(${PROJECT_NAME} PRIVATE
L_ENDIAN
$<$<COMPILE_LANGUAGE:C>:OPENSSLDIR="C:/Program\ File/Common\ Files/SSL">
)
target_sources(${PROJECT_NAME} PRIVATE aes_cbc.c aesni-mb-x86_64-w.asm)
In the ninja generator, I have this rule for the .asm file.
build aesni-mb-x86_64-w.asm.obj: ASM_NASM_COMPILER__openssl_Release D$:\source\openssl\aesni-mb-x86_64-w.asm || cmake_object_order_depends_target_openssl_RELEASE
DEFINES = -DL_ENDIAN -DCMAKE_INTDIR=\"Release\"
DEP_FILE = aesni-mb-x86_64-w.asm.obj.d
INCLUDES =
OBJECT_DIR = CMakeFiles\openssl.dir\Release
OBJECT_FILE_DIR = CMakeFiles\openssl.dir\Release\generated
TARGET_COMPILE_PDB = CMakeFiles\openssl.dir\Release\
TARGET_PDB = artifacts\Release\openssl-w64r-21-3.pdb
In the visual studio generator, I have this rule for the .asm file.
<NASM>
<IncludePaths>%(IncludePaths)</IncludePaths>
<Outputswitch>1</Outputswitch>
<PreprocessorDefinitions>%(PreprocessorDefinitions);L_ENDIAN;OPENSSLDIR="C:/Program File/Common Files/SSL";CMAKE_INTDIR="Debug";</PreprocessorDefinitions>
</NASM>
The Ninja generator is correctly understanding that .asm files are not C language files.
The Visual Studio generator, despite using the NASM rule for this .asm file, is somehow associating the ASM_NASM compiler with C language files when it comes to evaluating generator expressions in target_compile_definitions