Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
android is real?
Browse files Browse the repository at this point in the history
  • Loading branch information
Prevter committed Apr 21, 2024
1 parent d62a908 commit 04b2780
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
- name: Windows
os: windows-latest

- name: Android32
os: ubuntu-latest
target: Android32

- name: Android64
os: ubuntu-latest
target: Android64

name: Geode OpenHack
runs-on: ${{ matrix.config.os }}

Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ endif()
option(BUILD_STANDALONE "Build the standalone version" ON)
option(BUILD_GEODE "Build the Geode version" ON)

# Android build
if (ANDROID)
message(STATUS "Android build detected, disabling standalone build")
set(BUILD_STANDALONE OFF)
set(BUILD_GEODE ON CACHE BOOL "Build the Geode version" FORCE)
endif()

# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
Expand Down
24 changes: 19 additions & 5 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ add_library(
imgui/imgui_draw.cpp
imgui/imgui_widgets.cpp
imgui/imgui_tables.cpp
imgui/backends/imgui_impl_win32.cpp
imgui/backends/imgui_impl_opengl3.cpp
imgui/misc/cpp/imgui_stdlib.cpp
)

if (WIN32)
# Windows specific files
target_sources(
imgui PRIVATE
imgui/backends/imgui_impl_win32.cpp
imgui/backends/imgui_impl_opengl3.cpp
)
endif()

target_include_directories(
imgui PUBLIC
imgui
Expand All @@ -30,17 +37,24 @@ target_link_libraries(
# Other libraries
add_subdirectory(gd.hpp)
add_subdirectory(json)
add_subdirectory(glfw)
add_subdirectory(discord-rpc)
add_subdirectory(zephyrus)

# Link all external libraries
target_link_libraries(
external_libs INTERFACE
imgui
glfw
gd.hpp
nlohmann_json::nlohmann_json
discord-rpc
Zephyrus
)
)

if (WIN32)
# GLFW
add_subdirectory(glfw)
target_link_libraries(
external_libs INTERFACE
glfw
)
endif()
3 changes: 2 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"geode": "2.0.0-beta.24",
"gd": {
"win": "2.204"
"win": "2.204",
"android": "2.205"
},
"version": "v2.2.2",
"id": "prevter.openhack",
Expand Down
11 changes: 11 additions & 0 deletions src/shared/platform/android/android.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once

#include <string>
#include <map>
#include <utility>
#include <vector>
#include <algorithm>
#include <filesystem>

namespace openhack::utils {
}
17 changes: 14 additions & 3 deletions src/shared/platform/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@

#ifdef _WIN32
#define PLATFORM_WINDOWS
#define ON_WINDOWS(...) __VA_ARGS__
#define ON_MACOS(...)
#define ON_ANDROID(...)
#include "win32/win32.hpp"
#elif !defined(OPENHACK_GEODE)
#error "Standalone supports only Windows."
#elif defined(__APPLE__)
#define PLATFORM_MACOS
#error "MacOS is not supported yet"
#define ON_WINDOWS(...)
#define ON_MACOS(...) __VA_ARGS__
#define ON_ANDROID(...)
#include "macos/macos.hpp"
#elif defined(__ANDROID__)
#define PLATFORM_ANDROID
#error "Android is not supported yet"
#define ON_WINDOWS(...)
#define ON_MACOS(...)
#define ON_ANDROID(...) __VA_ARGS__
#include "android/android.hpp"
#endif
#else
#error "Unsupported platform."
#endif

0 comments on commit 04b2780

Please sign in to comment.