mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
[build] Add Azure build using cmake on Windows (#2588)
More people are starting to use this build, so make sure it doesn't break. Also tests that build succeeds with OpenCV 4.
This commit is contained in:
@@ -23,6 +23,8 @@ trigger:
|
||||
stages:
|
||||
- stage: Build
|
||||
jobs:
|
||||
- template: azure-templates/job-build-vcpkg.yml
|
||||
|
||||
- template: azure-templates/job-build.yml
|
||||
parameters:
|
||||
jobName: Linux_Arm
|
||||
|
||||
26
azure-templates/job-build-vcpkg.yml
Normal file
26
azure-templates/job-build-vcpkg.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
jobs:
|
||||
- job: Windows_CMake
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
|
||||
variables:
|
||||
vcpkgGitRef: 544f8e4593764f78faa94bac2adb81cca5232943
|
||||
|
||||
steps:
|
||||
- task: Cache@2
|
||||
displayName: Cache vcpkg
|
||||
inputs:
|
||||
key: $(Build.SourcesDirectory)/azure-templates/vcpkg_x64-windows.txt | "$(vcpkgGitCommitId)" | "$(Agent.OS)"
|
||||
path: '$(Build.BinariesDirectory)/vcpkg'
|
||||
- task: run-vcpkg@0
|
||||
displayName: Run vcpkg
|
||||
inputs:
|
||||
vcpkgArguments: '@$(Build.SourcesDirectory)/azure-templates/vcpkg_x64-windows.txt'
|
||||
vcpkgGitCommitId: $(vcpkgGitRef)
|
||||
- task: run-cmake@0
|
||||
displayName: Build With CMake
|
||||
inputs:
|
||||
cmakeListsOrSettingsJson: 'CMakeListsTxtAdvanced'
|
||||
vcpkgTriplet: '$(RUNVCPKG_VCPKG_TRIPLET)'
|
||||
useVcpkgToolchainFile: true
|
||||
cmakeAppendedArgs: '-DWITHOUT_JAVA=ON -DWITHOUT_ALLWPILIB=OFF -DWITHOUT_CSCORE=OFF'
|
||||
3
azure-templates/vcpkg_x64-windows.txt
Normal file
3
azure-templates/vcpkg_x64-windows.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
--triplet
|
||||
x64-windows
|
||||
opencv
|
||||
@@ -64,7 +64,11 @@ if (NOT WITHOUT_JAVA)
|
||||
|
||||
execute_process(COMMAND python3 ${CMAKE_SOURCE_DIR}/wpiutil/generate_numbers.py ${CMAKE_BINARY_DIR}/wpiutil RESULT_VARIABLE generateResult)
|
||||
if(NOT (generateResult EQUAL "0"))
|
||||
message(FATAL_ERROR "python3 generate_numbers.py failed")
|
||||
# Try python
|
||||
execute_process(COMMAND python ${CMAKE_SOURCE_DIR}/wpiutil/generate_numbers.py ${CMAKE_BINARY_DIR}/wpiutil RESULT_VARIABLE generateResult)
|
||||
if(NOT (generateResult EQUAL "0"))
|
||||
message(FATAL_ERROR "python and python3 generate_numbers.py failed")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_JNI_TARGET true)
|
||||
@@ -171,7 +175,7 @@ set_property(TARGET wpiutil PROPERTY FOLDER "libraries")
|
||||
|
||||
target_compile_features(wpiutil PUBLIC cxx_std_17)
|
||||
if (MSVC)
|
||||
target_compile_options(wpiutil PUBLIC /permissive- /Zc:throwingNew)
|
||||
target_compile_options(wpiutil PUBLIC /permissive- /Zc:throwingNew /MP)
|
||||
target_compile_definitions(wpiutil PRIVATE -D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
wpilib_target_warnings(wpiutil)
|
||||
|
||||
Reference in New Issue
Block a user