Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add windows c# ci job #4456

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .ci/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,33 @@ jobs:

steps:
- template: ./windows-steps.yml

- job: windows_swig
displayName: Windows SWIG Interface
dependsOn: windows_libshogun
timeoutInMinutes: 120

pool:
vmImage: 'vs2017-win2016'

strategy:
matrix:
csharp:
cmakeOptions: '$(commonSWIGCMakeFlags) -DINTERFACE_CSHARP=ON'
interfaceName: 'csharp'

variables:
targetPrefix: '$(Build.BinariesDirectory)\\opt'
libshogunArtifactName: 'libshogun-vs17'
libshogunArchive: '$(Build.ArtifactStagingDirectory)/libshogun-$(Build.BuildId).tar.gz'
commonSWIGCMakeFlags: '-DLIBSHOGUN=OFF -DDISABLE_UNIT_TESTS=ON -DDISABLE_META_CPP=ON'
clcacheDir: 'C:\\Users\\VssAdministrator\\clcache'
clcacheArtifactName: 'clcache-$(interfaceName)'
clcacheArchive: '$(Build.ArtifactStagingDirectory)/clcache-$(Build.BuildId).tar.gz'
buildConfiguration: Release
buildPlatform: x64

steps:
- template: ./windows-steps.yml
parameters:
swig: true
2 changes: 1 addition & 1 deletion .ci/windows-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ steps:
displayName: 'Build ($(buildConfiguration) $(buildPlatform))'
workingDirectory: $(Build.SourcesDirectory)\build

- script: ctest -j 2
- script: ctest --output-on-failure -j 2
displayName: Test
workingDirectory: $(Build.SourcesDirectory)\build

Expand Down
2 changes: 1 addition & 1 deletion cmake/FindCSharp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ endif( )


FIND_PACKAGE_HANDLE_STANDARD_ARGS(CSharp FOUND_VAR CSHARP_FOUND
REQUIRED_VARS CSHARP_TYPE CSHARP_COMPILER CSHARP_INTERPRETER
REQUIRED_VARS CSHARP_TYPE CSHARP_COMPILER
VERSION_VAR CSHARP_VERSION)

mark_as_advanced( CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER CSHARP_INTERPRETER CSHARP_PLATFORM CSHARP_SDK )
Expand Down
2 changes: 1 addition & 1 deletion examples/meta/csharp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FOREACH(META_EXAMPLE ${META_EXAMPLES})
set(CSHARP_META_EXAMPLE_SOURCE ${CMAKE_BINARY_DIR}/examples/meta/csharp/${EXAMPLE_REL_DIR}/${EXAMPLE_NAME}.cs)

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE_REL_DIR}/${EXAMPLE_NAME}.exe
COMMAND ${CSHARP_COMPILER} ${EXAMPLE_NAME}.cs ${CSHARP_FLAGS} -out:${EXAMPLE_NAME}.exe
COMMAND ${CSHARP_COMPILER} ${CSHARP_FLAGS} -out:${EXAMPLE_NAME}.exe ${EXAMPLE_NAME}.cs
DEPENDS interface_csharp shogun::shogun meta_examples ${CSHARP_META_EXAMPLE_SOURCE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE_REL_DIR})

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/csharp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GENERATE_INTERFACE_TARGET(csharp ${CMAKE_CURRENT_SOURCE_DIR} "")

ADD_CUSTOM_COMMAND(TARGET interface_csharp
POST_BUILD
COMMAND "${CSHARP_COMPILER}" /t:library *.cs /out:shogun.dll
COMMAND "${CSHARP_COMPILER}" /t:library /out:shogun.dll *.cs
COMMENT "Creating shogun.dll")
IF(NOT CSHARP_INSTALL_DIR)
SET(CSHARP_INSTALL_DIR "lib/cli/shogun")
Expand Down