Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having a directory with spaces as an include directory doesn't quite work. #1235

Closed
SirLynix opened this issue Feb 8, 2021 · 4 comments
Closed
Labels
Milestone

Comments

@SirLynix
Copy link
Member

SirLynix commented Feb 8, 2021

Describe the bug

I'm using

add_sysincludedirs([[C:\Program Files\Azure Kinect SDK v1.4.1\sdk/include]])

to use Azure Kinect SDK.

The problem is that xmake generate that command-like:

[ 11%]: compiling.debug src\obs-kinect-azuresdk\AzureKinectDevice.cpp
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX64\\x64\\cl.exe" -c /EHsc -nologo -Zi -FS -Fdbin\windows_x64_debug\compile.obs-kinect-azuresdk.pdb -W4-Od -std:c++17 -MDd -Iinclude -DNOMINMAX -DWIN32_LEAN_AND_MEAN -experimental:external -external:W0 -external:I..\obs-studio\libobs "-external:I\"C:\\\\Program Files\\\\Azure Kinect SDK v1.4.1\\\\sdk\\\\include\"" /Zc:__cplusplus /Zc:referenceBinding /Zc:throwingNew /w44062 /wd4251 -Fobuild\.objs\obs-kinect-azuresdk\windows\x64\debug\src\obs-kinect-azuresdk\AzureKinectDevice.cpp.obj src\obs-kinect-azuresdk\AzureKinectDevice.cpp

Which leads to errors:

error: @programdir\modules\private\async\runjobs.lua:217: @programdir\modules\private\action\build\object.lua:78: @programdir\modules\core\tools\cl.lua:455: AzureKinectPlugin.cpp
c1xx: warning C5044: An argument to command-line option /external:I points to a path 'c:\projets\obs-kinect\obs-kinect\"c:\program files\azure kinect sdk v1.4.1\sdk\include"' that does not exist
C:\Projets\obs-kinect\obs-kinect\src\obs-kinect-azuresdk\AzureKinectDevice.hpp(25): fatal error C1083: cannot open include file: 'k4a/k4a.hpp' : No such file or directory

Notice how cl.exe seems to understand the path as a relative one (c:\projets\obs-kinect\obs-kinect is my working folder).

I managed to fix this by replacing this part

"-external:I\"C:\\\\Program Files\\\\Azure Kinect SDK v1.4.1\\\\sdk\\\\include\""

to

"-external:IC:\\Program Files\\Azure Kinect SDK v1.4.1\\sdk\\include\\"

And of course the files exist on my computer:
image

Expected behavior

That xmake generates a working argument when spaces are used.

Related Environment

Please provide compiling and running environment information:

  • xmake version: xmake 2.5.1 (dev)
  • os: Windows 10 2004
  • target platform: Windows
@waruqi waruqi added the bug label Feb 8, 2021
@waruqi waruqi added this to the v2.5.2 milestone Feb 8, 2021
@waruqi
Copy link
Member

waruqi commented Feb 8, 2021

I will fix it in these days.

@waruqi
Copy link
Member

waruqi commented Feb 9, 2021

I have fixed it on space branch. you can try it first. I will merge into dev If it works.

@SirLynix
Copy link
Member Author

SirLynix commented Feb 9, 2021

It works! Thank you.

@waruqi waruqi closed this as completed Feb 9, 2021
@waruqi
Copy link
Member

waruqi commented Feb 9, 2021

Ok, I have merged into dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants