diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-06-30 20:31:21 +0200 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-06-30 20:31:21 +0200 |
| commit | 2c74c8a08becb4cc12f3b7b280e46e9816a5dc21 (patch) | |
| tree | b9745e3d838a04e52b6b245afb7b2f580ef8e74f /foobar | |
| parent | ceaf6ef05eb50b84c5de159a71e5869e2ac38f85 (diff) | |
| download | csharp-cmake-2c74c8a08becb4cc12f3b7b280e46e9816a5dc21.tar.gz csharp-cmake-2c74c8a08becb4cc12f3b7b280e46e9816a5dc21.zip | |
Reorganize into hello/ and foobar/ subdirectories
Diffstat (limited to 'foobar')
| -rw-r--r-- | foobar/CMakeLists.txt | 18 | ||||
| -rw-r--r-- | foobar/FooBar.cs | 9 |
2 files changed, 27 insertions, 0 deletions
diff --git a/foobar/CMakeLists.txt b/foobar/CMakeLists.txt new file mode 100644 index 0000000..87dbba4 --- /dev/null +++ b/foobar/CMakeLists.txt @@ -0,0 +1,18 @@ +set(FOOBAR_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/FooBar.cs) +set(FOOBAR_OUTPUT ${CMAKE_BINARY_DIR}/FooBar.dll) + +add_custom_command( + OUTPUT ${FOOBAR_OUTPUT} + COMMAND dotnet ${CSC_DLL} + -target:library + -out:${FOOBAR_OUTPUT} + -lib:${RUNTIME_DIR} + -reference:System.Private.CoreLib.dll + -reference:System.Runtime.dll + -reference:System.Console.dll + ${FOOBAR_SOURCES} + DEPENDS ${FOOBAR_SOURCES} + COMMENT "Compiling FooBar library with Roslyn csc..." +) + +add_custom_target(FooBar ALL DEPENDS ${FOOBAR_OUTPUT}) diff --git a/foobar/FooBar.cs b/foobar/FooBar.cs new file mode 100644 index 0000000..fea9685 --- /dev/null +++ b/foobar/FooBar.cs @@ -0,0 +1,9 @@ +using System; + +public class FooBar +{ + public static void Print() + { + Console.WriteLine("FooBar"); + } +} |
