Cleanup cmake file (#17154)

### Description
1. Clean up cmake files. Remove some unused code
2. Remove the "Semmle" task from
tools/ci_build/github/azure-pipelines/templates/win-ci.yml. Semmle is
deprecated and replaced by CodeQL.
This commit is contained in:
Changming Sun 2023-08-15 10:51:33 -07:00 committed by GitHub
parent 2a22325005
commit 8e203efc69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 45 deletions

View file

@ -2,12 +2,7 @@
# Licensed under the MIT License.
# Minimum CMake required
if(WIN32)
# TODO: actually we need cmake 3.26+ on Windows but QNN EP's build machine doesn't have it
cmake_minimum_required(VERSION 3.25)
else()
cmake_minimum_required(VERSION 3.26)
endif()
cmake_minimum_required(VERSION 3.26)
cmake_policy(SET CMP0069 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
@ -19,13 +14,7 @@ cmake_policy(SET CMP0117 NEW)
cmake_policy(SET CMP0104 OLD)
# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.26.0")
cmake_policy(SET CMP0141 NEW)
else()
cmake_policy(SET CMP0141 OLD)
endif()
endif()
cmake_policy(SET CMP0141 NEW)
# Project
project(onnxruntime C CXX ASM)

View file

@ -228,25 +228,12 @@ if (MSVC)
endif()
if (onnxruntime_target_platform STREQUAL "ARM64")
set(onnxruntime_target_platform "ARM64")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.26.0")
enable_language(ASM_MARMASM)
else()
enable_language(ASM_MASM)
endif()
enable_language(ASM_MARMASM)
elseif (onnxruntime_target_platform STREQUAL "ARM64EC")
set(onnxruntime_target_platform "ARM64EC")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.26.0")
enable_language(ASM_MARMASM)
else()
enable_language(ASM_MASM)
endif()
enable_language(ASM_MARMASM)
elseif (onnxruntime_target_platform STREQUAL "ARM" OR CMAKE_GENERATOR MATCHES "ARM")
set(onnxruntime_target_platform "ARM")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.26.0")
enable_language(ASM_MARMASM)
else()
enable_language(ASM_MASM)
endif()
enable_language(ASM_MARMASM)
elseif (onnxruntime_target_platform STREQUAL "x64" OR onnxruntime_target_platform STREQUAL "x86_64" OR onnxruntime_target_platform STREQUAL "AMD64" OR CMAKE_GENERATOR MATCHES "Win64")
set(onnxruntime_target_platform "x64")
enable_language(ASM_MASM)

View file

@ -251,18 +251,6 @@ stages:
artifactName: 'drop-onnxruntime-java-win-${{ parameters.packageName }}'
- ${{ if eq(parameters['DoCompliance'], 'true') }}:
- task: Semmle@0
condition: and(succeeded(), eq('${{ parameters.buildJava}}', true))
inputs:
sourceCodeDirectory: '$(Build.SourcesDirectory)\java'
language: 'java'
cleanupBuildCommands: '$(Build.SourcesDirectory)\java\gradlew.bat -Dorg.gradle.daemon=false clean'
buildCommands: '$(Build.SourcesDirectory)\java\gradlew.bat -Dorg.gradle.daemon=false jar'
querySuite: 'Recommended'
timeout: '7200'
ram: '16384'
addProjectDirToScanningExclusionList: true
- task: CredScan@3
displayName: 'Run CredScan'
inputs:
@ -291,10 +279,7 @@ stages:
inputs:
msBuildArchitecture: amd64
setupCommandlines: 'python $(Build.SourcesDirectory)\tools\ci_build\build.py --config Debug --disable_rtti --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "$(VSGenerator)" --enable_onnx_tests $(TelemetryOption) ${{ parameters.buildparameter }} --cmake_extra_defines onnxruntime_ENABLE_STATIC_ANALYSIS=ON'
${{if eq(variables.VSGenerator, 'Visual Studio 16 2019')}}:
msBuildCommandline: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe" "$(Build.BinariesDirectory)\Debug\onnxruntime.sln" /p:platform="$(MsbuildPlatform)" /p:configuration=Debug /p:VisualStudioVersion="16.0" /m /p:PreferredToolArchitecture=x64'
${{else}}:
msBuildCommandline: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe" "$(Build.BinariesDirectory)\Debug\onnxruntime.sln" /p:platform="$(MsbuildPlatform)" /p:configuration=Debug /p:VisualStudioVersion="17.0" /m /p:PreferredToolArchitecture=x64'
msBuildCommandline: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe" "$(Build.BinariesDirectory)\Debug\onnxruntime.sln" /p:platform="$(MsbuildPlatform)" /p:configuration=Debug /p:VisualStudioVersion="17.0" /m /p:PreferredToolArchitecture=x64'
excludedPaths: '$(Build.BinariesDirectory)#$(Build.SourcesDirectory)\cmake#C:\program files (x86)'
- task: PostAnalysis@2