Skip to content

Commit

Permalink
chore: 更新编译配置
Browse files Browse the repository at this point in the history
  • Loading branch information
engsr6982 committed Dec 20, 2024
1 parent 8e63d6b commit 0c77923
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
32 changes: 32 additions & 0 deletions scripts/install_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
LLVM_VERSION=15

sudo apt-get -y update
sudo apt-get -y upgrade

echo "[Script] Install LLVM、Clang、libc++"
sudo apt-get update -y -q
sudo apt-get install -y -q lsb-release wget software-properties-common gnupg
sudo wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sudo ./llvm.sh $LLVM_VERSION
sudo apt-get install -y -q libc++-$LLVM_VERSION-dev libc++abi-$LLVM_VERSION-dev
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-$LLVM_VERSION 100

echo "[Script] Install git"
sudo apt install -y git

echo "[Script] Install Python3.11 with pip"
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.11
sudo python3.11 --version
sudo apt install python3.11-full
sudo apt install python3-pip
which python3.11
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.11 9
sudo update-alternatives --config python
python --version
6 changes: 5 additions & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ target("Js_Engine")
set_basename("js_engine")
after_build(function(target)
local output_dir = path.join(os.projectdir(), "bin")
local ext = ".dll";
if (is_plat("linux")) then
ext = ".so";
end

os.cp(target:targetfile(), path.join(output_dir, target:name() .. ".dll"))
os.cp(target:targetfile(), path.join(output_dir, target:basename() .. ext))

os.cp(path.join(os.projectdir(), "types"), path.join(os.projectdir(), "bin", "js_engine", "dts"))

Expand Down

0 comments on commit 0c77923

Please sign in to comment.