Skip to content

Commit

Permalink
Build Windows version with 64bit LLVM library.
Browse files Browse the repository at this point in the history
 1. Changed C++ standard to C++17
 2. Changed MSVC2017 to MSVC2019.
 3. Changed 32bit to 64bit with Windows only. (Linux/macOS are 64bit already)
  • Loading branch information
dougpuob committed Apr 22, 2020
1 parent fd5a495 commit 1ddf2dd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Release
build
debug
release
build*
.vscode
.idea
*.pyc
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(cppnamelint)


set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand Down
24 changes: 12 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:

variables:
- name: NAMELINT_LLVM_LIB
value: $(System.DefaultWorkingDirectory)/llvm_8_0_0_msvc2017_rel_32bit
value: $(System.DefaultWorkingDirectory)\llvm_8_0_0_msvc2019_rel_64bit
- name: BUILD_TYPE
value: Release

pool:
vmImage: "vs2017-win2016"
vmImage: "windows-2019"

steps:
- script: "set"
Expand All @@ -29,14 +29,14 @@ jobs:

- task: UniversalPackages@0
inputs:
command: "download"
downloadDirectory: "$(System.DefaultWorkingDirectory)"
feedsToUse: "internal"
vstsFeed: "78202891-aba0-41ab-952b-2152c4a57470/5d6a84a9-b3ee-4af2-88a9-0e7ceb36156d"
vstsFeedPackage: "0a8bf302-6f44-4fd6-ab0f-cec0e21d1c99"
vstsPackageVersion: "0.0.1"
verbosity: "Trace"

command: 'download'
downloadDirectory: '$(System.DefaultWorkingDirectory)'
feedsToUse: 'internal'
vstsFeed: '78202891-aba0-41ab-952b-2152c4a57470/6c9732cf-3246-4264-adef-0269b29710c6'
vstsFeedPackage: '37f4150c-328c-49cb-ba1d-a44eaea25fad'
vstsPackageVersion: '0.0.1'
verbosity: 'Trace'
- task: PowerShell@2
inputs:
filePath: 'script/build-bin-win32.ps1'
Expand All @@ -45,9 +45,9 @@ jobs:
- task: MSBuild@1
inputs:
solution: "build/windows/cppnamelint.sln"
msbuildVersion: "15.0"
msbuildVersion: "16.0"
configuration: "Release"
msbuildArchitecture: "x86" #x86, x64
msbuildArchitecture: "x64" #x86, x64

- task: PowerShell@2
inputs:
Expand Down
3 changes: 2 additions & 1 deletion script/cppnamelint.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
define_sample_dir: str = '../source/test/sample'
define_cmake_name: str = 'cmake'
define_cmakelists: str = 'CMakeLists.txt'
define_cmake_msvc:str = 'Visual Studio 15 2017'
#define_cmake_msvc:str = 'Visual Studio 15 2017'
define_cmake_msvc:str = 'Visual Studio 16 2019'


def main(forced_argv):
Expand Down
12 changes: 7 additions & 5 deletions source/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ std::string Log::Format(const char *szFmt, va_list vaList) {
free(DcLib::m_szBuf);
DcLib::m_szBuf = NULL;

DcLib::m_nBufSize = iRetSize * 2;
DcLib::m_nBufSize = (size_t)iRetSize * 2;
DcLib::m_szBuf = (char *)malloc(DcLib::m_nBufSize);
}

Expand Down Expand Up @@ -71,10 +71,12 @@ size_t Log::Out(const FlagInfo &FlagInfo, const char *szFmt, ...) {
time_t now = time(0);
tm *ltm = localtime(&now);

FileStream << "[" << Log::Fixed(1900 + ltm->tm_year, 4) << Log::Fixed(ltm->tm_mon, 2)
<< Log::Fixed(ltm->tm_mday, 2);
FileStream << "'" + Log::Fixed(ltm->tm_hour, 2) << Log::Fixed(ltm->tm_min, 2)
<< Log::Fixed(ltm->tm_sec, 2) << "]";
FileStream << "[";
// FileStream << Log::Fixed(1900 + ltm->tm_year, 4) << Log::Fixed(ltm->tm_mon, 2)
// << Log::Fixed(ltm->tm_mday, 2);
FileStream << Log::Fixed(ltm->tm_hour, 2) << Log::Fixed(ltm->tm_min, 2)
<< Log::Fixed(ltm->tm_sec, 2);
FileStream << "]";
}

//
Expand Down

0 comments on commit 1ddf2dd

Please sign in to comment.