{"action":"created","issue":{"url":"https://api.github.com/repos/jpakkane/meson/issues/111","labels_url":"https://api.github.com/repos/jpakkane/meson/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/jpakkane/meson/issues/111/comments","events_url":"https://api.github.com/repos/jpakkane/meson/issues/111/events","html_url":"https://github.com/jpakkane/meson/issues/111","id":76372076,"number":111,"title":"Problem using VS2013 compiler on cygwin","user":{"login":"byon","id":73645,"avatar_url":"https://avatars.githubusercontent.com/u/73645?v=3","gravatar_id":"","url":"https://api.github.com/users/byon","html_url":"https://github.com/byon","followers_url":"https://api.github.com/users/byon/followers","following_url":"https://api.github.com/users/byon/following{/other_user}","gists_url":"https://api.github.com/users/byon/gists{/gist_id}","starred_url":"https://api.github.com/users/byon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byon/subscriptions","organizations_url":"https://api.github.com/users/byon/orgs","repos_url":"https://api.github.com/users/byon/repos","events_url":"https://api.github.com/users/byon/events{/privacy}","received_events_url":"https://api.github.com/users/byon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-14T14:16:35Z","updated_at":"2015-05-17T13:06:26Z","closed_at":null,"body":"I tried out the simple C-tutorial using VS2013 compiler with Ninja backend and running the commands on cygwin. I can get compilation to work. However, link command seems to get garbage characters into the command.\r\n\r\n```\r\n$ CC=cl CXX=cl /cygdrive/d/Utilities/ChocolateyPackages/python/python $(cygpath.exe -w /cygdrive/d/Utilities/meson/meson.py) build/\r\nThe Meson build system\r\nVersion: 0.24.0-research\r\nSource dir: C:\\Users\\byon\\Documents\\src\\experiments\\meson\r\nBuild dir: C:\\Users\\byon\\Documents\\src\\experiments\\meson\\build\r\nBuild type: native build\r\nProject name: tutorial\r\nNative c compiler: cl (msvc 18.00.31101)\r\nBuild targets in project: 1\r\n$ ninja -v -C build/\r\nninja: Entering directory `build/'\r\n[1/2] cl \"/nologo\" \"/showIncludes\" \"/FS\" \"/W3\" \"/MDd\" \"/Zi\" \"/Ob0\" \"/Od\" \"/RTC1\" \"-Idemo.dir\" \"-I..\" \"-I.\"  /Fodemo.dir\\main.c.obj /c ..\\main.c\r\n[2/2] cmd /c link   /OUT:demo.exe demo.dir\\main.c.obj \"/nologo\"\r\nFAILED: cmd /c link   /OUT:demo.exe demo.dir\\main.c.obj \"/nologo\"\r\nlink: extra operand ÔÇÿ/nologoÔÇÖ\r\nTry 'link --help' for more information.\r\nninja: build stopped: subcommand failed.\r\n```\r\n\r\nNote: I needed to explicitly use Windows python (as opposed to cygwin version) to get the command quoted properly. I assume the windows compilation commands require double quotes, and cygwin commands require single quotes. This is not particularly convenient, but ok as I can work around it.\r\n\r\nSome additional information:\r\n\r\nI can get the build to work on cygwin, if I use cygwin versions of python and gcc:\r\n```\r\n$ CC=gcc CXX=gcc meson.py build/; ninja -C build/\r\nThe Meson build system\r\nVersion: 0.24.0-research\r\nSource dir: /cygdrive/c/Users/byon/Documents/src/experiments/meson\r\nBuild dir: /cygdrive/c/Users/byon/Documents/src/experiments/meson/build\r\nBuild type: native build\r\nProject name: tutorial\r\nNative c compiler: gcc (gcc 4.9.2)\r\nBuild targets in project: 1\r\nninja: Entering directory `build/'\r\n[2/2] Linking target demo\r\n```\r\n\r\nAnd I can get the build to work, if using windows python and cl.exe on windows command line:\r\n```\r\n> set CC=cl\r\n> set GCC=cl\r\n> d:\\Utilities\\ChocolateyPackages\\python\\python.exe d:\\Utilities\\meson\\meson.py build\r\nThe Meson build system\r\nVersion: 0.24.0-research\r\nSource dir: c:\\Users\\byon\\Documents\\src\\experiments\\meson\r\nBuild dir: c:\\Users\\byon\\Documents\\src\\experiments\\meson\\build\r\nBuild type: native build\r\nProject name: tutorial\r\nNative c compiler: cl (msvc 18.00.31101)\r\nBuild targets in project: 1\r\n> ninja -v -C build\r\nninja: Entering directory `build'\r\n[1/2] cl \"/nologo\" \"/showIncludes\" \"/FS\" \"/W3\" \"/MDd\" \"/Zi\" \"/Ob0\" \"/Od\" \"/RTC1\" \"-Idemo.dir\" \"-I..\" \"-I.\"  /Fodemo.dir\\main.c.obj /c ..\\main.c\r\n[2/2] cmd /c link   /OUT:demo.exe demo.dir\\main.c.obj \"/nologo\"\r\n> ninja -v -C build\r\nninja: Entering directory `build'\r\n[1/1] cmd /c link   /OUT:demo.exe demo.dir\\main.c.obj \"/nologo\"\r\n>\r\n```\r\n\r\nI am using python 3.4.1, ninja 1.5.3, and meson straight from Github (latest commit 28476aa7)."},"comment":{"url":"https://api.github.com/repos/jpakkane/meson/issues/comments/102802924","html_url":"https://github.com/jpakkane/meson/issues/111#issuecomment-102802924","issue_url":"https://api.github.com/repos/jpakkane/meson/issues/111","id":102802924,"user":{"login":"byon","id":73645,"avatar_url":"https://avatars.githubusercontent.com/u/73645?v=3","gravatar_id":"","url":"https://api.github.com/users/byon","html_url":"https://github.com/byon","followers_url":"https://api.github.com/users/byon/followers","following_url":"https://api.github.com/users/byon/following{/other_user}","gists_url":"https://api.github.com/users/byon/gists{/gist_id}","starred_url":"https://api.github.com/users/byon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byon/subscriptions","organizations_url":"https://api.github.com/users/byon/orgs","repos_url":"https://api.github.com/users/byon/repos","events_url":"https://api.github.com/users/byon/events{/privacy}","received_events_url":"https://api.github.com/users/byon/received_events","type":"User","site_admin":false},"created_at":"2015-05-17T13:06:26Z","updated_at":"2015-05-17T13:06:26Z","body":"It did no difference, but I happened to stumble on a clue that will likely lead into the actual solution. I just noticed that link.exe is pointing to cygwin's /usr/bin/link and not Visual Studio linker. That obviously cannot work.\r\n\r\nSo, this looks like a problem in my environment, rather than meson. Sorry about the hassle. :/"}}