tests: Enable tools tests on android

This commit is contained in:
Sandy Carter
2023-01-21 18:18:34 -05:00
committed by Sandy
parent 0a11910c2a
commit e5fea62b02
3 changed files with 18 additions and 6 deletions

View File

@@ -91,7 +91,7 @@ jobs:
# Run CMake to generate Ninja project files # Run CMake to generate Ninja project files
- name: Generate project files - name: Generate project files
run: | run: |
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake -DBGFX_BUILD_TOOLS=OFF cmake -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake
# Build the whole project with Ninja (which is spawn by CMake). # Build the whole project with Ninja (which is spawn by CMake).
- name: Build - name: Build

View File

@@ -8,7 +8,11 @@
# You should have received a copy of the CC0 Public Domain Dedication along with # You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. # this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
add_executable(geometryv) if(ANDROID)
add_library(geometryv SHARED)
else()
add_executable(geometryv)
endif()
# Grab the geometryv source files # Grab the geometryv source files
file(GLOB_RECURSE GEOMETRYV_SOURCES # file(GLOB_RECURSE GEOMETRYV_SOURCES #
@@ -16,7 +20,7 @@ file(GLOB_RECURSE GEOMETRYV_SOURCES #
) )
target_sources(geometryv PRIVATE ${GEOMETRYV_SOURCES}) target_sources(geometryv PRIVATE ${GEOMETRYV_SOURCES})
target_link_libraries(geometryv example-common) target_link_libraries(geometryv PRIVATE example-common)
set_target_properties( set_target_properties(
geometryv PROPERTIES FOLDER "bgfx/tools" # geometryv PROPERTIES FOLDER "bgfx/tools" #
OUTPUT_NAME ${BGFX_TOOLS_PREFIX}geometryv # OUTPUT_NAME ${BGFX_TOOLS_PREFIX}geometryv #
@@ -26,7 +30,9 @@ if(BGFX_BUILD_TOOLS_GEOMETRY AND BGFX_CUSTOM_TARGETS)
add_dependencies(tools geometryv) add_dependencies(tools geometryv)
endif() endif()
if(EMSCRIPTEN) if(ANDROID)
set_property(TARGET geometryv PROPERTY PREFIX "")
elseif(EMSCRIPTEN)
target_link_options(geometryv PRIVATE -sMAX_WEBGL_VERSION=2) target_link_options(geometryv PRIVATE -sMAX_WEBGL_VERSION=2)
elseif(IOS) elseif(IOS)
set_target_properties(geometryv PROPERTIES MACOSX_BUNDLE ON MACOSX_BUNDLE_GUI_IDENTIFIER geometryv) set_target_properties(geometryv PROPERTIES MACOSX_BUNDLE ON MACOSX_BUNDLE_GUI_IDENTIFIER geometryv)

View File

@@ -8,7 +8,11 @@
# You should have received a copy of the CC0 Public Domain Dedication along with # You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. # this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
add_executable(texturev) if(ANDROID)
add_library(texturev SHARED)
else()
add_executable(texturev)
endif()
# Grab the texturev source files # Grab the texturev source files
file(GLOB_RECURSE TEXTUREV_SOURCES # file(GLOB_RECURSE TEXTUREV_SOURCES #
@@ -26,7 +30,9 @@ if(BGFX_BUILD_TOOLS_TEXTURE AND BGFX_CUSTOM_TARGETS)
add_dependencies(tools texturev) add_dependencies(tools texturev)
endif() endif()
if(EMSCRIPTEN) if(ANDROID)
set_property(TARGET texturev PROPERTY PREFIX "")
elseif(EMSCRIPTEN)
target_link_options(texturev PRIVATE -sMAX_WEBGL_VERSION=2) target_link_options(texturev PRIVATE -sMAX_WEBGL_VERSION=2)
elseif(IOS) elseif(IOS)
set_target_properties(texturev PROPERTIES MACOSX_BUNDLE ON MACOSX_BUNDLE_GUI_IDENTIFIER texturev) set_target_properties(texturev PROPERTIES MACOSX_BUNDLE ON MACOSX_BUNDLE_GUI_IDENTIFIER texturev)