YYCCommonplace/script/linux_build.sh
yyc12345 805ffe70d6 fix: fix linux build issue
- fix linux build bug
- add linux build script
- order linux shell file eol be LF.
2024-07-22 22:41:10 +08:00

33 lines
701 B
Bash

#!/bin/bash
README_PATH=$(pwd)/README.md
if [ ! -f "$README_PATH" ]; then
echo "Error: You must run this script at the root folder of this project!"
exit
fi
# Create main binary directory
mkdir bin
cd bin
# Create build directory
mkdir build
# Create install directory
mkdir install
cd install
mkdir Debug
mkdir Release
cd ..
# Build current system debug and release version
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ../.. --fresh
cmake --build .
cmake --install . --prefix ../install/Debug
cmake -DCMAKE_BUILD_TYPE=Release -DYYCC_BUILD_TESTBENCH=ON ../.. --fresh
cmake --build .
cmake --install . --prefix ../install/Release
cd ..
# Exit to original path
cd ..
echo "Linux CMake Build Done"