Skip to content
Merged
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
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ on:
pull_request:
# Build manually
workflow_dispatch:
# Build on a schedule to keep up with the engine changes.
schedule:
- cron: '0 0 * * 0'

env:
# Common settings.
CMAKE_VERSION: 3.21.x
CMAKE_VERSION: 3.24.x
RBFX_REPOSITORY: ${{ vars.RBFX_REPOSITORY || 'rbfx/rbfx' }}
# Common paths.
ci_source_dir: ${{ github.workspace }}/source-code
ci_build_script: ./source-code/ci_build.sh
Expand Down Expand Up @@ -47,7 +45,7 @@ jobs:

env:
ci_platform: windows
ci_target_sdk_name: rebelfork-sdk-windows-msvc-x64-lib-latest
ci_target_sdk_name: rebelfork-sdk-windows-msvc-x64-dll-latest
ci_upload_release: ${{
(github.repository == 'rbfx/Core.SamplePlugin') &&
(github.ref == 'refs/heads/master')
Expand All @@ -64,11 +62,13 @@ jobs:
- name: Download target SDK
uses: robinraju/release-downloader@v1.8
with:
repository: rbfx/rbfx
repository: ${{ env.RBFX_REPOSITORY }}
tag: latest
fileName: ${{ env.ci_target_sdk_name }}.7z

- name: Unzip target SDK
- name: Extract target SDK
shell: bash
working-directory: ${{ github.workspace }}
run: |
cd '${{ github.workspace }}'
7z x '${{ env.ci_target_sdk_name }}.7z' '-o${{ github.workspace }}' -y
Expand Down
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.24)
project (Plugin.Core.SamplePlugin)

# Top-level plugin build is not supported yet.
# If the plugin is only built as subdirectory, this snippet is not needed and may be discarded.
# Top-level plugin build. If the plugin is only built as subdirectory, this snippet is not needed and may be discarded.
if (PROJECT_IS_TOP_LEVEL)
set (CMAKE_CXX_STANDARD 17)
find_package (Urho3D REQUIRED)
# C# bindings are optional. They are in the rbfx-csharp repository.
find_package (Urho3DNet QUIET)
endif ()

file (GLOB SOURCE_FILES *.h *.cpp)
add_plugin (${PROJECT_NAME} "${SOURCE_FILES}")

if (URHO3D_CSHARP)
if (Urho3DNet_FOUND)
set (DEST_BIN_DIR_CONFIG bin)
set (DEST_LIBRARY_DIR_CONFIG bin)
target_include_directories (${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
Expand All @@ -21,7 +22,7 @@ if (URHO3D_CSHARP)
CSPROJ ${CMAKE_CURRENT_SOURCE_DIR}/CSharp/Plugin.csproj
NAMESPACE Urho3DNet
)
endif ()

# Generate Visual Studio props file for csproj.
rbfx_configure_cmake_props()
# Generate Visual Studio props file for csproj.
rbfx_configure_cmake_props()
endif ()
8 changes: 4 additions & 4 deletions CSharp/Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<Output TaskParameter="Include" ItemName="Compile" />
</CreateItem>
</Target>
<ItemGroup Condition=" '$(Urho3D_IS_SDK)' == 'ON' ">
<ItemGroup Condition=" '$(Urho3DNet_IS_SDK)' == 'ON' ">
<Reference Include="Urho3DNet">
<HintPath>$(Urho3D_PACKAGE_ROOT)/bin/$(Configuration)/Urho3DNet.dll</HintPath>
<HintPath>$(Urho3DNet_PACKAGE_ROOT)/bin/$(Configuration)/Urho3DNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Urho3D_IS_SDK)' != 'ON' ">
<ProjectReference Include="$(Urho3D_SOURCE_DIR)/CSharp/Urho3DNet.csproj" />
<ItemGroup Condition=" '$(Urho3DNet_IS_SDK)' != 'ON' ">
<ProjectReference Include="$(Urho3DNet_SOURCE_DIR)/Source/Urho3DNet/Urho3DNet.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion CSharp/Plugin.i
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "SampleComponent.h"

using namespace Urho3D;
#include <Urho3D/CSharp/Native/SWIGHelpers.h>
#include <Urho3DNet/Native/SWIGHelpers.h>
%}
#define PLUGIN_CORE_SAMPLEPLUGIN_API
%import "Urho3D.i"
Expand Down
1 change: 1 addition & 0 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function action-generate() {
"-A"
"x64"
"-DCMAKE_BUILD_TYPE=${build_config[$ci_platform]}"
"-DBUILD_SHARED_LIBS=ON"
"-DCMAKE_PREFIX_PATH=$ci_target_sdk_dir/share"
)
else
Expand Down
Loading