Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,799
    • Issues 3,799
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #19751

Closed
Open
Created Sep 24, 2019 by Alexander Sharov@alexsharoff

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

Edited Feb 17, 2020 by Alexander Sharov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking