Skip to content

Commit

Permalink
Fixed iOS build issues:
Browse files Browse the repository at this point in the history
- Allow building shared lib for iOS in BuildIOS.command script.
- Added missing header files to Testbed CMakeLists.txt script on Mac.
- Explicitly specify GaussLib include directory for iOS CI script.
  • Loading branch information
LukasBanana committed Sep 14, 2023
1 parent 46edd65 commit 8fff00f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
env:
DEPLOYMENT_TARGET: 13.0
README: ${{ github.workspace }}/README.txt
GAUSSIAN_LIB_DIR: external/GaussianLib/include

steps:
- name: Checkout Repository
Expand All @@ -38,6 +39,7 @@ jobs:
-DLLGL_BUILD_RENDERER_OPENGLES3=ON
-DLLGL_BUILD_RENDERER_METAL=ON
-DLLGL_BUILD_EXAMPLES=ON
-DGaussLib_INCLUDE_DIR:STRING="${{ env.GAUSSIAN_LIB_DIR }}"
- name: Build
run: |
Expand Down
6 changes: 5 additions & 1 deletion BuildIOS.command
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ENABLE_TESTS="OFF"
BUILD_TYPE="Release"
DEPLOYMENT_TARGET="11.0"
PROJECT_ONLY=0
STATIC_LIB="OFF"
VERBOSE=0

# When this .command script is launched from Finder, we have to change to the source directory explicitly
Expand All @@ -24,6 +25,7 @@ print_help()
echo " -d, --debug ............... Configure Debug build (default is Release)"
echo " -h, --help ................ Print this help documentation and exit"
echo " -p, --project-only ........ Build project solution only (no compilation)"
echo " -s, --static-lib .......... Build static lib (default is shared lib)"
echo " -t, --target T ............ Sets deployment target to T (default is 11.0)"
echo " -v, --verbose ............. Print additional information"
echo " --null .................... Include Null renderer"
Expand All @@ -49,6 +51,8 @@ for ARG in "$@"; do
BUILD_TYPE="Debug"
elif [ "$ARG" = "-p" ] || [ "$ARG" = "--project-only" ]; then
PROJECT_ONLY=1
elif [ "$ARG" = "-s" ] || [ "$ARG" = "--static-lib" ]; then
STATIC_LIB="ON"
elif [ "$ARG" = "-t" ] || [ "$ARG" = "--target" ]; then
READ_TARGET=1
elif [ "$ARG" = "-v" ] || [ "$ARG" = "--verbose" ]; then
Expand Down Expand Up @@ -111,7 +115,7 @@ OPTIONS=(
-DLLGL_BUILD_RENDERER_NULL=$ENABLE_NULL
-DLLGL_BUILD_RENDERER_OPENGLES3=$ENABLE_GLES3
-DLLGL_BUILD_RENDERER_METAL=ON
-DLLGL_BUILD_STATIC_LIB=ON
-DLLGL_BUILD_STATIC_LIB=$STATIC_LIB
-DLLGL_BUILD_EXAMPLES=$ENABLE_EXAMPLES
-DLLGL_BUILD_TESTS=$ENABLE_TESTS
-DGaussLib_INCLUDE_DIR:STRING="$GAUSSIAN_LIB_DIR"
Expand Down
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ function(find_source_files OUTPUT_LIST FILTERS)
set(FILTERS "*.c;*.cpp;*.h;*.inl")
elseif("${FILTERS}" STREQUAL "OBJC")
set(FILTERS "*.c;*.cpp;*.h;*.inl;*.m;*.mm")
elseif("${FILTERS}" STREQUAL "RES")
set(FILTERS "*.c;*.cpp;*.h;*.inl;*.m;*.mm;*.metal;*.vert;*.frag")
endif()

# Collect all input directories for each filter
Expand Down Expand Up @@ -158,7 +160,7 @@ function(find_project_source_files OUTPUT_LIST SRC_FILES)
else()
# Find all source files for project
if(APPLE)
find_source_files(ProjectFiles "*.c;*.cpp;*.metal;*.vert;*.frag" ${SRC_FILES})
find_source_files(ProjectFiles RES ${SRC_FILES})
else()
find_source_files(ProjectFiles CXX ${SRC_FILES})
endif()
Expand Down Expand Up @@ -242,6 +244,7 @@ function(add_llgl_example_project PROJECT_NAME LINKER_LANG SRC_FILES LIB_FILES)
if(APPLE)
# Project configurations
add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} ${LIB_FILES})

# Configure bundle name and ID
if (${PROJECT_NAME} MATCHES "Example_+")
Expand Down Expand Up @@ -294,10 +297,10 @@ function(add_llgl_example_project PROJECT_NAME LINKER_LANG SRC_FILES LIB_FILES)
target_link_libraries(${PROJECT_NAME} ${LIB_FILES} android_native_app_glue log)
else()
add_executable(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} ${LIB_FILES})
endif()

# Configure linker settings
target_link_libraries(${PROJECT_NAME} ${LIB_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE ${LINKER_LANG} DEBUG_POSTFIX "D")

# Configure working directory and project solution folder
Expand Down

0 comments on commit 8fff00f

Please sign in to comment.