refactor: change project layout
- move script as asset because they are not build script - create new script directory for "User Compile" method because github action need to build with gtest. - change compile manual for this change. - modify external dependency location in github action and gitignore.
This commit is contained in:
2
.github/linux_build.sh
vendored
2
.github/linux_build.sh
vendored
@@ -10,7 +10,7 @@ mkdir install
|
|||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Build in Release mode
|
# Build in Release mode
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release ../..
|
cmake -DCMAKE_BUILD_TYPE=Release -DYYCC_BUILD_TEST=ON -DGTest_ROOT=$GTest_ROOT ../..
|
||||||
cmake --build .
|
cmake --build .
|
||||||
cmake --install . --prefix=../install
|
cmake --install . --prefix=../install
|
||||||
|
|
||||||
|
|||||||
2
.github/macos_build.sh
vendored
2
.github/macos_build.sh
vendored
@@ -10,7 +10,7 @@ mkdir install
|
|||||||
cd build
|
cd build
|
||||||
|
|
||||||
# Build in Release mode
|
# Build in Release mode
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release ../..
|
cmake -DCMAKE_BUILD_TYPE=Release -DYYCC_BUILD_TEST=ON -DGTest_ROOT=$GTest_ROOT ../..
|
||||||
cmake --build .
|
cmake --build .
|
||||||
cmake --install . --prefix=../install
|
cmake --install . --prefix=../install
|
||||||
|
|
||||||
|
|||||||
2
.github/windows_build.bat
vendored
2
.github/windows_build.bat
vendored
@@ -9,7 +9,7 @@ MKDIR install
|
|||||||
CD build
|
CD build
|
||||||
|
|
||||||
:: Build with x64 architecture in Release mode
|
:: Build with x64 architecture in Release mode
|
||||||
cmake -A x64 ../..
|
cmake -A x64 -DYYCC_BUILD_TEST=ON -DGTest_ROOT=%GTest_ROOT% ../..
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
cmake --install . --prefix=../install --config Release
|
cmake --install . --prefix=../install --config Release
|
||||||
|
|
||||||
|
|||||||
8
.github/workflows/linux.yml
vendored
8
.github/workflows/linux.yml
vendored
@@ -16,8 +16,8 @@ jobs:
|
|||||||
# - name: Setup Google Test and Google Benchmark
|
# - name: Setup Google Test and Google Benchmark
|
||||||
# run: |
|
# run: |
|
||||||
# # Setup Google Test
|
# # Setup Google Test
|
||||||
# git clone -b v1.17.0 https://github.com/google/googletest.git external/googletest
|
# git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest
|
||||||
# cd external/googletest
|
# cd extern/googletest
|
||||||
# mkdir build install
|
# mkdir build install
|
||||||
# cd build
|
# cd build
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||||
@@ -25,8 +25,8 @@ jobs:
|
|||||||
# cmake --install . --prefix=../install
|
# cmake --install . --prefix=../install
|
||||||
# cd ../..
|
# cd ../..
|
||||||
# # Setup Google Benchmark
|
# # Setup Google Benchmark
|
||||||
# git clone -b v1.9.4 https://github.com/google/benchmark.git external/benchmark
|
# git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark
|
||||||
# cd external/benchmark
|
# cd extern/benchmark
|
||||||
# # Create symlink to googletest as required by benchmark
|
# # Create symlink to googletest as required by benchmark
|
||||||
# ln -s ../googletest googletest
|
# ln -s ../googletest googletest
|
||||||
# mkdir build install
|
# mkdir build install
|
||||||
|
|||||||
8
.github/workflows/macos.yml
vendored
8
.github/workflows/macos.yml
vendored
@@ -12,8 +12,8 @@ jobs:
|
|||||||
# - name: Setup Google Test and Google Benchmark
|
# - name: Setup Google Test and Google Benchmark
|
||||||
# run: |
|
# run: |
|
||||||
# # Setup Google Test
|
# # Setup Google Test
|
||||||
# git clone -b v1.17.0 https://github.com/google/googletest.git external/googletest
|
# git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest
|
||||||
# cd external/googletest
|
# cd extern/googletest
|
||||||
# mkdir build install
|
# mkdir build install
|
||||||
# cd build
|
# cd build
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||||
@@ -21,8 +21,8 @@ jobs:
|
|||||||
# cmake --install . --prefix=../install
|
# cmake --install . --prefix=../install
|
||||||
# cd ../..
|
# cd ../..
|
||||||
# # Setup Google Benchmark
|
# # Setup Google Benchmark
|
||||||
# git clone -b v1.9.4 https://github.com/google/benchmark.git external/benchmark
|
# git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark
|
||||||
# cd external/benchmark
|
# cd extern/benchmark
|
||||||
# # Create symlink to googletest as required by benchmark
|
# # Create symlink to googletest as required by benchmark
|
||||||
# ln -s ../googletest googletest
|
# ln -s ../googletest googletest
|
||||||
# mkdir build install
|
# mkdir build install
|
||||||
|
|||||||
8
.github/workflows/windows.yml
vendored
8
.github/workflows/windows.yml
vendored
@@ -19,8 +19,8 @@ jobs:
|
|||||||
# - name: Setup Google Test and Google Benchmark
|
# - name: Setup Google Test and Google Benchmark
|
||||||
# run: |
|
# run: |
|
||||||
# # Setup Google Test
|
# # Setup Google Test
|
||||||
# git clone -b v1.17.0 https://github.com/google/googletest.git external/googletest
|
# git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest
|
||||||
# cd external/googletest
|
# cd extern/googletest
|
||||||
# mkdir build install
|
# mkdir build install
|
||||||
# cd build
|
# cd build
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||||
@@ -28,8 +28,8 @@ jobs:
|
|||||||
# cmake --install . --prefix=../install --config Release
|
# cmake --install . --prefix=../install --config Release
|
||||||
# cd ../..
|
# cd ../..
|
||||||
# # Setup Google Benchmark
|
# # Setup Google Benchmark
|
||||||
# git clone -b v1.9.4 https://github.com/google/benchmark.git external/benchmark
|
# git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark
|
||||||
# cd external/benchmark
|
# cd extern/benchmark
|
||||||
# # Create symlink to googletest as required by benchmark
|
# # Create symlink to googletest as required by benchmark
|
||||||
# mklink /D googletest ../googletest
|
# mklink /D googletest ../googletest
|
||||||
# mkdir build install
|
# mkdir build install
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@
|
|||||||
out/
|
out/
|
||||||
build/
|
build/
|
||||||
install/
|
install/
|
||||||
|
extern/
|
||||||
|
|
||||||
# Ignore CMake generated stuff
|
# Ignore CMake generated stuff
|
||||||
src/yycc/version.hpp
|
src/yycc/version.hpp
|
||||||
|
|||||||
@@ -106,7 +106,13 @@ If you are a developer (developer of this project, or use this project as depend
|
|||||||
|
|
||||||
"User Build" is basically how GitHub Action build this project.
|
"User Build" is basically how GitHub Action build this project.
|
||||||
|
|
||||||
Execute `.github/windows_build.bat` on Windows or `.github/linux_build.sh` on POSIX-like OS (Linux and macOS) under **the root directory** of this project. The final built artifact is under `bin/install` directory.
|
Under **the root directory** of this project, execute:
|
||||||
|
|
||||||
|
- `script/windows_build.bat` on Windows
|
||||||
|
- or `script/linux_build.sh` on Linux
|
||||||
|
- or `script/macos_build.sh` on macOS
|
||||||
|
|
||||||
|
The final built artifact is under `bin/install` directory.
|
||||||
|
|
||||||
### Developer Build
|
### Developer Build
|
||||||
|
|
||||||
|
|||||||
0
script/.gitignore → asset/.gitignore
vendored
0
script/.gitignore → asset/.gitignore
vendored
0
script/uv.lock → asset/uv.lock
generated
0
script/uv.lock → asset/uv.lock
generated
19
script/linux_build.sh
Normal file
19
script/linux_build.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Create build directory and enter it
|
||||||
|
mkdir bin
|
||||||
|
cd bin
|
||||||
|
# Create internal build and install directory, then enter it
|
||||||
|
mkdir build
|
||||||
|
mkdir install
|
||||||
|
cd build
|
||||||
|
|
||||||
|
# Build in Release mode
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ../..
|
||||||
|
cmake --build .
|
||||||
|
cmake --install . --prefix=../install
|
||||||
|
|
||||||
|
# Back to root directory
|
||||||
|
cd ..
|
||||||
|
cd ..
|
||||||
19
script/macos_build.sh
Normal file
19
script/macos_build.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Create build directory and enter it
|
||||||
|
mkdir bin
|
||||||
|
cd bin
|
||||||
|
# Create internal build and install directory, then enter it
|
||||||
|
mkdir build
|
||||||
|
mkdir install
|
||||||
|
cd build
|
||||||
|
|
||||||
|
# Build in Release mode
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ../..
|
||||||
|
cmake --build .
|
||||||
|
cmake --install . --prefix=../install
|
||||||
|
|
||||||
|
# Back to root directory
|
||||||
|
cd ..
|
||||||
|
cd ..
|
||||||
18
script/windows_build.bat
Normal file
18
script/windows_build.bat
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
|
||||||
|
:: Create build directory and enter it
|
||||||
|
MKDIR bin
|
||||||
|
CD bin
|
||||||
|
:: Create internal build and install directory, then enter it
|
||||||
|
MKDIR build
|
||||||
|
MKDIR install
|
||||||
|
CD build
|
||||||
|
|
||||||
|
:: Build with x64 architecture in Release mode
|
||||||
|
cmake -A x64 ../..
|
||||||
|
cmake --build . --config Release
|
||||||
|
cmake --install . --prefix=../install --config Release
|
||||||
|
|
||||||
|
:: Back to root directory
|
||||||
|
CD ..
|
||||||
|
CD ..
|
||||||
Reference in New Issue
Block a user