Skip to content

Commit 0f49e5c

Browse files
committed
chore: re-organized project.
1 parent 0536d63 commit 0f49e5c

File tree

30 files changed

+199
-96
lines changed

30 files changed

+199
-96
lines changed

.gitignore

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
# Visual Studio
2+
.sln/
3+
4+
*.sln.lnk
5+
16
# Godot 4+ specific ignores
27
.godot/
38

49
# Ignore library files but not the gdextension file
5-
demo/bin/*
6-
!demo/bin/android
7-
demo/bin/android/*
8-
!demo/bin/android/.gitkeep
9-
!demo/bin/linux
10-
demo/bin/linux/*
11-
!demo/bin/linux/.gitkeep
12-
!demo/bin/macos
13-
demo/bin/macos/*
14-
!demo/bin/macos/.gitkeep
15-
!demo/bin/windows
16-
demo/bin/windows/*
17-
!demo/bin/windows/.gitkeep
18-
!demo/bin/*.gdextension
10+
demo/client/bin/*
11+
!demo/client/bin/android
12+
demo/client/bin/android/*
13+
!demo/client/bin/android/.gitkeep
14+
!demo/client/bin/linux
15+
demo/client/bin/linux/*
16+
!demo/client/bin/linux/.gitkeep
17+
!demo/client/bin/macos
18+
demo/client/bin/macos/*
19+
!demo/client/bin/macos/.gitkeep
20+
!demo/client/bin/windows
21+
demo/client/bin/windows/*
22+
!demo/client/bin/windows/.gitkeep
23+
!demo/client/bin/*.gdextension
1924
.sconsign*.dblite
2025

2126
# Ignore custom.py
@@ -48,4 +53,4 @@ compile_commands.json
4853
# VSCode
4954
.vscode/*
5055
!.vscode/extensions.json
51-
.DS_Store
56+
.DS_Store

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
path = godot-cpp
33
url = https://github.com/godotengine/godot-cpp.git
44
branch = 4.0
5+
[submodule "extern/librdkafka"]
6+
path = extern/librdkafka
7+
url = https://github.com/confluentinc/librdkafka.git

CMakeLists.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
cmake_minimum_required(VERSION 3.23)
2+
project(
3+
Godot-Kafka
4+
VERSION 0.1.0
5+
LANGUAGES CXX
6+
)
7+
8+
# Generate the project files
9+
# execute_process(
10+
# COMMAND scons
11+
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
12+
# )
13+
14+
# Set the C++ standard to C++17
15+
set(CMAKE_CXX_STANDARD 17)
16+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
17+
set(CMAKE_CXX_EXTENSIONS OFF)
18+
19+
# Use folders
20+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
21+
22+
# Set CMake Predefined Targets Folders
23+
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "External/CMake")
24+
25+
# Output the binaries to the bin folder
26+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "$<1:${PROJECT_SOURCE_DIR}/demo/client/bin/${CMAKE_SYSTEM_NAME}>")
27+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "$<1:${PROJECT_SOURCE_DIR}/demo/server/bin/${CMAKE_SYSTEM_NAME}>")
28+
29+
# Prefix all the binaries with "lib"
30+
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
31+
32+
# Glob all sources files.
33+
file(GLOB_RECURSE SOURCES "src/*.cpp")
34+
file(GLOB_RECURSE HEADERS "src/*.hpp" "src/*.h")
35+
36+
add_library(GodotKafka SHARED
37+
${SOURCES}
38+
${HEADERS}
39+
)
40+
41+
# Include Godot::cpp
42+
add_subdirectory(godot-cpp)
43+
target_link_libraries(GodotKafka PRIVATE godot::cpp)
44+
set_target_properties(godot-cpp PROPERTIES FOLDER "External/Godot")
45+
46+
# Include librdkafka
47+
set(RDKAFKA_BUILD_EXAMPLES OFF)
48+
set(RDKAFKA_BUILD_TESTS OFF)
49+
add_subdirectory(extern/librdkafka)
50+
target_link_libraries(GodotKafka PRIVATE rdkafka)
51+
set_target_properties(rdkafka PROPERTIES FOLDER "External/rdkafka")
52+
set_target_properties(rdkafka++ PROPERTIES FOLDER "External/rdkafka")

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# godot-cpp template
2-
This repository serves as a quickstart template for GDExtension development with Godot 4.0+.
1+
# Godot-Kafka
2+
[![Build GDExtension](https://github.com/bsmithcompsci/godot-kafka-multiplayer-peer/actions/workflows/builds.yml/badge.svg)](https://github.com/bsmithcompsci/godot-kafka-multiplayer-peer/actions/workflows/builds.yml)
3+
4+
Godot-Kafka is a GDExtension for Godot 4.x+.
5+
36

47
## Contents
5-
* An empty Godot project (`demo/`)
8+
* An empty Godot project (`demo/client`)
9+
* Multiple Edge Services in various languages (`demo/server`)
610
* godot-cpp as a submodule (`godot-cpp/`)
711
* GitHub Issues template (`.github/ISSUE_TEMPLATE.yml`)
812
* GitHub CI/CD workflows to publish your library packages when creating a release (`.github/workflows/builds.yml`)

SConstruct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def validate_parent_dir(key, val, env):
1111
raise UserError("'%s' is not a directory: %s" % (key, os.path.dirname(val)))
1212

1313

14-
libname = "EXTENSION-NAME"
15-
projectdir = "demo"
14+
libname = "godot-kafka"
15+
projectdir = "demo/client"
1616

1717
localEnv = Environment(tools=["default"], PLATFORM="")
1818

bin/ios/ios.framework/Info.plist

Lines changed: 0 additions & 32 deletions
This file was deleted.

bin/macos/macos.framework/Resources/Info.plist

Lines changed: 0 additions & 32 deletions
This file was deleted.

demo/bin/macos/.gitkeep

Whitespace-only changes.

demo/bin/windows/.gitkeep

Whitespace-only changes.
File renamed without changes.

0 commit comments

Comments
 (0)