Skip to content

Commit

Permalink
dealing with the mess
Browse files Browse the repository at this point in the history
  • Loading branch information
sonphantrung authored Nov 2, 2024
1 parent 61975c2 commit fa4d9ee
Show file tree
Hide file tree
Showing 20 changed files with 2,837 additions and 1,733 deletions.
Binary file added build-data/ios/resources/AppIcon.icns
Binary file not shown.
Binary file added build-data/ios/resources/LaunchScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions build-data/ios/resources/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="ipad11_0rounded" orientation="landscape" layout="fullscreen" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" image="LaunchScreen.png" translatesAutoresizingMaskIntoConstraints="NO" id="jgb-MO-6eD">
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="jgb-MO-6eD" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="FjW-en-yZJ"/>
<constraint firstAttribute="bottom" secondItem="jgb-MO-6eD" secondAttribute="bottom" id="noI-PU-2X1"/>
<constraint firstAttribute="trailing" secondItem="jgb-MO-6eD" secondAttribute="trailing" id="q5b-zf-rlf"/>
<constraint firstItem="jgb-MO-6eD" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="qPb-Yb-9bz"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52.763819095477388" y="374.8201438848921"/>
</scene>
</scenes>
<resources>
<image name="LaunchScreen.png" width="1024" height="1024"/>
</resources>
</document>
51 changes: 51 additions & 0 deletions build-scripts/ios-xcode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
# adapted from https://marcelbraghetto.github.io/a-simple-triangle/

# Given the name of a Homebrew formula, check if its installed and if not, install it.
fetch_brew_dependency() {
FORMULA_NAME=$1

echo "Checking for Brew dependency: '$FORMULA_NAME'."

if brew ls --versions $FORMULA_NAME > /dev/null; then
echo "Dependency '$FORMULA_NAME' is already installed, continuing ..."
else
echo "Dependency '$FORMULA_NAME' is not installed, installing via Homebrew ..."
brew install $FORMULA_NAME
fi
}

fetch_brew_dependency "xcodegen"

echo "Checking for build folder ..."
if [ ! -d "../build" ]; then
mkdir ../build
fi

echo "Checking for libs folder ..."
if [ ! -d "../build/libs" ]; then
echo "ERROR: Static SDL libraries not found at /build/libs ..."
echo "Reffer to /doc/COMPILING/COMPILING-XCODE.md for instructions on how to build the static libraries."
exit
fi


if [ ! -f "xcode_dev_id.yml" ]; then
echo "xcode_dev_id.yml not found -"
echo " You will need to manually specify your Development Team for signing in Xcode."
echo " See the following link for details:"
echo " https://help.apple.com/xcode/mac/current/#/dev23aab79b4"
echo ""
echo "To avoid this message in the future see the xcode_dev_id_example.yml file."
fi
# Invoke the xcodegen tool to create our project file.
echo "Generating Xcode project"
xcodegen -s xcodegen-cataclysm.yml -p ../build

if [ ! -f "../build/CataclysmExperimental.xcodeproj" ]; then
echo "Project built successfully. Launching Xcode..."
open ../build/CataclysmExperimental.xcodeproj
exit
else
echo "Error in project creation process. Review output above for errors."
fi
5 changes: 5 additions & 0 deletions build-scripts/xcode_dev_id_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# For more information on setting up a development team see:
# https://help.apple.com/developer-account/#/devf2eb157f8

settings:
DEVELOPMENT_TEAM: XXXXXXXXXX
149 changes: 149 additions & 0 deletions build-scripts/xcodegen-cataclysm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: CataclysmExperimental

include:
# see xcode_dev_id_example.yml
- xcode_dev_id.yml

options:
bundleIdPrefix: com.cataclysmdda.en.cataclysm
groupOrdering:
- order: [Sources, Resources, Frameworks, Products]
usesTabs: false
indentWidth: 4
tabWidth: 4
deploymentTarget:
iOS: "15.0"

schemes:
CataclysmExperimental:
build:
targets:
CataclysmExperimental: all

