Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 19 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,60 +191,33 @@ jobs:
echo "Using internal Luau headers from source/cpp/luau"
EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DCMAKE_MODULE_PATH=$PWD/cmake"

# Apply compiler and linker flags by constructing complete flags once
# Apply compiler and linker flags - going back to simpler approach
echo "Setting up compiler and linker flags for LLVM and libomp"

# Let's create a CMake toolchain file to handle compiler flags
echo "Creating CMake toolchain file for compiler and linker flags"
cat > cmake/ios-toolchain.cmake << 'EOF'
# iOS toolchain file with compiler flags
set(CMAKE_SYSTEM_NAME iOS)
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Architecture")
set(CMAKE_OSX_DEPLOYMENT_TARGET "15.0" CACHE STRING "Deployment Target")
EOF

# Add LLVM and libomp paths to toolchain file if available
if [ -n "$LLVM_LIB_PATH" ]; then
echo "Adding LLVM lib path to toolchain: $LLVM_LIB_PATH"
echo "list(APPEND CMAKE_EXE_LINKER_FLAGS \"-L$LLVM_LIB_PATH\")" >> cmake/ios-toolchain.cmake
echo "list(APPEND CMAKE_SHARED_LINKER_FLAGS \"-L$LLVM_LIB_PATH\")" >> cmake/ios-toolchain.cmake
fi

if [ -n "$LLVM_INCLUDE_PATH" ]; then
echo "Adding LLVM include path to toolchain: $LLVM_INCLUDE_PATH"
echo "include_directories(\"$LLVM_INCLUDE_PATH\")" >> cmake/ios-toolchain.cmake
fi
# We'll use a simpler approach without trying to modify compiler flags
# This should be enough to find the module files without quoting issues

if [ -n "$LIBOMP_LIB_PATH" ]; then
echo "Adding libomp lib path to toolchain: $LIBOMP_LIB_PATH"
echo "list(APPEND CMAKE_EXE_LINKER_FLAGS \"-L$LIBOMP_LIB_PATH\")" >> cmake/ios-toolchain.cmake
echo "list(APPEND CMAKE_SHARED_LINKER_FLAGS \"-L$LIBOMP_LIB_PATH\")" >> cmake/ios-toolchain.cmake
fi

if [ -n "$LIBOMP_INCLUDE_PATH" ]; then
echo "Adding libomp include path to toolchain: $LIBOMP_INCLUDE_PATH"
echo "include_directories(\"$LIBOMP_INCLUDE_PATH\")" >> cmake/ios-toolchain.cmake
# Use Dobby if found
if [ -d "$DOBBY_DIR" ]; then
echo "Dobby found at $DOBBY_DIR, enabling Dobby support"
EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DDobby_DIR=$DOBBY_DIR -DUSE_DOBBY=ON"
else
echo "Dobby not found, building without hooking functionality"
EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DNO_DOBBY_HOOKS=ON"
fi

# Tell CMake to use our toolchain file
echo "Using toolchain file for compiler/linker flags"
EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=cmake/ios-toolchain.cmake"

# Configure CMake for iOS build with options
# Configure CMake for iOS build with standard options
echo "CMake args: $EXTRA_CMAKE_ARGS"

# Add more details to the toolchain file
echo "set(CMAKE_BUILD_TYPE Release CACHE STRING \"Build Type\")" >> cmake/ios-toolchain.cmake
echo "set(ENABLE_AI_FEATURES ON CACHE BOOL \"Enable AI Features\")" >> cmake/ios-toolchain.cmake
echo "set(ENABLE_LOCAL_TRAINING ON CACHE BOOL \"Enable Local Training\")" >> cmake/ios-toolchain.cmake

# Display the toolchain file contents for debugging
echo "=== Toolchain file contents ==="
cat cmake/ios-toolchain.cmake
echo "============================="

set -x # Echo commands
cmake -S . -B build ${EXTRA_CMAKE_ARGS}
cmake -S . -B build \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="15.0" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=iOS \
-DENABLE_AI_FEATURES=ON \
-DENABLE_LOCAL_TRAINING=ON \
${EXTRA_CMAKE_ARGS}

# Print config and diagnostics with expanded debugging
echo "CMake configuration from cache:"
Expand Down
Loading