NASM receives incorrect compiler argument value
I'm not able to build NASM sources with flags like -DDIR="C:\\Program Files\\Common Files"
when using CMake v3.15.3. My NASM version is 2.14.02.
I'm building on Windows with Visual Studio:
cmake -G "Visual Studio 15 2017" -A Win32 <CMakeLists.txt dir>
cmake --build . --config Release
Here's relevant build message with the error:
_NASM:
Assembling 2.asm
cmd.exe /D /C "<...>\AppData\Local\Temp\tmpd35a6162c1a149709a9536c9f5da074d.cmd"
"<...>/AppData/Local/bin/NASM/nasm.exe" -o "app.dir\Release\2.obj" -fwin32 -D"WIN32" -D"_WINDOWS" -D"NDE
BUG" -D"DIR="C:\\Program Files\\Common Files"" -D"CMAKE_INTDIR="Release"" "<...>\2.asm"
Files\\Common: fatal: more than one input file specified: Files
Important to note that CMake v3.12.4 builds the same CMakeLists.txt without any problems.
CMakeLists.txt:
cmake_minimum_required(VERSION 3.8)
project(test C ASM_NASM)
add_executable(app 1.c 2.asm)
target_compile_options(app PRIVATE "-DDIR=\"C:\\\\Program Files\\\\Common Files\"")
1.c:
#include <stdio.h>
int main() { printf(DIR); }
2.asm: empty