Merged PR 3991172: Create Azure Pipelines YAML script for Windows build

This change adds a YAML script to enable building CMake for AMD64 Windows 10 in Azure Dev Ops. This build should occur automatically for all pull requests into master, and whenever master changes (whether due to a PR or a force push, etc).

Also removed the dependency on `ntintsafe.h`, which was not actually being used. (Maybe Changyu removed calls to its functions it when he did the Linux port?)
This commit is contained in:
Mitch Lindgren 🦎 2019-11-08 21:17:09 +00:00
Родитель c1a9027961
Коммит 9ec45fc43a
9 изменённых файлов: 33 добавлений и 32 удалений

Просмотреть файл

@ -2,7 +2,10 @@ cmake_minimum_required(VERSION 2.8.9)
add_compile_options(-DSYMCRYPT_IGNORE_PLATFORM) add_compile_options(-DSYMCRYPT_IGNORE_PLATFORM)
if(NOT WIN32) if(WIN32)
# Require Windows 10 SDK version 18362 for BCRYPT_TLS_CBC_HMAC_VERIFY_FLAG
set(CMAKE_SYSTEM_VERSION 10.0.18362)
else()
add_compile_options(-Wno-deprecated-declarations -Wno-deprecated) add_compile_options(-Wno-deprecated-declarations -Wno-deprecated)
add_compile_options(-g) add_compile_options(-g)
add_compile_options(-Wno-multichar) add_compile_options(-Wno-multichar)

29
azure-pipelines.yml Normal file
Просмотреть файл

@ -0,0 +1,29 @@
trigger:
- master
pr:
- master
jobs:
- job: Windows
pool:
vmImage: 'windows-2019'
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
submodules: recursive
# Initialize CMake
- task: CMake@1
inputs:
workingDirectory: 'bin'
cmakeArgs: '..'
# Build with CMake
- task: CMake@1
inputs:
workingDirectory: 'bin'
cmakeArgs: '--build .'
- script: |
cd bin\unittest\exe_test\Debug
.\symcryptunittest_generic.exe
displayName: 'Execute generic unit test'
name: 'WindowsGenericUnitTest'

Просмотреть файл

@ -5,10 +5,6 @@ Copyright (c) Microsoft Corporation. Licensed under the MIT license.
*/ */
#include <ntstatus.h> #include <ntstatus.h>
#pragma prefast(push)
#pragma prefast(disable: 26071, "Avoid error in validation of RtlULongLongMult")
#include <ntintsafe.h>
#pragma prefast(pop)
// Ensure that windows.h doesn't re-define the status_* symbols // Ensure that windows.h doesn't re-define the status_* symbols
#define WIN32_NO_STATUS #define WIN32_NO_STATUS

Просмотреть файл

@ -7,9 +7,6 @@ set_source_files_properties(symcryptunittest.rc PROPERTIES LANGUAGE RC)
add_compile_options(-DTESTDRIVER_NAME=\"SymCryptDriver_win7nlater.sys\") add_compile_options(-DTESTDRIVER_NAME=\"SymCryptDriver_win7nlater.sys\")
# Workaround for including ntintsafe.h
add_compile_options(-DCMAKE_COMPILE)
include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc) include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc)
add_executable(symcryptunittest_win7nlater ${SOURCES}) add_executable(symcryptunittest_win7nlater ${SOURCES})

Просмотреть файл

@ -7,9 +7,6 @@ set_source_files_properties(symcryptunittest.rc PROPERTIES LANGUAGE RC)
add_compile_options(-DTESTDRIVER_NAME=\"SymCryptDriver_win7nlater.sys\") add_compile_options(-DTESTDRIVER_NAME=\"SymCryptDriver_win7nlater.sys\")
# Workaround for including ntintsafe.h
add_compile_options(-DCMAKE_COMPILE)
include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc) include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc)
add_executable(symcryptunittest_win8_1nlater ${SOURCES}) add_executable(symcryptunittest_win8_1nlater ${SOURCES})

Просмотреть файл

@ -7,9 +7,6 @@ set_source_files_properties(symcryptunittest.rc PROPERTIES LANGUAGE RC)
add_compile_options(-DTESTDRIVER_NAME=\"SymCryptDriver_legacy.sys\") add_compile_options(-DTESTDRIVER_NAME=\"SymCryptDriver_legacy.sys\")
# Workaround for including ntintsafe.h
add_compile_options(-DCMAKE_COMPILE)
include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc) include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc)
add_executable(symcryptunittest_legacy ${SOURCES}) add_executable(symcryptunittest_legacy ${SOURCES})

Просмотреть файл

@ -7,9 +7,6 @@ set_source_files_properties(symcryptunittest.rc PROPERTIES LANGUAGE RC)
add_compile_options(-DTESTDRIVER_NAME=\"SymCryptDriver_test.sys\") add_compile_options(-DTESTDRIVER_NAME=\"SymCryptDriver_test.sys\")
# Workaround for including ntintsafe.h
add_compile_options(-DCMAKE_COMPILE)
include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc) include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc)
add_executable(symcryptunittest_generic ${SOURCES}) add_executable(symcryptunittest_generic ${SOURCES})

Просмотреть файл

@ -161,14 +161,6 @@
#define Sleep(x) sleep((x)/1000) #define Sleep(x) sleep((x)/1000)
#else #else
#include <ntstatus.h> #include <ntstatus.h>
#pragma prefast(push)
#pragma prefast(disable: 26071, "Avoid error in validation of RtlULongLongMult")
#ifdef CMAKE_COMPILE
#include <../km/ntintsafe.h>
#else
#include <ntintsafe.h>
#endif
#pragma prefast(pop)
// Ensure that windows.h doesn't re-define the status_* symbols // Ensure that windows.h doesn't re-define the status_* symbols
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
@ -245,11 +237,6 @@ extern "C"
//#include <nturtl.h> //#include <nturtl.h>
#include <ntstatus.h> #include <ntstatus.h>
#pragma prefast(push)
#pragma prefast(disable: 26071, "Avoid error in validation of RtlULongLongMult")
#include <ntintsafe.h>
#pragma prefast(pop)
// Ensure that windows.h doesn't re-define the status_* symbols // Ensure that windows.h doesn't re-define the status_* symbols
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include <windows.h> #include <windows.h>

Просмотреть файл

@ -60,8 +60,6 @@ include_directories(${CMAKE_SOURCE_DIR}/SymCryptDependencies/inc)
if(WIN32) if(WIN32)
# DNDEBUG is required to link with msbignum. This should eventually be removed. # DNDEBUG is required to link with msbignum. This should eventually be removed.
add_compile_options(-DNDEBUG) add_compile_options(-DNDEBUG)
# Workaround for including ntintsafe.h
add_compile_options(-DCMAKE_COMPILE)
add_compile_options(-D_CRT_SECURE_NO_WARNINGS) add_compile_options(-D_CRT_SECURE_NO_WARNINGS)
else() else()
add_compile_options(-Wno-write-strings) add_compile_options(-Wno-write-strings)