KhronosGroup/MoltenVK

Header paths are borked

Open

#500 创建于 2019年2月15日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Objective-C++ (514 fork)github user discovery
EnhancementHelp wantedQuestion

仓库指标

Star
 (5,666 star)
PR 合并指标
 (平均合并 11天 20小时) (30 天内合并 7 个 PR)

描述

I noticed is that headers are very Xcode specific. What I mean is that the relative paths are not correct. In Xcode, this doesn't matter as it mangles the include path. But for external build systems, it won't work.

When the code writes #include "path/file.hpp" that path/file.hpp should resolve relative to the current path. But I see lots of paths that are not relative.

e.g. the following include:

https://github.com/KhronosGroup/MoltenVK/blob/136c7ea8559900f4cad98aadbf8430d302a28c1a/MoltenVK/MoltenVK/Vulkan/vulkan.mm#L20

Should really be:

#include "../Layers/MVKLayers.hpp"

If you don't believe me, try running cpp on the raw file:

^_^ > cpp vulkan.mm 
# 1 "vulkan.mm"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 360 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "vulkan.mm" 2
# 17 "vulkan.mm"



vulkan.mm:20:10: fatal error: 'MVKLayers.h' file not found
#include "MVKLayers.h"
         ^~~~~~~~~~~~~

If I fix it:

x_x > cpp vulkan.mm
# 1 "vulkan.mm"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 360 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "vulkan.mm" 2
# 17 "vulkan.mm"




# 1 "./../Layers/MVKLayers.h" 1
# 17 "./../Layers/MVKLayers.h"




In file included from vulkan.mm:20:
./../Layers/MVKLayers.h:21:10: fatal error: 'MVKBaseObject.h' file not found
#include "MVKBaseObject.h"

and so on.

贡献者指南