Skip to content

Commit

Permalink
Merge 56d0e49 into 47cdec2
Browse files Browse the repository at this point in the history
  • Loading branch information
berryzplus committed Jun 17, 2024
2 parents 47cdec2 + 56d0e49 commit 4746722
Show file tree
Hide file tree
Showing 21 changed files with 309 additions and 275 deletions.
96 changes: 0 additions & 96 deletions HeaderMake/HeaderMake.vcxproj

This file was deleted.

11 changes: 3 additions & 8 deletions build-gnu.bat
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ if "%configuration%" == "Release" (
@rem path=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%path%
path=C:\msys64\usr\bin;%path:C:\msys64\usr\bin;=%
path=C:\msys64\mingw64\bin;%path:C:\msys64\mingw64\bin;=%
path=%path%;%VCPKG_INSTALLATION_ROOT%

vcpkg.exe integrate install

:: find generic tools
if not defined CMD_NINJA call %~dp0tools\find-tools.bat
Expand Down Expand Up @@ -68,14 +71,6 @@ if errorlevel 1 (
)
popd

@rem build "googletest".
call %~dp0tests\googletest.build.cmd %~dp0build\%platform%\%configuration%\gtest_build\ %~dp0build\%platform%\%configuration%\googletest\
if errorlevel 1 (
echo error 2 errorlevel %errorlevel%
popd
exit /b 1
)

@rem build "tests1".
set TESTS1_MAKEFILE=%~dp0tests\unittests\Makefile
set TESTS1_BUILD_DIR=%~dp0build\%platform%\%configuration%\tests1
Expand Down
5 changes: 5 additions & 0 deletions build-sln.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ if "%configuration%" == "Release" (
call :showhelp %0
exit /b 1
)

set path=%path%;%VCPKG_INSTALLATION_ROOT%

vcpkg.exe integrate install

if not defined CMD_MSBUILD call %~dp0tools\find-tools.bat
if not defined CMD_MSBUILD (
echo msbuild.exe was not found.
Expand Down
6 changes: 2 additions & 4 deletions ci/build-batchfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
|[sakura\preBuild.bat](../sakura/preBuild.bat) | 特に何もしない |
|[sakura\githash.bat](../sakura/githash.bat) | Git や CI の環境変数から githash.h を生成する |
|[sakura\postBuild.bat](../sakura/postBuild.bat) | bregonig.dll と ctags.exe を展開しコピーする |
|[tests\googletest.build.cmd](../tests/googletest.build.cmd) | Google Test をビルドする |
|[tests\compiletests.run.cmd](../tests/compiletests.run.cmd) | コンパイルテストを実行する |
|[build-sonar-qube-finish.bat](../build-sonar-qube-finish.bat) | SonarQube の解析結果をアップロードする |
|[parse-buildlog.bat](../parse-buildlog.bat) | ビルドログを解析する |
Expand All @@ -51,16 +50,14 @@ SonarQube に関しては [こちら](../SonarQube.md) も参照してくださ
- [tools\zip\unzip.bat](../tools/zip/unzip.bat) : ZIP ファイルを展開する
- 7z.exe または [tools\zip\unzip.ps1](../tools/zip/unzip.ps1)
- MSBuild.exe sakura.sln
- vcpkg.exe
- [sakura\preBuild.bat](../sakura/preBuild.bat)
- HeaderMake.exe : Funccode_define.h, Funccode_enum.h を生成する
- [sakura\githash.bat](../sakura/githash.bat)
- git.exe
- [sakura\postBuild.bat](../sakura/postBuild.bat)
- [tools\zip\unzip.bat](../tools/zip/unzip.bat)
- 7z.exe または [tools\zip\unzip.ps1](../tools/zip/unzip.ps1)
- [tests\googletest.build.cmd](../tests/googletest.build.cmd)
- git.exe
- cmake.exe
- [tests\compiletests.run.cmd](../tests/compiletests.run.cmd)
- cmake.exe
- [build-sonar-qube-finish.bat](../build-sonar-qube-finish.bat)
Expand All @@ -73,6 +70,7 @@ SonarQube に関しては [こちら](../SonarQube.md) も参照してくださ
- mingw32-make.exe sakura_core
- [sakura\githash.bat](../sakura/githash.bat)
- git.exe
- vcpkg.exe
- HeaderMake.exe
- [build-chm.bat](../build-chm.bat)
- [help\remove-comment.py](../help/remove-comment.py) : [sakura_core\sakura.hh](../sakura_core/sakura.hh) に記述された日本語を含む行コメントを削除する
Expand Down
19 changes: 9 additions & 10 deletions sakura.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sakura", "sakura\sakura.vcxproj", "{AF03508C-515E-4A0E-87BE-67ED1E254BD0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HeaderMake", "HeaderMake\HeaderMake.vcxproj", "{0F2918B0-23E3-42E8-A1A8-8739F726A23E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sakura_lang_en_US", "sakura_lang_en_US\sakura_lang_en_US.vcxproj", "{7A6D0F29-E560-4985-835B-5F92A08EB242}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests1", "tests\unittests\tests1.vcxproj", "{701E3407-EC27-49F7-ADC7-520CF2B4B438}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DD14BD9B-2E0F-4C53-8F16-EA9969FDEA45}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.vsconfig = .vsconfig
sakura_core\Funccode_x.hsrc = sakura_core\Funccode_x.hsrc
sakura\sakura.natvis = sakura\sakura.natvis
sonar-project.properties = sonar-project.properties
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand All @@ -26,14 +33,6 @@ Global
{AF03508C-515E-4A0E-87BE-67ED1E254BD0}.Release|Win32.Build.0 = Release|Win32
{AF03508C-515E-4A0E-87BE-67ED1E254BD0}.Release|x64.ActiveCfg = Release|x64
{AF03508C-515E-4A0E-87BE-67ED1E254BD0}.Release|x64.Build.0 = Release|x64
{0F2918B0-23E3-42E8-A1A8-8739F726A23E}.Debug|Win32.ActiveCfg = Debug|Win32
{0F2918B0-23E3-42E8-A1A8-8739F726A23E}.Debug|Win32.Build.0 = Debug|Win32
{0F2918B0-23E3-42E8-A1A8-8739F726A23E}.Debug|x64.ActiveCfg = Debug|Win32
{0F2918B0-23E3-42E8-A1A8-8739F726A23E}.Debug|x64.Build.0 = Debug|Win32
{0F2918B0-23E3-42E8-A1A8-8739F726A23E}.Release|Win32.ActiveCfg = Release|Win32
{0F2918B0-23E3-42E8-A1A8-8739F726A23E}.Release|Win32.Build.0 = Release|Win32
{0F2918B0-23E3-42E8-A1A8-8739F726A23E}.Release|x64.ActiveCfg = Release|Win32
{0F2918B0-23E3-42E8-A1A8-8739F726A23E}.Release|x64.Build.0 = Release|Win32
{7A6D0F29-E560-4985-835B-5F92A08EB242}.Debug|Win32.ActiveCfg = Debug|Win32
{7A6D0F29-E560-4985-835B-5F92A08EB242}.Debug|Win32.Build.0 = Debug|Win32
{7A6D0F29-E560-4985-835B-5F92A08EB242}.Debug|x64.ActiveCfg = Debug|x64
Expand Down
23 changes: 16 additions & 7 deletions sakura/funccode.targets
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Vcpkg">
<VcpkgConfiguration Condition="'$(Configuration)'=='Debug'">Debug</VcpkgConfiguration>
<VcpkgEnableManifest>true</VcpkgEnableManifest>
<VcpkgManifestDirectory>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', '..\'))</VcpkgManifestDirectory>
<VcpkgInstalledDir>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', '..\build\vcpkg_installed\'))</VcpkgInstalledDir>
<VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows-static</VcpkgTriplet>
<VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows-static</VcpkgTriplet>
<VcpkgUseStatic>true</VcpkgUseStatic>
</PropertyGroup>
<PropertyGroup Label="FuncCode">
<HeaderMake>..\Win32\$(Configuration)\HeaderMake.exe</HeaderMake>
<HeaderMake>$(VcpkgInstalledDir)$(VcpkgTriplet)\tools\header-make\HeaderMake.exe</HeaderMake>
<FuncCodeDefine>..\sakura_core\Funccode_define.h</FuncCodeDefine>
<FuncCodeEnum>..\sakura_core\Funccode_enum.h</FuncCodeEnum>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\HeaderMake\HeaderMake.vcxproj">
<Project>{0f2918b0-23e3-42e8-a1a8-8739f726a23e}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Target Name="InstallHeaderMake"
Condition="!Exists('$(HeaderMake)')"
AfterTargets="GenerateGitHash"
BeforeTargets="FuncCodeDefine;FuncCodeEnum">
<Exec Command="chcp 65001 &gt;NUL &amp;&amp; $(VcpkgRoot)\vcpkg.exe install --x-wait-for-lock --triplet &quot;$(VcpkgTriplet)&quot; --vcpkg-root &quot;$(VcpkgRoot)&quot; &quot;--x-manifest-root=$(VcpkgManifestDirectory.TrimEnd('\'))&quot; &quot;--x-install-root=$(VcpkgInstalledDir.TrimEnd('\'))&quot;" StdOutEncoding="UTF-8" StdErrEncoding="UTF-8" WorkingDirectory="$(MSBuildThisFileDirectory).." />
</Target>
<Target Name="_WriteFuncCodeDefineRcTlogs"
Condition="'@(FuncCodeRes)' != '' and '@(SelectedFiles)' == ''">
<ItemGroup>
Expand Down
22 changes: 14 additions & 8 deletions sakura_core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ endif
# If empty, they will be output to the default directories.
OUTDIR =

CURRENT_INSTALLED_DIR = ../../../vcpkg_installed

TARGET_TRIPLET = x64-mingw-static

ifeq ($(SHELL),sh.exe)
# If cmd.exe is used as a shell.
MKDIR = md
Expand Down Expand Up @@ -78,13 +82,18 @@ CFLAGS= \
-fexec-charset=cp932 \
-MMD \
-I. \
-I$(CURRENT_INSTALLED_DIR)/$(TARGET_TRIPLET)/include \
-I$(SRCDIR) \
$(DEFINES) $(MYCFLAGS)
CXXFLAGS= $(CFLAGS) \
-std=c++17 \
$(MYCXXFLAGS)
LIBS= \
LDFLAGS= \
-static \
-mwindows \
-municode \
-L$(CURRENT_INSTALLED_DIR)/$(TARGET_TRIPLET)/lib
LIBS= \
-lwinspool \
-lole32 \
-loleaut32 \
Expand All @@ -99,8 +108,6 @@ LIBS= \
-lwindowscodecs \
-lmsimg32 \
-lurlmon \
-mwindows \
-municode \
$(MYLIBS)

exe= $(or $(OUTDIR),.)/sakura.exe
Expand All @@ -123,15 +130,14 @@ GENERATED_FILES= \
Funccode_enum.h \
githash.h \

HEADERMAKETOOLDIR= $(SRCDIR)/../HeaderMake
HEADERMAKE= $(or $(OUTDIR),$(HEADERMAKETOOLDIR))/HeaderMake.exe
HEADERMAKE = $(CURRENT_INSTALLED_DIR)/$(TARGET_TRIPLET)/tools/header-make/HeaderMake.exe

all: $(exe) \
$(bregonig) \
$(ctags)

$(exe): $(OBJS) sakura_rc.o
$(CXX) -o $@ $(OBJS) sakura_rc.o $(LIBS)
$(CXX) $(LDFLAGS) -o $@ $(OBJS) sakura_rc.o $(LIBS)

$(bregonig): ../installer/externals/bregonig/bron420.zip
$(P7Z) e $< -o$(@D) -y x64/$(@F)
Expand Down Expand Up @@ -159,8 +165,8 @@ endif

$(OBJS): StdAfx.h.gch

$(HEADERMAKE): $(HEADERMAKETOOLDIR)/HeaderMake.cpp
$(CXX) $(CXXFLAGS:-MMD=) $< -o $@ -static-libgcc
$(HEADERMAKE): ../HeaderMake/HeaderMake.cpp
vcpkg install --x-wait-for-lock --triplet $(TARGET_TRIPLET) "--x-manifest-root=$(SRCDIR)/../" "--x-install-root=$(CURRENT_INSTALLED_DIR)"

sakura_rc.o: sakura_rc.rc.utf8 sakura_rc.rc2.utf8 githash.h Funccode_define.h
$(RC) -c utf-8 --language=0411 $(DEFINES) -I. -I$(SRCDIR) $< -o $@
Expand Down
89 changes: 0 additions & 89 deletions tests/googletest.build.cmd

This file was deleted.

Loading

0 comments on commit 4746722

Please sign in to comment.