targets:
CataclysmExperimental:
type: application
platform: iOS
info:
path: ../build/Info.plist
properties:
LSRequiresIPhoneOS: true
UIRequiredDeviceCapabilities: [arm64]
UIRequiresFullScreen: true
UIStatusBarHidden: true
UISupportedInterfaceOrientations:
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationPortrait
UILaunchStoryboardName: LaunchScreen
CFBundleIconFile: AppIcon.icns
UIApplicationSupportsIndirectInputEvents: true
UIFileSharingEnabled: true
LSSupportsOpeningDocumentsInPlace: true
sources:
- path: ../src
name: Sources
buildPhase: sources
includes:
- "**/third-party/imgui/*.cpp"
- "**/third-party/imgui/*.h"
- "*.cpp"
- "*.h"
excludes:
- "*.txt"
- "*.in"
- "*.rc"
- "*.cmake"
- "**/third-party/flatbuffers/**"
- "**/third-party/ghc/**"
- "**/third-party/imtui/**"
- "**/third-party/pinyin/**"
- "**/chkjson/**"
- path: ../build-data/ios/resources/LaunchScreen.storyboard
group: Resources
- path: ../build-data/ios/resources/AppIcon.icns
group: Resources
buildPhase: resources
- path: ../build-data/ios/resources/LaunchScreen.png
group: Resources
buildPhase: resources
# TODO: Imitate cmake selection for data and gfx
- path: ../data
type: folder
group: Resources
buildPhase: resources
- path: ../gfx
type: folder
group: Resources
buildPhase: resources
- path: ../ios
type: folder
group: Resources
buildPhase: resources
settings:
base:
CLANG_CXX_LANGUAGE_STANDARD: c++17
CMAKE_CXX_STANDARD: 17
CMAKE_CXX_STANDARD_REQUIRED: ON
CLANG_WARN_DOCUMENTATION_COMMENTS: false
GCC_WARN_64_TO_32_BIT_CONVERSION: No
SWIFT_OBJC_INTEROP_MODE: objcxx
HEADER_SEARCH_PATHS:
- ../src/third-party/**
- ../build/libs/headers
LIBRARY_SEARCH_PATHS:
- ../build/libs/
- $(inherited)
GCC_PREPROCESSOR_DEFINITIONS:
- GIT_VERSION
- TILES
- BACKTRACE
- SDL_SOUND
- IOS_KEYBOARD
- $(inherited)
OTHER_CPLUSPLUSFLAGS:
#- "-Werror"
- "-Wall -Wextra -Wformat-signedness -Wlogical-op -Wmissing-declarations -Wmissing-noreturn"
- "-Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wpedantic -Wsuggest-override"
- "-Wunused-macros -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wredundant-decls"
- "-fsigned-char"
OTHER_LDFLAGS:
- "-Wl,-ld_classic"
Debug:
OTHER_CPLUSPLUSFLAGS:
- "-Og -pthread '-std=c++17'"
Release:
GCC_PREPROCESSOR_DEFINITIONS:
- RELEASE
OTHER_CPLUSPLUSFLAGS:
- "-Os -DNDEBUG -pthread '-std=c++14'"
dependencies:
# TODO: build libcataclysm-tiles-common.a as it's own step again. Currently rolled in to single build
# - framework: libs/libcataclysm-tiles-common.a
- framework: ../build/libs/libSDL2.a
- framework: ../build/libs/libSDL2_image.a
- framework: ../build/libs/libSDL2_mixer.a
- framework: ../build/libs/libSDL2_ttf.a
- sdk: libllvm-flatbuffers.tbd
- sdk: libz.tbd
- sdk: libncurses.tbd
- sdk: MobileCoreServices.framework
- sdk: CoreMotion.framework
- sdk: CoreGraphics.framework
- sdk: CoreHaptics.framework
- sdk: AudioToolbox.framework
- sdk: CoreAudio.framework
- sdk: QuartzCore.framework
- sdk: GameController.framework
- sdk: Foundation.framework
- sdk: OpenGLES.framework
- sdk: UIKit.framework
- sdk: AVFoundation.framework
- sdk: ImageIO.framework
- sdk: Metal.framework
configs:
Debug:
DEBUG_MODE: YES
Release:
DEBUG_MODE: NO
Loading

0 comments on commit fa4d9ee

Please sign in to comment.