Skip to content

Commit 92ec532

Browse files
committed
Fixed some CMakeLists.txt errors in GameFramework
1 parent f488098 commit 92ec532

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/Managed/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ cmake_minimum_required(VERSION 3.8)
22
project(GameFramework NONE)
33

44
set(CSHARP_PROJECT ExeonScript.csproj)
5-
set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
5+
set(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
66

77
add_custom_command(
8-
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ExeonScript.dll
8+
OUTPUT ${OUTPUT_DIR}/ExeonScript.dll
99
COMMAND dotnet build ${CSHARP_PROJECT} --configuration Debug /p:OutputPath=${OUTPUT_DIR}
1010
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
1111
COMMENT "Compiling C# scripts..."
1212
)
1313

1414
add_custom_target(GameFramework ALL
15-
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ExeonScript.dll
15+
DEPENDS ${OUTPUT_DIR}/ExeonScript.dll
1616
)

src/Managed/ExeonScript.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using System;
22

3-
public class ExeonScript
3+
namespace Exeon
44
{
5-
public static void Init()
5+
public class ExeonScript
66
{
7-
Console.WriteLine("Hello from C#!");
7+
public static void Init()
8+
{
9+
Console.WriteLine("Debug");
10+
}
811
}
912
}

src/Managed/ExeonScript.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
11+
1212
</ItemGroup>
1313

1414
</Project>

src/private/Runtime/MonoScript.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ MonoScript::MonoScript() {
99
this->m_domain = nullptr;
1010
this->m_asm = nullptr;
1111
this->m_image = nullptr;
12-
this->m_filename = "GameScripts.dll";
12+
this->m_filename = "Managed/ExeonScript.dll";
1313
}
1414

1515
void MonoScript::Init() {
@@ -36,7 +36,7 @@ void MonoScript::Init() {
3636

3737
this->m_image = mono_assembly_get_image(this->m_asm);
3838

39-
MonoClass* gameScriptClass = mono_class_from_name(this->m_image, "", "ExeonScript");
39+
MonoClass* gameScriptClass = mono_class_from_name(this->m_image, "Exeon", "ExeonScript");
4040
MonoMethod* initMethod = mono_class_get_method_from_name(gameScriptClass, "Init", 0);
4141
if(!initMethod) {
4242
spdlog::error("Error calling Init Method");

0 commit comments

Comments
 (0)