Skip to content

Commit

Permalink
add windows c# ci job
Browse files Browse the repository at this point in the history
fix #4184
  • Loading branch information
vigsterkr committed Jan 10, 2019
1 parent 78e6f3c commit f8eb80b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
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

0 comments on commit f8eb80b

Please sign in to comment.