Skip to content

Commit

Permalink
Apply changes from branch actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Steinbeck committed Mar 22, 2022
1 parent 42cf0ec commit d7a2560
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
35 changes: 34 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
arch: [ARM, ARM64, x64]
arch: [ARM, ARM64]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -289,6 +289,39 @@ jobs:
path: ${{runner.workspace}}/${{github.event.repository.name}}/tools/ci/tinyspline/
if-no-files-found: error

test-csharp:
needs: [package]
runs-on: ${{ matrix.os }}
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Download Packages
uses: actions/download-artifact@v2
with:
path: packages

- name: Install Package
shell: bash
run: |
mkdir -p $GITHUB_WORKSPACE/build
find $GITHUB_WORKSPACE/packages/tinyspline -name '*.nupkg' -exec cp {} $GITHUB_WORKSPACE/build \;
- name: Run Tests
shell: bash
run: |
cd $GITHUB_WORKSPACE/test/csharp
dotnet test
test-java:
needs: [package]
runs-on: ${{ matrix.os }}
Expand Down
15 changes: 13 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ set(TINYSPLINE_RUBY_CMAKE_TARGET "tinysplineruby" CACHE INTERNAL "")
###############################################################################
option(BUILD_SHARED_LIBS "Build the C/C++ interface as shared library." FALSE)

set(TINYSPLINE_BINDING_LINK_LIBRARIES "" CACHE STRING
"Additional libraries to link against when building one of the bindings")

set(TINYSPLINE_INSTALL_INCLUDE_DIR "include" CACHE STRING
"Installation directory of header files (relative to CMAKE_INSTALL_PREFIX).")

Expand Down Expand Up @@ -1044,7 +1047,8 @@ function (tinyspline_add_swig_library)
# On Linux, we can (and for the sake of portability should) omit
# linking libraries.
if(NOT ${TINYSPLINE_PLATFORM_NAME} STREQUAL "linux")
swig_link_libraries(${ARGS_TARGET} ${ARGS_LIBS})
swig_link_libraries(${ARGS_TARGET} ${ARGS_LIBS}
${TINYSPLINE_BINDING_LINK_LIBRARIES})
endif()
set_target_properties(${ARGS_TARGET} PROPERTIES
FOLDER ${TINYSPLINE_BINDINGS_FOLDER_NAME}
Expand All @@ -1068,6 +1072,12 @@ function (tinyspline_add_swig_library)
APPEND PROPERTY PREFIX "lib")
endif()
endif()
# Fix library suffix for C# on macOS.
if(${ARGS_LANG} STREQUAL "csharp" AND
${TINYSPLINE_PLATFORM_NAME} STREQUAL "macosx")
set_property(TARGET ${ARGS_TARGET}
APPEND PROPERTY SUFFIX ".dylib")
endif()
if (NOT ${ARGS_NAME} STREQUAL "")
set_property(TARGET ${ARGS_TARGET}
APPEND PROPERTY OUTPUT_NAME "${ARGS_NAME}")
Expand Down Expand Up @@ -1584,7 +1594,7 @@ target=\"runtimes/${TINYSPLINE_NUGET_RID}/native\" />")
set(TINYSPLINE_NUGET_FILES
"${TINYSPLINE_NUGET_FILES}\n\t\t<file \
src=\"${TINYSPLINE_LIB_DIR}/${lib}\" \
target=\"runtimes/${TINYSPLINE_NUGET_RID}/lib/native\" />")
target=\"runtimes/${TINYSPLINE_NUGET_RID}/native\" />")
endforeach()
configure_file("pkg/.nuspec.in"
${TINYSPLINE_NUSPEC_FILE} @ONLY)
Expand Down Expand Up @@ -1696,6 +1706,7 @@ Compiler Configuration:
C++ libraries: ${TINYSPLINE_CXX_LINK_LIBRARIES}
C++ Definitions: ${TINYSPLINE_CXX_DEFINITIONS}
Binding flags: ${TINYSPLINE_SUMMARY_BINDING_FLAGS}
Binding libraries: ${TINYSPLINE_BINDING_LINK_LIBRARIES}
Binding Definitions: ${TINYSPLINE_BINDING_CXX_DEFINITIONS}
Runtime libs: ${TINYSPLINE_RUNTIME_LIBS}
Toolchain file: ${CMAKE_TOOLCHAIN_FILE}
Expand Down
1 change: 1 addition & 0 deletions test/csharp/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<packageSources>
<clear />
<add key="local" value="../../build" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion test/csharp/csharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="coverlet.collector" Version="3.1.0" />
<PackageReference Include="tinyspline" />
<PackageReference Include="tinyspline" version="*" />
</ItemGroup>

</Project>

0 comments on commit d7a2560

Please sign in to comment.