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

Fixed a couple of build-related issues when using clang #96

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

princessakokosowa
Copy link

Specifically for LLVM 14.

@@ -20,10 +20,10 @@
#ifndef _WIN32
#include <wsl/winadapter.h>
#endif
#include "d3dx12_property_format_table.h"
#include <directx/d3dx12_property_format_table.h>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang failed with stderr: C:\code\cpp\DirectX-Headers\src\d3dx12_property_format_table.cpp:23:10: fatal error: 'd3dx12_property_format_table.h' file not found

I've no idea how this compiled for you guys, but that's definitely not right.

Copy link
Member

@jenatali jenatali May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both meson and CMake set up the include path so that directx is included, this change shouldn't be needed. I'd accept switching "" to <> but that also shouldn't be needed...

#include <assert.h>
#include <algorithm>
#include "D3D12TokenizedProgramFormat.hpp"
#include <directx/D3D12TokenizedProgramFormat.hpp>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's for consistency.

@@ -31,7 +31,7 @@ int main()
check_uuid_linkage();
{
IDXCoreAdapterFactory *factory = nullptr;
if (FAILED(DXCoreCreateAdapterFactory(&factory)))
if (FAILED(DXCoreCreateAdapterFactory(IID_PPV_ARGS(&factory))))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang failed with stderr: C:\code\cpp\DirectX-Headers\test\test.cpp:34:20: error: no matching function for call to 'DXCoreCreateAdapterFactory'

That's probably not the intended way of doing things, but the intended way does not compile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@princessakokosowa princessakokosowa changed the title Fixed a couple of build-related issues when using mingw compiler Fixed a couple of build-related issues when using clang compiler May 2, 2023
@princessakokosowa
Copy link
Author

princessakokosowa commented May 2, 2023

One more thing, the two test files in the test folder do not work because the DirectX core is not supported by either MinGW or clang. Is this intentional?

@princessakokosowa princessakokosowa changed the title Fixed a couple of build-related issues when using clang compiler Fixed a couple of build-related issues when using clang May 2, 2023
@princessakokosowa
Copy link
Author

@microsoft-github-policy-service agree

@princessakokosowa princessakokosowa marked this pull request as ready for review May 2, 2023 15:42
@jenatali
Copy link
Member

jenatali commented May 2, 2023

One more thing, the two test files in the test folder do not work because the DirectX core is not supported by either MinGW or clang. Is this intentional?

MinGW support is best-effort. Note that MinGW uses a reverse-engineered version of the Windows SDK with a GPL license, so as contributors to the actual Windows SDK, that really ties our hands. I couldn't tell you what the deal is with MinGW support for DXCore, but it's a Windows API and so compilers targeting Windows should be able to use it.

@princessakokosowa
Copy link
Author

I'll come back to this PR sometime this week, as I'm a bit busy at the moment. As far as I can see, dxcore.lib is in the um/x64 directory (talking about Windows Kits here), so providing the linker with the path to that place should do the trick, but for some as yet unknown reason, it does not.

I'll also answer your comments later as I have a few questions.

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

Successfully merging this pull request may close these issues.

None yet

2 participants