1
0

feat: change project layout for new added project

This commit is contained in:
2026-01-30 15:23:01 +08:00
parent 2b9c0296d1
commit 2f59e16590
28 changed files with 161 additions and 36 deletions

0
.github/scripts/linux.sh vendored Normal file
View File

0
.github/scripts/macos.sh vendored Normal file
View File

18
.github/scripts/windows.bat vendored Normal file
View 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 -DYYCC_BUILD_TEST=ON -DGTest_ROOT=%GTest_ROOT% -DYYCC_BUILD_BENCHMARK=ON -Dbenchmark_ROOT=%benchmark_ROOT% ../..
cmake --build . --config Release
cmake --install . --prefix=../install --config Release
:: Back to root directory
CD ..
CD ..

0
.github/scripts/yycc-linux.sh vendored Normal file
View File

0
.github/scripts/yycc-macos.sh vendored Normal file
View File

0
.github/scripts/yycc-windows.bat vendored Normal file
View File

0
.github/scripts/zlib-linux.sh vendored Normal file
View File

0
.github/scripts/zlib-macos.sh vendored Normal file
View File

0
.github/scripts/zlib-windows.bat vendored Normal file
View File

0
.github/workflows/linux.yml vendored Normal file
View File

0
.github/workflows/macos.yml vendored Normal file
View File

87
.github/workflows/windows.yml vendored Normal file
View File

@@ -0,0 +1,87 @@
name: YYCC Windows Build
on: [workflow_dispatch]
jobs:
windows-build:
strategy:
matrix:
include:
- vs: '2022'
msvc_arch: 'x64'
runs-on: windows-2022
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Fetch YYCCommonplace
uses: actions/checkout@v4
with:
repository: 'yyc12345/YYCCommonplace'
ref: 'master'
path: 'extern/YYCCommonplace'
- name: Build YYCCommonplace
shell: cmd
run: |
:: Enter directory
cd extern/YYCCommonplace
:: Build library
..\..\.github\scripts\yycc-windows.bat
:: Fetch install directory
cd install
echo set YYCCommonplace_ROOT=%CD% > ../../envs.bat
cd ..
cd ../..
- name: Fetch ZLIB
uses: actions/checkout@v4
with:
repository: 'madler/zlib'
ref: 'v1.3.1'
path: 'extern/zlib'
- name: Build ZLIB
shell: cmd
run: |
:: Enter directory
cd extern/zlib
:: Build library
..\..\.github\scripts\zlib-windows.bat
:: Fetch install directory
cd install
echo set ZLIB_ROOT=%CD% >> ../../envs.bat
cd ..
cd ../..
- name: Fetch STB
uses: actions/checkout@v4
with:
repository: 'nothings/stb'
ref: '2e2bef463a5b53ddf8bb788e25da6b8506314c08'
path: 'extern/stb'
- name: Build STB
shell: cmd
run: |
:: Enter directory
cd extern/stb
:: Fetch install directory
echo set STB_ROOT=%CD% >> ../envs.bat
cd ../..
- name: Build LibCmo
shell: cmd
run: |
:: Prepare Visual Studio
set VS=${{ matrix.vs }}
set VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
call %VCVARS% ${{ matrix.msvc_arch }}
:: Extract saved environment variables
call .\extern\envs.bat
:: Build Project
.\.github\script\windows.bat
- name: Upload Built Artifact
uses: actions/upload-artifact@v4
with:
name: LibCmo-windows-build
path: bin/install/*
retention-days: 30

10
.gitignore vendored
View File

@@ -1,10 +1,10 @@
## ======== Personal ========
# Ignore build resources
out/
build/
install/
extern/
temp/
[Oo]ut/
[Bb]uild/
[Ii]nstall/
[Ee]xtern/
[Tt]emp/
# Ignore all possible test used Virtools files
*.nmo

View File

@@ -1,28 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BMapSharp", "BMapSharp\BMapSharp.csproj", "{604F426A-EC91-4E17-BE58-74565B24946C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BMapSharpTestbench", "BMapSharpTestbench\BMapSharpTestbench.csproj", "{3490D77F-119B-48EF-AA0B-E715EBE80DAA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{604F426A-EC91-4E17-BE58-74565B24946C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{604F426A-EC91-4E17-BE58-74565B24946C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{604F426A-EC91-4E17-BE58-74565B24946C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{604F426A-EC91-4E17-BE58-74565B24946C}.Release|Any CPU.Build.0 = Release|Any CPU
{3490D77F-119B-48EF-AA0B-E715EBE80DAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3490D77F-119B-48EF-AA0B-E715EBE80DAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3490D77F-119B-48EF-AA0B-E715EBE80DAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3490D77F-119B-48EF-AA0B-E715EBE80DAA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,4 @@
<Solution>
<Project Path="BMapSharp/BMapSharp.csproj" />
<Project Path="BMapSharpTestbench/BMapSharpTestbench.csproj" />
</Solution>

View File

@@ -53,7 +53,7 @@ write_basic_package_version_file(
COMPATIBILITY SameMinorVersion
)
configure_package_config_file(
${CMAKE_CURRENT_LIST_DIR}/../CMake/BMapConfig.cmake.in
${CMAKE_CURRENT_LIST_DIR}/../../CMake/BMapConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/BMapConfig.cmake"
INSTALL_DESTINATION ${NEMO_INSTALL_LIB_PATH}/cmake/BMap
)

View File

@@ -0,0 +1,4 @@
int main(int argc, char *argv[]) {
return 0;
}

View File

@@ -0,0 +1,32 @@
# Create executable
add_executable(BMapInspector "")
# Setup sources
target_sources(BMapInspector
PRIVATE
BMapInspector.cpp
Utils.cpp
)
# Setup headers
target_sources(BMapInspector
PRIVATE
FILE_SET HEADERS
FILES
Utils.hpp
Rule.hpp
)
# Setup header infomation
target_include_directories(BMapInspector
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}"
)
# Setup linked library infomation
target_link_libraries(BMapInspector
PRIVATE
YYCC::YYCCommonplace
LibCmo
)
# Install BMapInspector
install(TARGETS BMapInspector
RUNTIME DESTINATION ${YYCC_INSTALL_BIN_PATH}
)

View File

View File

View File

View File

6
Ballance/CMakeLists.txt Normal file
View File

@@ -0,0 +1,6 @@
if (NEMO_BUILD_BMAP)
add_subdirectory(BMap)
endif ()
if (NEMO_BUILD_BMAPINSPECTOR)
add_subdirectory(BMapInspector)
endif ()

View File

@@ -8,7 +8,9 @@ project(NeMo
# Provide options
option(NEMO_BUILD_UNVIRT "Build Unvirt, the console interface operator of LibCmo." ON)
option(NEMO_BUILD_BALLANCE "Build Ballance stuff, including BMap and BMapInspector." OFF)
option(NEMO_BUILD_BMAP "Build BMap, the example use of LibCmo which can read and write Ballance game map." OFF)
option(NEMO_BUILD_BMAPINSPECTOR "Build BMapInspector, the example use of LibCmo which can validate Ballance game map." OFF)
option(NEMO_BUILD_DOC "Build document of LibCmo and all related stuff." OFF)
# Set C++ standards
@@ -54,8 +56,8 @@ add_subdirectory(LibCmo)
if (NEMO_BUILD_UNVIRT)
add_subdirectory(Unvirt)
endif ()
if (NEMO_BUILD_BMAP)
add_subdirectory(BMap)
if (NEMO_BUILD_BALLANCE)
add_subdirectory(Ballance)
endif ()
if (NEMO_BUILD_DOC)
add_subdirectory(Documents)