Skip to content

Commit

Permalink
- added changes from PR#115 to a single new commit/PR
Browse files Browse the repository at this point in the history
- added win32 x64 build
- added initial appveyor config
- some win32 x64 compiler warning fixes
  • Loading branch information
chcg committed Mar 2, 2017
1 parent 4774005 commit f54d2e5
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 7 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ if (MINGW)
set (CMAKE_MODULE_LINKER_FLAGS
"-s -static"
)
else (MINGW)
set (defs
-DUNICODE -D_UNICODE -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES -D_CRT_SECURE_NO_WARNINGS -D_WIN32 -DWIN32
-D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN -DNOCOMM -DLIBSSH_STATIC
)

set (CMAKE_CXX_FLAGS
"/EHsc /MP /W4"
)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif (MINGW)

set (project_rc_files
Expand Down Expand Up @@ -122,6 +133,8 @@ if (MINGW)
SET(CMAKE_SHARED_LIBRARY_PREFIX "")

target_link_libraries (NppFTP comctl32 shlwapi ssh ssl crypto z ws2_32)
else (MINGW)
target_link_libraries (NppFTP comctl32 shlwapi ssh libeay32 ssleay32 zlib ws2_32)
endif (MINGW)

# build a CPack driven zip package
Expand Down
2 changes: 1 addition & 1 deletion UTCP/src/UTDataSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ long CUT_DataSource::Find(LPCSTR szStrToFind, size_t nStartOffset, BOOL bCaseSen
while( (nBytesRead = Read(szBuffer, FIND_BUFFER_SIZE - 1)) > nStrLength ) {

// Terminate buffer with NULL
szBuffer[nBytesRead] = NULL;
szBuffer[nBytesRead] = '\0';

// Convert to upper case if case insensitive search
if(!bCaseSensitive)
Expand Down
4 changes: 2 additions & 2 deletions UTCP/src/uh_ctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int CUH_Control::CreateHistoryWindow(HWND parent,DWORD style,RECT &rect){
return UH_ERROR;

#ifdef WIN32
HINSTANCE hInstance = (HINSTANCE)(ULONG_PTR)GetWindowLong(parent,GWLP_HINSTANCE);
HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(parent,GWLP_HINSTANCE);
#else
HINSTANCE hInstance = (HINSTANCE)GetWindowWord(parent,GWW_HINSTANCE);
#endif
Expand Down Expand Up @@ -258,7 +258,7 @@ LRESULT CALLBACK CUH_Control::WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARA
}

//get the pointer to the calling class
CUH_Control *_this = (CUH_Control*)(ULONG_PTR)GetWindowLong(hwnd,0);
CUH_Control *_this = (CUH_Control*)GetWindowLongPtr(hwnd,0);

//call the functions that match in incoming message
if(_this != NULL){
Expand Down
2 changes: 1 addition & 1 deletion UTCP/src/ut_clnt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ LRESULT CALLBACK CUT_WSClient::WndProc(HWND hwnd, UINT message, WPARAM wParam, L
}

// Get the pointer to the calling class
CUT_WSClient *_this = (CUT_WSClient*)(ULONG_PTR)GetWindowLong(hwnd,0);
CUT_WSClient *_this = (CUT_WSClient*)GetWindowLongPtr(hwnd,0);

// Call the functions that match in incoming message
if (_this == NULL)
Expand Down
66 changes: 66 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: 0.26.8.{build}
image: Visual Studio 2015


environment:
matrix:
- PlatformToolset: v140_xp
#- PlatformToolset: v120_xp

platform:
- x64
- Win32

configuration:
- Release
#- Debug

install:
- if "%platform%"=="x64" set archi=amd64
- if "%platform%"=="Win32" set archi=x86
- if "%PlatformToolset%"=="v140_xp" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %archi%
- if "%PlatformToolset%"=="v120_xp" call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %archi%

build:
verbosity: minimal

before_build:
- ps: |
Write-Output "Configuration: $env:CONFIGURATION"
Write-Output "Platform: $env:PLATFORM"
$generator = switch ($env:PLATFORMTOOLSET)
{
"v140_xp" {"Visual Studio 14 2015"}
"v120_xp" {"Visual Studio 12 2013"}
}
if ($env:PLATFORM -eq "x64")
{
$generator = "$generator Win64"
}
build_script:
- cd "%APPVEYOR_BUILD_FOLDER%"
# Python 3 needed
- set PATH=C:\Python34-x64;C:\Python34-x64\Scripts;%PATH%
#done within cmake - if "%platform%"=="X64" python build_3rdparty.py x64 msvc_x64
#done within cmake - if "%platform%"=="Win32" C:\Python34-x64\python build_3rdparty.py
- mkdir _build
- cd _build

- ps: |
cmake -G "$generator" -T "$env:PLATFORMTOOLSET" ..
if ($LastExitCode -ne 0) {
throw "Exec: $ErrorMessage"
}
& cmake --build . --config $env:CONFIGURATION
if ($LastExitCode -ne 0) {
throw "Exec: $ErrorMessage"
}
after_build:
- cd "%APPVEYOR_BUILD_FOLDER%"
- ps: >-
if ($env:CONFIGURATION -eq "Release") {
Push-AppveyorArtifact "_build\Release\NppFTP.dll" -FileName "NppFTP.dll"
}
37 changes: 35 additions & 2 deletions build_3rdparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@
'msvc': {
'result': ['include/openssl/ssl.h', 'lib/libeay32.lib', 'lib/ssleay32.lib'],
'commands': [
'perl Configure --openssldir=%(dest)s no-shared no-asm VC-WIN32',
'perl Configure --openssldir=%(dest)s no-shared no-asm VC-WIN32',
'ms\\do_ms.bat',
'nmake /f ms\\nt.mak install'
]
},
'msvc_x64': {
'result': ['include/openssl/ssl.h', 'lib/libeay32.lib', 'lib/ssleay32.lib'],
'commands': [
'perl Configure --openssldir=%(dest)s no-shared no-asm VC-WIN64A',
'ms\\do_win64a.bat',
'nmake /f ms\\nt.mak install'
]
}
}
},
Expand All @@ -48,6 +56,16 @@
'copy /Y zconf.h %(dest)s\\include >nul',
'copy /Y zlib.lib %(dest)s\\lib >nul'
]
},
'msvc_x64': {
'result': ['include/zlib.h', 'include/zconf.h', 'lib/zlib.lib'],
'replace': [('win32/Makefile.msc', '-MD', '-MT')],
'commands': [
'nmake /f win32/Makefile.msc zlib.lib',
'copy /Y zlib.h %(dest)s\\include >nul',
'copy /Y zconf.h %(dest)s\\include >nul',
'copy /Y zlib.lib %(dest)s\\lib >nul'
]
}
}
},
Expand Down Expand Up @@ -80,6 +98,18 @@
'del %(dest)s\\lib\\ssh.lib >nul',
'move %(dest)s\\lib\\static\\ssh.lib %(dest)s\\lib >nul'
]
},
'msvc_x64': {
'result': ['include/libssh/libssh.h', 'lib/ssh.lib'],
'commands': [
'cmake -G "NMake Makefiles" -DWITH_STATIC_LIB=ON -DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Ob2 /D NDEBUG" "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Ob2 /D NDEBUG" \
-DOPENSSL_INCLUDE_DIRS=%(dest)s\\include -DOPENSSL_CRYPTO_LIBRARY=%(dest)s\\lib\\libeay32.lib \
-DCMAKE_INSTALL_PREFIX=%(dest)s -DCMAKE_PREFIX_PATH=%(dest)s %(src)s',
'nmake install',
'del %(dest)s\\lib\\ssh.lib >nul',
'move %(dest)s\\lib\\static\\ssh.lib %(dest)s\\lib >nul'
]
}
}
}
Expand Down Expand Up @@ -162,7 +192,10 @@ def main(outdir, prefix):
mkdir_p(dest, 'include')
mkdir_p(dest, 'lib')

target = platform.system() == 'Windows' and 'msvc' or 'mingw-w64'
if(prefix == 'msvc_x64'):
target = 'msvc_x64'
else:
target = platform.system() == 'Windows' and 'msvc' or 'mingw-w64'
for library in sorted(DEPENDENT_LIBS, key=lambda x: DEPENDENT_LIBS[x]['order']):
if target not in DEPENDENT_LIBS[library]['target']:
print('%s: skipping (not available)' % library)
Expand Down
2 changes: 1 addition & 1 deletion src/StdInc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define _WIN32_WINNT 0x0501
#include <winsock2.h>
#include <windows.h>
#include <shellapi.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <tchar.h>
#include <uxtheme.h>
Expand Down

0 comments on commit f54d2e5

Please sign in to comment.