diff --git a/.github/linux_build.sh b/.github/linux_build.sh index f4eb477..56e82f3 100644 --- a/.github/linux_build.sh +++ b/.github/linux_build.sh @@ -10,7 +10,7 @@ mkdir install cd build # 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 --install . --prefix=../install diff --git a/.github/macos_build.sh b/.github/macos_build.sh index f4eb477..56e82f3 100644 --- a/.github/macos_build.sh +++ b/.github/macos_build.sh @@ -10,7 +10,7 @@ mkdir install cd build # 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 --install . --prefix=../install diff --git a/.github/windows_build.bat b/.github/windows_build.bat index fdba5d7..b0d6ada 100644 --- a/.github/windows_build.bat +++ b/.github/windows_build.bat @@ -9,7 +9,7 @@ MKDIR install CD build :: 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 --install . --prefix=../install --config Release diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1d7df2c..9b00173 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -16,8 +16,8 @@ jobs: # - name: Setup Google Test and Google Benchmark # run: | # # Setup Google Test - # git clone -b v1.17.0 https://github.com/google/googletest.git external/googletest - # cd external/googletest + # git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest + # cd extern/googletest # mkdir build install # cd build # cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release .. @@ -25,8 +25,8 @@ jobs: # cmake --install . --prefix=../install # cd ../.. # # Setup Google Benchmark - # git clone -b v1.9.4 https://github.com/google/benchmark.git external/benchmark - # cd external/benchmark + # git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark + # cd extern/benchmark # # Create symlink to googletest as required by benchmark # ln -s ../googletest googletest # mkdir build install diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 715b390..e1ce74c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,8 +12,8 @@ jobs: # - name: Setup Google Test and Google Benchmark # run: | # # Setup Google Test - # git clone -b v1.17.0 https://github.com/google/googletest.git external/googletest - # cd external/googletest + # git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest + # cd extern/googletest # mkdir build install # cd build # cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release .. @@ -21,8 +21,8 @@ jobs: # cmake --install . --prefix=../install # cd ../.. # # Setup Google Benchmark - # git clone -b v1.9.4 https://github.com/google/benchmark.git external/benchmark - # cd external/benchmark + # git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark + # cd extern/benchmark # # Create symlink to googletest as required by benchmark # ln -s ../googletest googletest # mkdir build install diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7fcdfab..69ae53b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -19,8 +19,8 @@ jobs: # - name: Setup Google Test and Google Benchmark # run: | # # Setup Google Test - # git clone -b v1.17.0 https://github.com/google/googletest.git external/googletest - # cd external/googletest + # git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest + # cd extern/googletest # mkdir build install # cd build # 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 # cd ../.. # # Setup Google Benchmark - # git clone -b v1.9.4 https://github.com/google/benchmark.git external/benchmark - # cd external/benchmark + # git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark + # cd extern/benchmark # # Create symlink to googletest as required by benchmark # mklink /D googletest ../googletest # mkdir build install diff --git a/.gitignore b/.gitignore index 721225e..54cb7b7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ out/ build/ install/ +extern/ # Ignore CMake generated stuff src/yycc/version.hpp diff --git a/COMPILE.md b/COMPILE.md index 4a9feca..6e5d069 100644 --- a/COMPILE.md +++ b/COMPILE.md @@ -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. -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 diff --git a/script/.gitignore b/asset/.gitignore similarity index 100% rename from script/.gitignore rename to asset/.gitignore diff --git a/script/pycodec/.gitignore b/asset/pycodec/.gitignore similarity index 100% rename from script/pycodec/.gitignore rename to asset/pycodec/.gitignore diff --git a/script/pycodec/README.md b/asset/pycodec/README.md similarity index 100% rename from script/pycodec/README.md rename to asset/pycodec/README.md diff --git a/script/pycodec/conv_encoding_table.py b/asset/pycodec/conv_encoding_table.py similarity index 100% rename from script/pycodec/conv_encoding_table.py rename to asset/pycodec/conv_encoding_table.py diff --git a/script/pycodec/encoding_table.cpp.jinja b/asset/pycodec/encoding_table.cpp.jinja similarity index 100% rename from script/pycodec/encoding_table.cpp.jinja rename to asset/pycodec/encoding_table.cpp.jinja diff --git a/script/pycodec/encoding_table.csv b/asset/pycodec/encoding_table.csv similarity index 100% rename from script/pycodec/encoding_table.csv rename to asset/pycodec/encoding_table.csv diff --git a/script/pyproject.toml b/asset/pyproject.toml similarity index 100% rename from script/pyproject.toml rename to asset/pyproject.toml diff --git a/script/uv.lock b/asset/uv.lock similarity index 100% rename from script/uv.lock rename to asset/uv.lock diff --git a/script/linux_build.sh b/script/linux_build.sh new file mode 100644 index 0000000..f4eb477 --- /dev/null +++ b/script/linux_build.sh @@ -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 .. diff --git a/script/macos_build.sh b/script/macos_build.sh new file mode 100644 index 0000000..f4eb477 --- /dev/null +++ b/script/macos_build.sh @@ -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 .. diff --git a/script/windows_build.bat b/script/windows_build.bat new file mode 100644 index 0000000..fdba5d7 --- /dev/null +++ b/script/windows_build.bat @@ -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 ..