Граф коммитов

105 Коммитов

Автор SHA1 Сообщение Дата
Antonio Maiorano 91b348912b
Add llvm assertions trap and no strings (#6838)
Add option LLVM_ASSERTIONS_NO_STRINGS
    
When defined, drop the stringized expression, __FILE__, and __FUNCTION__
    strings passed to llvm_assert. This dramatically reduces the binary
    size, which is useful when enabling assertions in a non-debug build.

   Add option LLVM_ASSERTIONS_TRAP
    
When enabled, this forces asserts to always trap. Currently, on Windows
    asserts calls RaiseException, while they trap on non-Windows. This
    option makes the assertion behaviour consistent across platforms.
2024-08-01 15:37:02 -04:00
Chris B a2a220bc61
[CMake] Add an option to disable source generation (#6730)
This change adds a new CMake configuration option
`HLSL_DISABLE_SOURCE_GENERATION` which allows a user to disable
generating the in-tree sources which contributte to DXC's source
releases. This option should only be used by users building DXC and not
modifying it.

Resolves #6728
2024-07-18 10:51:54 -05:00
Raed Rizqie 0eebec69d4
CMake: Add initial support for MinGW-w64 (#6715) 2024-06-24 15:25:14 -07:00
David Neto 1f8f79688e
CMake: Use find_package(Python3) (#6675)
Fixes the CMake CMP0148 warning at configure time.

find_package(Python3) is supported since CMake 3.12, and DXC requires at
least CMake 3.17
2024-06-20 13:11:49 -04:00
Antonio Maiorano 40e27eb4e9
azure-pipelines: Fix the fact that neither asan+ubsan were not actually enabled (#6428)
Also make the message about the unsupported value of LLVM_USE_SANITIZER
an error rather than a warning, so we don't make this mistake in the
future.
2024-03-22 17:49:37 -04:00
Antonio Maiorano 10727e8292
Disable ubsan alignment errors properly (#6431)
This adds the same 'no-sanitize=alignment' option in the branch for both
asan and ubsan that I missed as part of this PR:
https://github.com/microsoft/DirectXShaderCompiler/pull/5803
2024-03-20 15:43:18 -04:00
Chris B f7aec3efa7
[CMake] Don't always run compare steps (#6241)
When not updating the in-tree sources, the compare step would always run
because the comparison was part of the target. This prevents that by
having the comparison be its own custom command that produces an output
and the target depends on the "output" of the comparison step.
2024-02-02 21:54:47 +00:00
Natalie Chouinard 5ed628dc7d
Make clang-format happy (#6177)
The build is failing due to clang-format modifying these lines. I've
changed them to what clang-format wants even though it's a bit odd, and
updated the CMake script to make the error message more clear when this
type of failure occurs.
2024-01-22 11:57:34 -08:00
Antonio Maiorano aa168736be
CMake: fix FindD3D12.cmake when using non-VS generators (#6056)
FindD3D12.cmake sets WIN10_SDK_VERSION to
CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION; however, this latter variable
is only defined when using a Visual Studio CMake generator. When using
Ninja instead, for example, this variable will be empty, and
WIN10_SDK_VERSION will remain unset.

This change detects when CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION and
attempts to retrieve the latest SDK by listing directories under
${WIN10_SDK_PATH}/Include.
2023-11-29 13:26:52 -05:00
Xiang Li bc56be9fe1
[CMake] add another hint for DIASDK (#6061)
Fail to find DIASDK when using VisualStudio "Open a local folder". Both
VS_DIA_INC_PATH and VSWHERE_LATEST are empty. But MSVC_DIA_SDK_DIR is
set correctly.

Add MSVC_DIA_SDK_DIR/include as hint for DIASDK_INCLUDE_DIR.
2023-11-28 08:24:57 -08:00
Antonio Maiorano 37a082651d
CMake dxc as subproject fixes (#6050)
These changes allow us to use DXC as as CMake subproject (via
add_subdirectory).

Commit comments from each commit:

===

cmake: allow CMAKE_INSTALL_RPATH to be defined in superproject on APPLE
platforms

As on Linux, allow CMAKE_INSTALL_RPATH to be defined in a CMake
superproject.

===

cmake: Allow LLVM_ENABLE_ASSERTIONS=OFF to disable assertions in Debug
builds

Currently, this flag is only used to enable assertions in non-Debug
builds, but is not respected in Debug builds. That is, if set to false,
Debug builds will still assert. This change fixes that.

Note that by default, LLVM_ENABLE_ASSERTIONS is true in Debug builds, so
unless it's explicitly set to false, this is a no-op for most people.

===

cmake: Allow DIRECTX_HEADERS_INCLUDE_DIR to be defined from superproject

Useful for when DXC is included as a subdirectory. In Dawn/Chrome, we
use our own mirror of DirectX-Headers instead of checking out the repo's
submodules, so we need to override this variable.
2023-11-22 14:33:09 -05:00
Greg Roth 8caace9aa0
Revert mistaken debug changes to hctbuild (#5888)
The previous PR #5881 didn't do what it meant to and had a lot of debug
code due to a mistaken commit. This reverts that commit and restores the
setting of the build type flag
2023-10-18 13:23:48 -07:00
Greg Roth a56078a992
Make hctbuild cmake gen consistent with asserts (#5881)
A slightly complex series of events causes invocations of hctbuild after
the first to enable asserts in release builds. This sets the build type
even when it isn't needed to avoid it.

Because the build type was not being set when generating for visual
studio in hctbuild, when generating the cmake files using CMakeLists, it
would produce an alarming message saying it was defaulting to debug,
but, in fact, since it didn't care for the purposes of sln file
generation, that wasn't actually a problem, just confusing. It did set a
variable to enable asserts, but didn't do this for release variant
builds

The real problem occurs if hctbuild is invoked again, at that point,
instead of defaulting to Debug, it leaves the build type empty because
of another variable set in the cache.

Additionally, since the first invocation enabled asserts, that also
comes from the cache and so code that strips NDEBUG from all build
variants is invoked because the build type is, in fact, not debug, it's
an empty string.
2023-10-17 19:38:47 +00:00
Xiang Li 568ad77e66
[Sanitizer] Fix sanitizer fails in msvc (#5851)
1. Add -sanitizer to hctbuild.
2. Detach pCompileSource in recompile to avoid release freeed memory.
3. Fix Execution test issue about Init size.

This is for
https://github.com/microsoft/DirectXShaderCompiler/issues/5876
2023-10-17 13:35:02 -04:00
Antonio Maiorano 342163b24a
Disable UBSAN sanitizing alignment errors (#5803)
The remaining errors are non-trivial to fix, so let's disable this for
now.
2023-10-06 10:02:46 -04:00
Chris B 589a48d6f6
[NFC] Fix clang-formatting generated sources (#5755)
Clang-format determines if a header is the "main" header by looking at
the header name without the last extension and matching it against the
source file (with some extra handling for cuda files).

The automation generating temporary files with a `.tmp` suffix tripped
this up so it wasn't matching the "main" header when sorting includes.

This corrects the issue by writing temporaries to a tmp directory
instead of munging the suffix.
2023-09-20 12:17:10 -05:00
Chris B 2431f3f0a5
[NFC] Integrate clang-format to hctgen (#5732)
This integrates formatting generated sources with clang-format with the
hctgen generation process.

This change makes a few small adjustments to how the build-time header
generation works. This change, disables automated build-time generation
for C++ sources if you don't have clang-format available on your system.

CMake can automatically detect clang-format installed as part of Visual
Studio, or based on your PATH. You can also explicitly set
`CLANG_FORMAT_EXE` when configuring to manually override. **Developers
on macOS** will need to install clang-format manually and place it on
their path to generate DXC's generated sources.

If clang-format cannot be found and `HLSL_COPY_GENERATED_SOURCES` is On
a fatal error will be reported at configuration time.

This change _does not_ make clang-format a requirement to build DXC, but
it does make it a requirement if you are modifying the generated
sources.
2023-09-18 21:10:30 -05:00
Xiang Li 67fde16627
[CLANG_CL] Fix clang-cl warnings (#5660)
Add -Wno-unused-parameter -Wno-unknown-pragams -Wno-switch which are
enabled for clang in linux build.
Fix
-Wimplicit-fallthrough
-Wconstant-logical-operand (Thanks patch from Chris)
 -Wunused-function
-Wunused-variable
-Wtrigraphs
-Wnonportable-include-path

Still more warnings to be fixed.
2023-09-14 13:25:46 -04:00
r-a-sattarov 9cb80b6cc5
Added e2k support (MCST Elbrus 2000) (#5222)
- Add e2k target to config.guess
- Update config-ix.cmake to support e2k

E2K - this is VLIW/EPIC architecture, like Intel Itanium (IA-64)
architecture.

Ref:
1) https://en.wikipedia.org/wiki/Elbrus_2000
2)
https://lists.gnu.org/archive/html/config-patches/2015-03/msg00000.html
2023-09-11 14:09:48 -07:00
Xiang Li f49bb3c3e7
[C++17] Remove std option for linux build (#5582)
Use CMAKE_CXX_STANDARD instead of -std=c++14 for linux.

Dependent on
https://github.com/microsoft/DirectXShaderCompiler/pull/5520

Fixes https://github.com/microsoft/DirectXShaderCompiler/issues/5479
2023-08-23 16:16:52 -04:00
Xiang Li d2a0baf167
[ClangCL] exception related fix for ClangCL (#5496)
Enable Exception for ClangCL.
Disable the DivByZero exception test for ClangCL.

This is for turn on ClangCL build.
2023-08-21 13:38:56 -04:00
Xiang Li 92ee02e9bd
[lit] Make lit the only test runner (#5402)
Remove disable-lit and enable-lit from hctbuild/hcttest.

This is to allow write lit FileCheck shell test.
2023-07-27 20:01:09 +00:00
Chris B 60bb2c1ae5
Fix TAEF lookup for nuget and SDK paths (#5452)
The standard TAEF install paths use the x64 and x86 paths just like the
TAEF_ARCH. I'm not entirely sure where the alternative TAEF_BIN_ARCH
naming is used, but it seems to be used in the custom tooling for
fetching and building TAEF.

This only alters the parts of the code that I've been able to verify
locally.
2023-07-25 15:43:21 -05:00
Xiang Li 06a7197e23
Enable lit by default. (#5133)
* Enable lit by default.

* Update README for git user bin.

* Add DXC_DISABLE_LIT to replace DXC_ENABLE_LIT

* Set -DDXC_DISABLE_LIT=Off for appveyor.

* Keep original name for ClangSPIRVTests

* Set correct path for unit tests binary.

* Remove doc about DXC_DISABLE_LIT

* Remove extra space.

* Remove DxcOnUnix.rst.
2023-06-05 10:35:24 -07:00
Xiang Li 1e390295e1
Allow find te.exe with %TAEF_PATH% directly. (#5150)
* Allow find te.exe with %TAEF_PATH% directly.

This is for pipeline test where te.exe is set with %TAEF_PATH%.

* Use FATAL_ERROR when cannot find taef
2023-04-17 11:51:19 -07:00
Chris B 39481d9d58
Extend add_lit_testsuites to cover more cases (#4801)
This pulls in a couple upstream commits by myself and @bogner.

commit 3adaa8cf4a6df45430b47a62c649c7cb54bb1626
Author: Justin Bogner <mail@justinbogner.com>
Date:   Wed Jun 8 22:36:37 2016 +0000

    cmake: Simplify add_lit_testsuites

    cmake 3.4 introduced LIST_DIRECTORIES to glob recurse, which can be
    used to simplify this code greatly.

    llvm-svn: 272217

commit 25ef9e34c9de7b1edc327189b78200459337f7e5
Author: Justin Bogner <mail@justinbogner.com>
Date:   Mon Jul 25 18:07:14 2016 +0000

    cmake: When adding lit testsuites, ignore Output directories

    With in-tree builds we can get Output directories scattered among
our
    tests. Recursing into those to find tests doesn't make sense.

    Thanks to nlewycky for noticing this!

    llvm-svn: 276667

commit a44ef999fb5e9243df9c4459df1b17b66aa3fd23
Author: Chris Bieneman <chris.bieneman@me.com>
Date:   Mon Jan 3 11:52:44 2022 -0600

    [NFC][CMake] Add FOLDER to utility targets

    As Visual Studio's CMake support is getting better and better the
line
    between IDE generator and non-IDE generators is blurring. Visual
Studio
    2019 and later have a very useful UI that can handle all of the
various
    targets we create, but if they are unsorted it is wildly unwieldy.

    This change sorts the lit testsuite targets and per-component
install
    targets into folders, which are not generated for IDE generators but
    are generated by default under Visual Studio's CMake + Ninja
    integration.
2023-04-05 09:22:08 -05:00
Chris B 46eb82e0e5
Remove SO version from unix binaries (#5010)
This is a bit hacky. We don't want to have SO versions but we do want
SO names. This makes it a bit wonky since CMake doesn't support this
usage.
2023-02-10 09:54:27 -06:00
Xiang Li 689084cadd
Fix lit test fails (#4973)
1. added dxc_batch as dependent for clang tests.
2. Not run exec test by default.
3. Strip directory which has dxil.dll from %PATH% for taef test which not need it.
4. Add select_filter and use @Name for TestName.
    * Enable mix select filter by use shell=True when open subprocess.
5. Only run execution test when dxil.dll exist or experimental mode enabled.
2023-02-02 16:24:03 -08:00
Xiang Li 9c3dab6896
Add lit test for execution test. (#4964)
* Add lit test for execution test.
* Treat taef skipped as lit Unsupported.
2023-01-27 01:34:56 +00:00
Chris B ac3a6ae9f4
Enable building with ninja through Visual Studio (#4889) 2023-01-05 23:07:36 -06:00
Nathan Gauër 88a2888112
build: disable LLVM_ENABLE_TERMINFO by default. (#4908)
Having this enabled makes dxc depends on ncurses5. This is required by
LLVM when supporting colored message output, but DXC doesn't supports it
for now.

Fixes #4892
2023-01-03 16:59:11 +01:00
FantasqueX a0b6fc1028
Add RISC-V 64 bit (#4894)
- Add riscv64 target to config.guess
- Update config-ix.cmake to update config-ix.cmake to support riscv64
- Tested on riscv64
2022-12-30 08:22:52 -08:00
Greg Roth 7ad9c9c032
Fallthrough (#4843)
A common source of bugs. Although many of these were harmless, some were
not. By eliminating them and enabling this warning as an error, we won't
add more in the future.


Fixed a real SPIRV bug that required a test update to expect the correct behavior.
SPIRV testing was expecting incorrect results that came from a fallthrough error
2022-12-09 10:13:56 -08:00
Chris B f6d15f9aed
LLVM_REQUIRES_* variables shound't be set (#4850)
The `LLVM_REQUIRES_*` variables are internal variables in LLVM's
configuration used to determine if a build setting is required, they
don't actually control the build setting itself, so we shouldn't be
setting them.

`LLVM_ENABLE_*` variables control the build settings, and we do set
those correctly.
2022-12-08 09:27:21 -06:00
Chris B 36fdecf357
Update Linux build and test workflows to use lit (#4836)
* Update Linux build and test workflows to use lit

This change updates the build and test workflows in our azure pipelines
and the GitHub action for code coverage data to use lit instead of ctest
as the test runner. This adds additional test coverage by running some
of the LLVM & Clang tests.

* Fix missing dependency between LLVMAnalysis & DXIL

The default Linux linker fails because LLVMAnalysis depends on LLVMDXIL
and BFD doesn't cycle libraries.

* Updating pipelines to remove mkdir and cd

This just cleans up the pipeline shell commands to avoid unnecissary
mkdir and cd invocations.

Based on feedback from @Keenuts. Thanks!

* Disable LLVM LIT tests that use garbage collection

DXC disabled support for the LLVM garbage collection intrinsics.
2022-12-02 12:55:14 -06:00
Chris B 7d9567cf80
Enable running tests under LIT (#4813)
* Enable running tests under LIT

If `CLANG_INCLUDE_TESTS=On`, the googletest unit tests are built as
part of the clang unit test suite. This allows them to run via lit
using the `check-clang-unit` target.

* Configure DXILConv tests to run under check-all
2022-11-29 18:59:16 -06:00
Helena Kotas cde8ccc93c
Fix ARM build break (#4823) 2022-11-29 10:37:10 -08:00
Chris B fb6b287c23
Remove DXC_BUILD_ARCH variable (#4156)
* Remove DXC_BUILD_ARCH variable

This commit simplifies the cross-targeting build support to not require
specifying the build architecture explicitly. Instead it is derived from
the build tools used in the generation.

I've tested this change locally for Win32, x64 and arm64.

* Special handling for arm64ec

* Bump required CMake to 3.10

CMake 3.10 is very old, but has a feature this PR uses. Raising the
requirement should have no impact on our users.

* Fix build issues caused by changes in CMake 3.10
2022-11-22 09:33:06 -06:00
Chris B 55be2117a6
[CMake] Simplify code coverage CMake configuration (#4793)
* [CMake] Simplify code coverage CMake configuration

This just addes an option processed by the CMake cache file to configure
code coverage for DXC. With this patch you can generate a coverage
report locally if you build with Clang using the following commnads:

cmake -G Ninja -DDXC_COVERAGE=On <other options> -C
<path to dxc>/cmake/caches/PredefinedParams.cmake <path to dxc>
ninja
ctest
ninja generate-coverage-report

* Adding code comment explaining caches

CMake cache scripts aren't super common, but are very useful. Adding a
comment to explain how they work is probably generally valuable.
2022-11-17 14:53:32 -06:00
Chris B 3962ff2f80
Bring in code coverage tooling (#4759)
This cherry-picks in a bunch of upstream LLVM changes and has a few small modifications for DXC.

* [CMake] Add LLVM_BUILD_INSTRUMENTED option to enable building with
-fprofile-instr-generate

This is the first step in supporting PGO data generation via CMake.
I've marked the option as advanced and experimental until it is fleshed
out further.

llvm-svn: 255298

* Add support for collating profiles for use with code coverage

Differential Revision: http://reviews.llvm.org/D20993

llvm-svn: 272599

Patch by: Vedant Kumar <vsk@apple.com>

* [CMake] Add targets for generating coverage reports

This is a pretty small bit of CMake goop to generate code coverage
reports. I always forget the right script invocation and end up
fumbling around too much.

Wouldn't it be great to have targets that "Just Work"?

Well, I thought so.

At present this only really works correctly for LLVM, but I'll extend
it in subsequent patches to work for subprojects.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D109019

* Update prepare-code-coverage.py from llvm/main

Theres's a swath of changes that went in here. Cherry-picking them all
indivudially is not worth it. Contained commits:

8773822c578a [Zequan Wu] [Utils] Add -compilation-dir flag to
prepare-code-coverage-artifact.py
577d59bc679d [Nico Weber] svn propset svn:executable on
utils/prepare-code-coverage-artifact.py
9a10eac663dd [Chris Bieneman] [Coverage] Apply filtered paths to summary
16776315460e [Vedant Kumar] [utils] coverage: Add help text about the
--restrict flag (NFC)
f4df0edf3ea3 [Vedant Kumar] [utils] Add a '--unified-report' option to
the code coverage prep script
7466987cb7ba [Vedant Kumar] [utils] Use print_function in the code
coverage prep script, NFC.
273b6dc3e2f7 [Vedant Kumar] [utils] Add an '--only-merge' option to the
code coverage prep script
547ebad0b984 [Vedant Kumar] [utils] Teach the code coverage prep script
about --restrict
05ee94f1b573 [Vedant Kumar] [utils] Generate html reports with the code
coverage utility script
d9aed82cf7e2 [Vedant Kumar] Add support for collating profiles for use
with code coverage

* HLSL-specific change to coverage reporting

This works around DXC not having a cmake target to run tests by
exposing a new variable which can configure which target gets run to
produce profiles. A similar change will be useful upstream, so I'll add
a change there too.
2022-11-15 12:17:03 -06:00
Paul Dodzweit 6dd7014f24
Allow host to be passed to CMake for cross compile (#3914)
Co-authored-by: Dodzweit, Paul <Paul.Dodzweit@amd.com>
2022-10-25 17:36:30 -07:00
Helena Kotas 60b1f859ae
Update build to Visual Studio 2022 (new default); remove VS 2017 support (#4726) 2022-10-17 18:49:35 -07:00
Marijn Suijten 47f31378a9
[Linux] WinAdapter: Remove virtual dtors from IUnknown to fix vtable ABI (#3793)
* WinAdapter: Remove virtual dtors from IUnknown to fix vtable ABI

The vtable for `IUnknown` and its subclasses contain two deletion
pointers when compiled on non-Windows systems with `IUnknown` from
`WinAdapter.h`:

    vtable for 'DxcLibrary' @ 0x7ffff7cbc5f8 (subobject @ 0x5555556bb9e0):
    [0]: 0x7ffff6a56d40 <DxcLibrary::QueryInterface(_GUID const&, void**)>
    [1]: 0x7ffff6a56d20 <DxcLibrary::AddRef()>
    [2]: 0x7ffff6a56d30 <DxcLibrary::Release()>
    [3]: 0x7ffff6b36bc0 <IUnknown::~IUnknown()> // Complete object destructor
    [4]: 0x7ffff6a57130 <DxcLibrary::~DxcLibrary()> // Deleting destructor
    [5]: 0x7ffff6a56d50 <DxcLibrary::SetMalloc(IMalloc*)>
    [6]: 0x7ffff6a56d60 <DxcLibrary::CreateBlobFromBlob(IDxcBlob*, unsigned int, unsigned int, IDxcBlob**)>
    ... More DxcLibrary virtual functions

This shifts the the pointers for functions for all subclasses, and is
[annoying] to deal with in otherwise cross-platform applications using
DirectXShaderCompiler as library.  `dxcompiler.dll` compiled on/for
Windows without `WinAdapter.h` does not suffer this problem, and only
has three function pointers for `IUnknown`.

Fortunately, it is easily solved by removing the virtual destructor from
`IUnknown`.  LLVM enables `-Wnon-virtual-dtor` that warns against
classes with virtual methods but no virtual destructor, though this
warning is best not enabled akin to Windows builds where `IUnknown` from
`windows.h` (`unknwn.h`) results in the same warning on MSVC ([1]/[2]).

[annoying]: 1e624792fc/src/unknown.rs
[1]: https://github.com/microsoft/DirectXShaderCompiler/issues/3783#issuecomment-844189358
[2]: https://godbolt.org/z/hKPT6ThEf

* WinAdapter: Make `IUnknown` and `IMalloc` pure-virtual classes

`IUnknown` in Windows' `unknwn.h` and `IMalloc` in `ObjIdl.h` are marked
as pure virtual, and are best marked as such in `WinAdapter` for
non-Windows platforms too [1].  Only the shim for `IMalloc` was relying
on the default refcounting implementation, all other subclasses either
contain pure-virtual methods themselves or provide an implementation for
`AddRef`/`Release` as required.  Likewise the default implementation for
`IMalloc` was only instantiated once by `CoGetMalloc`, and has been
moved into a local class implementing the `IMalloc` interface instead.

[1]: https://github.com/microsoft/DirectXShaderCompiler/pull/3793#issuecomment-846459741

* WinAdapter: Add three missing virtual functions to `IMalloc` interface

To prevent unexpected vtable breakage, add the missing functions from
the [documentation].  Note that they are listed in the wrong order, the
right order is retrieved from the `ObjIdl.h` header and implementations
for `IMalloc` in DirectXShaderCompiler.  All implementations are now
properly using the `override` keyword too, to enforce virtual method
existence in the base class.

[documentation]: https://docs.microsoft.com/en-us/windows/win32/api/objidl/nn-objidl-imalloc

* Make all WinAdapter destructions explicit

This prevents warnings about non-virtual destructor usage that trip up
the Linux build. It represents status quo on Windows.

Co-authored-by: Greg Roth <grroth@microsoft.com>
2022-10-13 10:19:39 -07:00
Chris B eb4d0ec385
Add `LLVM_OPTIMZIE_SANITIZED_BUIDS` option (#4667)
I added this upstream a few years ago so that you can control passing
`-O1` to the compiler when building debug sanitized builds. Without
being able to disable optimizing sanitizer builds it is really tricky to
debug sanitizer failures, but without optimizing the build ASan builds
take _forever_ to run tests which makes them difficult to use.
2022-09-19 10:13:24 -05:00
Chris B 79856c4a74
Add option to enable LTO/LTCG (#4646)
This adds a new option to the build to enable link-time optimzied builds
of DXC. On Windows with MSVC this seems to give about a 4% runtime
performance boost on my one locally run test case... and on Linux I'm
seeing about 6% on that same locally run test case.

LTO/LTCG is enabled by default for "Official" builds.

It's free performance so yay :D
2022-09-13 13:04:23 -05:00
Helena Kotas e578f266af
Remove lookup of full paths of D3D12 libraries (#4642)
Let the build system find the libraries based on the Windows SDK used.
Enables use of Windows SDK from nuget packages.
2022-09-09 17:54:10 -07:00
Jakub Kuderski 9ff4815c86
[cmake] Allow to set C/C++ linker (#4462)
Backport an LLVM cmake option to specify the C/C++ linker to use.
This implementation is simplified and unlike the llvm-project one
does not contain any linker-specific tweaks.

On my system, setting `-DLLVM_USE_LINKER=mold` reduces the full build
time from 81s to 43s.
2022-05-18 13:04:28 -04:00
Chris B fb873d0a14
Clean up debug preprocessor macros (#4305)
* Clean up debug preprocessor macros

This change removes the `DBG` macro value in favor of `NDEBUG`, and
also converts many uses of `_DEBUG` with `NDEBUG`.

_DEBUG is set by MSVC when debug information generation is enabled.
NDEBUG is set by CMake debug configurations and by LLVM on all
configurations when `LLVM_ENABLE_ASSERTIONS` is set.

Aligning with LLVM's NDEBUG usage allows a consistent pattern
throughout the codebase.

* Address PR feedback
2022-03-02 14:55:24 -06:00
Tex Riddell 6f766ed828
New HLSL_AGILITYSDK_DIR and HLSLHost dependency copying help. (#4297)
Use environment variable HLSL_AGILITYSDK_DIR which you can point to
extracted contents of an AgilitySDK.
Automatically copy binaries to appropriate location when set.

Look for MinTe binary set from TAEF.  If found, set a local TAEF binary
location.
If this is set when running execution tests, copy MinTe there, and if the
HLSL_AGILITYSDK_DIR was set, also copy agility SDK binaries under the
.\D3D12\ subdir there, so the test can automatically pick it up.

Add hctbins.cmd to copy extra bins necessary for running things out of
the ...\bin or ...\test directories such as HLSLHost.exe.  This includes
AgilitySDK bins if set.

Update FindTAEF.cmake to set binary dir based on HLSL_TAEF_DIR

Since we don't actually support a single project building to multiple
architectures, we look for te.exe in x86 OR x64 subdir.
Whichever one is set in hctstart.cmd should be the one that will be used.
2022-02-24 14:04:52 -08:00
Jaebaek Seo d996e8b339
Fix build failure for Linux clang 13.0.0-9+build1 (#4213) 2022-01-28 11:44:48 -05:00