Files
googlepinyinime-rev/scripts/lcompile.sh
2025-01-02 06:19:47 +08:00

24 lines
539 B
Bash

#!/bin/bash
currentDirectory=$(pwd)
cmakeListsPath="${currentDirectory}/CMakeLists.txt"
if [ ! -f "$cmakeListsPath" ]; then
echo "No CMakeLists.txt in current directory, please check."
exit 1
fi
echo "Start generating and compiling..."
buildFolderPath="./build"
if [ ! -d "$buildFolderPath" ]; then
mkdir -p "$buildFolderPath"
echo "build folder created."
fi
cmake -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -S . -B ./build/
if [ $? -eq 0 ]; then
cmake --build ./build/ --config DEBUG
fi