Update DxDispatch to fix Bin Skim errors (#557)
Update code for binskim by changing MSVC compile and linker options. Needed to update FMT dependency as well to to fix build error with new flags. --------- Co-authored-by: Christian Larson (from Dev Box) <28911437+chrilaMSFT@users.noreply.github.com>
This commit is contained in:
Родитель
aa9982c1ae
Коммит
586759eec7
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.18)
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
project(dxdispatch VERSION 0.16.5 LANGUAGES CXX)
|
||||
|
||||
# ==============================================================================
|
||||
|
@ -58,6 +58,14 @@ get_target_property(onnxruntime_type onnxruntime DX_COMPONENT_CONFIG)
|
|||
include(cmake/onnxruntime_extensions.cmake)
|
||||
add_onnxruntime_extensions_target(onnxruntime_extensions CACHE_PREFIX DXD)
|
||||
|
||||
# ==============================================================================
|
||||
# Global Defines for CMAKE
|
||||
# ==============================================================================
|
||||
if(MSVC)
|
||||
add_compile_options(/guard:cf /Qspectre /GS /sdl )
|
||||
add_link_options(/GUARD:CF /DYNAMICBASE )
|
||||
endif()
|
||||
|
||||
# ==============================================================================
|
||||
# Model Library
|
||||
# ==============================================================================
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FetchContent_Declare(
|
||||
fmt
|
||||
GIT_REPOSITORY https://github.com/fmtlib/fmt
|
||||
GIT_TAG 7.1.3
|
||||
GIT_TAG 10.2.1
|
||||
)
|
||||
|
||||
set(FMT_DOC OFF CACHE INTERNAL "Generate the doc target.")
|
||||
|
|
|
@ -20,7 +20,7 @@ static void __stdcall DebugMessageCallback(D3D12_MESSAGE_CATEGORY cat, D3D12_MES
|
|||
if (context)
|
||||
{
|
||||
auto logger = (IDxDispatchLogger*)context;
|
||||
auto fmtMessage = fmt::format("{} {} {} {}", cat, id, context, message);
|
||||
auto fmtMessage = fmt::format("{} {} {} {}", int(cat), int(id), context, message);
|
||||
if ((D3D12_MESSAGE_SEVERITY_INFO == sev) ||
|
||||
(D3D12_MESSAGE_SEVERITY_MESSAGE == sev))
|
||||
{
|
||||
|
|
|
@ -51,8 +51,9 @@ std::optional<ModuleInfo> GetModuleInfo(gsl::czstring<> moduleName)
|
|||
}
|
||||
|
||||
// Query the product version string using the language & codepage.
|
||||
auto query = fmt::format(L"\\StringFileInfo\\{0:04x}{1:04x}\\ProductVersion", languageCode, translationData->codePage);
|
||||
|
||||
auto temp = fmt::format("\\StringFileInfo\\{0:04x}{1:04x}\\ProductVersion", languageCode, translationData->codePage);
|
||||
std::wstring query(temp.begin(), temp.end());
|
||||
|
||||
LPVOID productVersionStringDataStart = nullptr;
|
||||
UINT productVersionStringDataSizeInChars = 0;
|
||||
if (VerQueryValueW(versionInfo.data(),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
||||
#define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING
|
||||
#define NOMINMAX
|
||||
#define NODRAWTEXT
|
||||
#define NOGDI
|
||||
|
|
|
@ -1611,7 +1611,7 @@ std::string GetJsonParseErrorMessage(
|
|||
int(jsonDocument.GetErrorOffset()),
|
||||
line + 1,
|
||||
column + 1,
|
||||
jsonDocument.GetParseError(),
|
||||
int(jsonDocument.GetParseError()),
|
||||
rapidjson::GetParseError_En(jsonDocument.GetParseError()),
|
||||
newLineStrippedText.c_str()
|
||||
);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#define NOMINMAX
|
||||
|
||||
#define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
|
||||
#ifndef WIN32
|
||||
#include <wsl/winadapter.h>
|
||||
#include "directml_guids.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче