Skip to content

Commit

Permalink
fix linker conflicts, Hop does not run jGL's tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerboa-app committed Jan 2, 2024
1 parent b4afa64 commit 7298d86
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: MESA_GL_VERSION_OVERRIDE=3.3 ctest --exclude-regex Vulkan
run: ctest

- name: buildArtifact
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: MESA_GL_VERSION_OVERRIDE=3.3 ctest --exclude-regex Vulkan
run: ctest
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ file(GLOB LUA_SRC "include/vendored/lua/src/*.c")
include_directories(include/vendored/lua/src)
add_library(Lua STATIC ${LUA_SRC})

set(TMP ${TEST_SUITE})
set(TEST_SUITE Off)
add_subdirectory(include/jGL)
set(TEST_SUITE ${TMP})

add_subdirectory(include/vendored/ogg)
set(${VORBIS_INCLUDE_DIRS} include/vendored/ogg/include)
Expand Down Expand Up @@ -142,7 +145,7 @@ endif()


target_compile_definitions(Hop PUBLIC GLSL_VERSION="330")
target_link_libraries(Hop jGL zlibstatic stduuid Lua Miniaudio)
target_link_libraries(Hop PUBLIC jGL zlibstatic stduuid Lua Miniaudio)

add_library(FreeType ALIAS freetype)

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function buildAndroid()
# 24 required for vulkan https://github.com/nihui/ncnn-android-yolov5/issues/10#issuecomment-800374356
cmake -E chdir build-$1 cmake .. -D ANDROID=ON -D ANDROID_PLATFORM=24 -D ANDROID_ABI=$1 -D BUILD_DEMOS=$DEMO -D RELEASE=$RELEASE -D TEST_SUITE=$TEST -D SYNTAX_ONLY=$SYNTAX -D SANITISE=$SANITISE -D CMAKE_TOOLCHAIN_FILE=$TOOL_CHAIN && make -j 4 -C build-$1

mv build-$1/libjGL.a build/libjGL-$1.a
mergeLibs "build-$1"
mv build-$1/libHop.a build/libHop-$1.a
mv build-$1/include/vendored/ogg/include/ogg/config_types.h include/vendored/ogg/include/ogg/
Expand Down Expand Up @@ -216,7 +217,6 @@ else
cd build && make -j 4 && cd ..
fi


if [[ -z "$ANDROID_NDK" ]]
then
mergeLibs "build"
Expand Down
4 changes: 2 additions & 2 deletions demo/android/perlinWorld/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {

defaultConfig {
applicationId "app.jerboa.glskeleton"
minSdk 23
minSdk 24
targetSdk 33
versionCode 1
versionName "0.0.0"
Expand All @@ -33,7 +33,7 @@ android {
}
externalNativeBuild {
cmake {
cppFlags ''
cppFlags "-std=c++17"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion demo/android/perlinWorld/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
cmake_minimum_required(VERSION 3.22.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE MinSizeRel)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++17")
# Declares and names the project.
project("HopAndroid")

Expand Down Expand Up @@ -45,6 +45,7 @@ target_compile_definitions(HopAndroid PUBLIC GLSL_VERSION="300 es")
target_compile_definitions(HopAndroid PUBLIC BENCHMARK)
target_compile_definitions(HopAndroid PUBLIC ANDROID)
set(libHop ${CMAKE_SOURCE_DIR}/include/libHop-${CMAKE_ANDROID_ARCH_ABI}.a)
#set(libjGL ${CMAKE_SOURCE_DIR}/include/libjGL-${CMAKE_ANDROID_ARCH_ABI}.a)
# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.
Expand Down
1 change: 1 addition & 0 deletions demo/android/perlinWorld/app/src/main/cpp/hopAndroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ extern "C"

collisions->setDetector(std::move(det));
collisions->setResolver(std::move(res));

}

#include <world.cpp>
Expand Down
4 changes: 2 additions & 2 deletions include/Object/id.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef ID_H
#define ID_H
#ifndef HOP_ID_H
#define HOP_ID_H

#include "uuid.h"
#include <ostream>
Expand Down
4 changes: 2 additions & 2 deletions include/gl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GL_H
#define GL_H
#ifndef HOP_GL_H
#define HOP_GL_H

#ifdef ANDROID

Expand Down
2 changes: 1 addition & 1 deletion include/jGL
Submodule jGL updated 1 files
+2 −2 CMakeLists.txt

0 comments on commit 7298d86

Please sign in to comment.