Skip to content

Commit 0d94837

Browse files
committed
Migrate project to Visual C++
1 parent dbb2055 commit 0d94837

55 files changed

Lines changed: 3640 additions & 3973 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
version: 2.1
22
#
3-
# Copyright (c) 2023 Robert Di Pardo <dipardo.r@gmail.com>
3+
# Copyright (c) 2023,2024 Robert Di Pardo <dipardo.r@gmail.com>
44
#
55
# This Source Code Form is subject to the terms of the Mozilla Public
66
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
77
# You can obtain one at https://mozilla.org/MPL/2.0/.
88
#
99
orbs:
10-
lazarus: rdipardo/lazarus@2
1110
win: circleci/windows@5
1211

1312
references:
1413
executor: &executor
1514
executor:
1615
name: win/default
17-
shell: bash.exe
1816
development: &development
1917
filters:
2018
tags:
@@ -35,23 +33,24 @@ jobs:
3533
build:
3634
<<: *executor
3735
environment:
38-
UPX_VER: 4.2.2
36+
VisualStudioVersion: '17.0'
3937
steps:
4038
- checkout
4139
- run:
42-
name: Clone submodules
40+
name: Install CMake
4341
command: |
44-
git reset --hard
45-
git submodule sync --recursive
46-
git submodule update -f --init --remote --checkout --recursive
42+
choco install python -y
43+
refreshenv
44+
python -m pip install cmake~=3.30.0
45+
cmake --version
4746
- run:
48-
name: Install UPX
49-
command: |
50-
curl -sLO "https://github.com/upx/upx/releases/download/v$UPX_VER/upx-$UPX_VER-win64.zip"
51-
7z e upx-$UPX_VER-win64.zip -o"$WINDIR"
52-
upx.exe --version
53-
- lazarus/install:
54-
win32: true
47+
name: Install the v141_xp VC toolset
48+
command: |
49+
cd "C:\Program Files (x86)\Microsoft Visual Studio\Installer"
50+
.\vs_installer.exe modify --installPath "C:\Program Files\Microsoft Visual Studio\2022\Community" `
51+
--add Microsoft.VisualStudio.Component.VC.v141.x86.x64 `
52+
--add Microsoft.VisualStudio.Component.WinXP `
53+
--downloadThenInstall --quiet
5554
- run:
5655
name: Build and Pack
5756
command: make_release.cmd
@@ -62,14 +61,24 @@ jobs:
6261
pattern: 'v.*'
6362
value: << pipeline.git.tag >>
6463
steps:
64+
- run:
65+
name: Prepare Artifacts
66+
command: |
67+
7z a -tzip << pipeline.parameters.plugin-name >>_x64.zip ./dat/*.ini ./out/x64/Release/<< pipeline.parameters.plugin-name >>.dll
68+
7z a -tzip << pipeline.parameters.plugin-name >>_win32.zip ./dat/*.ini ./out/Win32/Release/<< pipeline.parameters.plugin-name >>_unicode.dll
69+
7z a -tzip << pipeline.parameters.plugin-name >>_arm64.zip ./dat/*.ini ./out/ARM64/Release/<< pipeline.parameters.plugin-name >>.dll
6570
- store_artifacts:
6671
name: Upload << pipeline.parameters.plugin-name >>_unicode.dll (x86)
67-
path: out/i386-win32/Release/<< pipeline.parameters.plugin-name >>_unicode.dll
68-
destination: << pipeline.parameters.plugin-name >>_unicode.dll
72+
path: << pipeline.parameters.plugin-name >>_win32.zip
73+
destination: << pipeline.parameters.plugin-name >>_win32.zip
6974
- store_artifacts:
7075
name: Upload << pipeline.parameters.plugin-name >>s.dll (x64)
71-
path: out/x86_64-win64/Release/<< pipeline.parameters.plugin-name >>.dll
72-
destination: << pipeline.parameters.plugin-name >>.dll
76+
path: << pipeline.parameters.plugin-name >>_x64.zip
77+
destination: << pipeline.parameters.plugin-name >>_x64.zip
78+
- store_artifacts:
79+
name: Upload << pipeline.parameters.plugin-name >>s.dll (ARM64)
80+
path: << pipeline.parameters.plugin-name >>_arm64.zip
81+
destination: << pipeline.parameters.plugin-name >>_arm64.zip
7382
- persist_to_workspace:
7483
root: .
7584
paths: out
@@ -88,6 +97,10 @@ jobs:
8897
name: Upload << pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>_x64.zip
8998
path: out/<< pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>_x64.zip
9099
destination: << pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>_x64.zip
100+
- store_artifacts:
101+
name: Upload << pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>_arm64.zip
102+
path: out/<< pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>_arm64.zip
103+
destination: << pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>_arm64.zip
91104
- run:
92105
name: Create Release
93106
command: |-
@@ -97,10 +110,11 @@ jobs:
97110
environment:
98111
SLUGX86: << pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>.zip
99112
SLUGX64: << pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>_x64.zip
113+
SLUGARM64: << pipeline.parameters.plugin-name >>_<< pipeline.git.tag >>_arm64.zip
100114
BIN_DIR: out
101115

102116
workflows:
103-
lazarus-build:
117+
cmake:
104118
jobs:
105119
- build:
106120
<<: *development

.circleci/scripts/bb_release.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/bash
22
#
3-
# Copyright (c) 2023 Robert Di Pardo
3+
# Copyright (c) 2023,2024 Robert Di Pardo
44
#
55
# This Source Code Form is subject to the terms of the Mozilla Public
66
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
@@ -13,11 +13,12 @@ cd "$BIN_DIR"
1313
curl -sJLO 'https://bitbucket.org/rdipardo/htmltag/downloads/sha256sums.txt'
1414
sha256sum "${SLUGX86}" >> sha256sums.txt
1515
sha256sum "${SLUGX64}" >> sha256sums.txt
16+
sha256sum "${SLUGARM64}" >> sha256sums.txt
1617

1718
curl --request POST \
1819
--url "https://api.bitbucket.org/2.0/repositories/${CIRCLE_USERNAME}/${CIRCLE_PROJECT_REPONAME}/downloads" \
1920
--header "Authorization: Bearer ${BB_REPO_TOKEN}" \
20-
-F files=@"${SLUGX86}" -F files=@"${SLUGX64}"
21+
-F files=@"${SLUGX86}" -F files=@"${SLUGX64}" -F files=@"${SLUGARM64}"
2122

2223
curl --request POST \
2324
--url "https://api.bitbucket.org/2.0/repositories/${CIRCLE_USERNAME}/${CIRCLE_PROJECT_REPONAME}/downloads" \

.clang-format

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
BasedOnStyle: LLVM
2+
AccessModifierOffset: -8
3+
AlignAfterOpenBracket: DontAlign
4+
AlignEscapedNewlines: DontAlign
5+
AlignOperands: true
6+
AlignTrailingComments: Always
7+
AllowShortFunctionsOnASingleLine: InlineOnly
8+
AllowShortIfStatementsOnASingleLine: Never
9+
AlwaysBreakTemplateDeclarations: true
10+
BreakBeforeBinaryOperators: None
11+
BreakBeforeBraces: Attach
12+
# BreakTemplateDeclarations: Yes
13+
ColumnLimit: 120
14+
Cpp11BracedListStyle: false
15+
FixNamespaceComments: false
16+
IndentCaseLabels: true
17+
IndentWidth: 8
18+
NamespaceIndentation: Inner
19+
PackConstructorInitializers: CurrentLine
20+
SortIncludes: false
21+
UseTab: Always

.clang-tidy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Checks: |
2+
clang-diagnostic-*,
3+
clang-analyzer-*,
4+
performance-*,
5+
portability-*,
6+
bugprone-*,
7+
cppcoreguidelines-*,
8+
-*avoid-c-arrays,
9+
-*avoid-non-const-global-variables,
10+
-*constant-array-index,
11+
-*easily-swappable-parameters,
12+
-*empty-catch,
13+
-*pro-type-reinterpret-cast
14+
WarningsAsErrors: ''
15+
HeaderFilterRegex: ''
16+
AnalyzeTemporaryDtors: false
17+
UseColor : true
18+
FormatStyle: 'none'

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
*.bat text eol=crlf
1212
*.cmd text eol=crlf
1313
*.rc text eol=crlf
14+
*.cpp text eol=crlf
15+
*.h text eol=crlf

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
*~
22
*.~*
3+
*.d
4+
*.slo
5+
*.lo
6+
*.o
7+
*.obj
8+
*.gch
9+
*.pch
10+
*.lai
11+
*.la
12+
*.a
13+
*.lib
14+
*.out
315
*.bak
416
*.dcu
517
*.dci
@@ -17,9 +29,15 @@
1729
*.todo
1830
*.tvsconfig
1931
*.zip
32+
_deps/
33+
CMakeFiles/
34+
CPM_modules/
2035
*/__history/
2136
*/__recovery/
2237
**/backup/
38+
**/build/
2339
[Ll]ib/**/*
2440
[Bb]in/**/*
41+
.vscode/*
42+
!.vscode/settings.json
2543
out/

.gitmodules

Lines changed: 0 additions & 7 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"C_Cpp.intelliSenseEngine": "default",
3+
"C_Cpp.default.cppStandard": "c++17",
4+
"C_Cpp.default.defines": [
5+
"${default}",
6+
"NOMINMAX",
7+
"_CRT_SECURE_NO_WARNINGS",
8+
"_USING_V110_SDK71_",
9+
"_WIN32_WINNT=_WIN32_WINNT_WINXP",
10+
"NTDDI_VERSION=NTDDI_WINXPSP3"
11+
],
12+
"C_Cpp.autoAddFileAssociations": false,
13+
"C_Cpp.codeAnalysis.runAutomatically": false
14+
}

build.cmd

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,62 @@
11
@echo off
22
::
3-
:: Copyright (c) 2023 Robert Di Pardo <dipardo.r@gmail.com>
3+
:: Copyright (c) 2023,2024 Robert Di Pardo <dipardo.r@gmail.com>
44
::
55
:: This Source Code Form is subject to the terms of the Mozilla Public
66
:: License, v. 2.0. If a copy of the MPL was not distributed with this file,
77
:: You can obtain one at https://mozilla.org/MPL/2.0/.
88
::
9-
SETLOCAL
9+
SETLOCAL EnableDelayedExpansion
1010

11-
set "FPC_BUILD_TYPE=Debug"
12-
set "FPC_CPU=x86_64"
11+
set "CMAKE_BUILD_TYPE=Debug"
12+
set "CMAKE_GENERATOR_PLATFORM=x64"
1313

14-
if "%1" NEQ "" ( set "FPC_BUILD_TYPE=%1" )
15-
if "%2" NEQ "" ( set "FPC_CPU=%2" )
16-
call :%FPC_BUILD_TYPE% 2>NUL:
17-
if %errorlevel%==1 ( goto :USAGE )
14+
if "%1" NEQ "" ( set "CMAKE_BUILD_TYPE=%1" )
15+
if "%2" NEQ "" ( set "CMAKE_GENERATOR_PLATFORM=%2" )
16+
goto :%CMAKE_BUILD_TYPE%
1817

1918
:Release
19+
:MinSizeRel
2020
del /S /Q /F out\*.zip 2>NUL:
2121

2222
:Debug
23-
call %~dp0src\Forms\suppress_ole_init.cmd
24-
if %errorlevel%==2 (
25-
echo Patch failed
26-
goto :END
23+
:RelWithDebInfo
24+
if /I "%4"=="nmake" (
25+
set "NMAKE_BUILD=true"
2726
)
27+
if /I "%4"=="clang" (
28+
set "CMAKE_TOOL_CHAIN=-DCMAKE_CXX_COMPILER=clang++"
29+
set "NMAKE_BUILD=true"
30+
)
31+
if "%NMAKE_BUILD%" NEQ "" (
32+
set "CMAKE_GENERATOR=NMake Makefiles"
33+
set "CMAKE_GENERATOR_PLATFORM=%VSCMD_ARG_TGT_ARCH%"
34+
echo :: ===================================================
35+
echo :: NOTE: This environment only supports %VSCMD_ARG_TGT_ARCH% targets
36+
echo :: ===================================================
37+
) else (
38+
if "%CMAKE_GENERATOR_PLATFORM%"=="x86" ( set "CMAKE_GENERATOR_PLATFORM=Win32" )
39+
set "CMAKE_GENERATOR=Visual Studio %VisualStudioVersion:.0=%"
40+
set "CONFIG_PARAMS=-A !CMAKE_GENERATOR_PLATFORM!"
41+
set "BUILD_PARAMS=--config %CMAKE_BUILD_TYPE%"
42+
)
43+
44+
set "BUILD_DIR=build\!CMAKE_GENERATOR_PLATFORM!\%CMAKE_BUILD_TYPE%"
2845

29-
set "BUILD_ALL="
30-
if "%3"=="clean" (
31-
rmdir /S /Q out 2>NUL:
32-
set "BUILD_ALL=-B"
46+
if /I "%3"=="clean" (
47+
del /S /Q "%BUILD_DIR%\CMakeCache.txt" 2>NUL:
48+
set "CLEAN_FIRST=--clean-first"
3349
)
3450

35-
lazbuild %BUILD_ALL% --bm=%FPC_BUILD_TYPE% --cpu=%FPC_CPU% src\prj\HTMLTag.lpi
51+
cmake -Hsrc\prj -B%BUILD_DIR% -G"!CMAKE_GENERATOR!" %CONFIG_PARAMS% %CMAKE_TOOL_CHAIN% ^
52+
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% -DTARGET_PLATFORM=!CMAKE_GENERATOR_PLATFORM!
53+
if %errorlevel% NEQ 0 ( goto :END )
54+
cmake --build %BUILD_DIR% %BUILD_PARAMS% %CLEAN_FIRST%
3655
goto :END
3756

38-
:USAGE
39-
echo Usage: ".\%~n0 [Debug,Release] [i386,x86_64] [clean]"
57+
:-?
58+
:help
59+
echo Usage: ".\%~n0 [Debug,Release,MinSizeRel,RelWithDebInfo] [x86,x64,ARM64] [clean] [nmake,clang]"
4060

4161
:END
4262
exit /B %errorlevel%

dat/HTMLTag-translations.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ menu_5 = "Entitäten kodieren (&Zeilenenden eingeschlossen)"
104104
menu_6 = "Entitäten ent&schlüsseln"
105105
menu_7 = "&Unicode-Zeichen kodieren"
106106
menu_8 = "Unic&ode-Zeichen entschlüsseln"
107-
menu_8 = "Automatische Entschlüsselung von Entitäten aktivieren"
108-
menu_9 = "Automatische Entschlüsselung von Unicode-Zeichen aktivieren"
107+
menu_9 = "Automatische Entschlüsselung von Entitäten aktivieren"
108+
menu_10 = "Automatische Entschlüsselung von Unicode-Zeichen aktivieren"
109109
menu_11 = "Übe&r..."
110110
err_compat = "Diese Version von HTML Tag erfordert Notepad++ 8.3 oder höher. Die Befehle des Plugins wurden deaktiviert."
111111
err_config = "Entitätsdatei nicht gefunden"

0 commit comments

Comments
 (0)