Skip to content

Commit 6b264e2

Browse files
committed
try to use CMAKE_INTDIR definition
1 parent f3c690e commit 6b264e2

File tree

2 files changed

+13
-35
lines changed

2 files changed

+13
-35
lines changed

misc/appveyor.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,43 +26,12 @@ environment:
2626
WIN_ICONV_VER: master
2727

2828
matrix:
29-
- PLAT: Win64
30-
VS_VERSION: "2022"
31-
TDSVER: "7.4"
32-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
33-
34-
- PLAT: Win64
35-
VS_VERSION: "2019"
36-
TDSVER: "7.4"
37-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
38-
39-
- PLAT: Win32
40-
VS_VERSION: "2017"
41-
TDSVER: "7.3"
42-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
43-
ODBC_MARS: "1"
44-
45-
- PLAT: Win64
46-
VS_VERSION: "2015"
47-
TDSVER: "7.2"
48-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
49-
5029
- PLAT: Win64
5130
VS_VERSION: "2013"
5231
TDSVER: "auto"
5332
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
5433
ODBC_MARS: "1"
5534

56-
- PLAT: Win32
57-
VS_VERSION: "2010"
58-
TDSVER: "7.1"
59-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
60-
61-
- PLAT: Win32
62-
VS_VERSION: "2008"
63-
TDSVER: "7.0"
64-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
65-
6635
configuration:
6736
- release
6837

@@ -174,7 +143,7 @@ test_script:
174143
# Add dirs of our just built DLLs to PATH envvar so everything works with older cmake
175144
- >-
176145
if %VS_VERSION% lss 2019 set
177-
PATH=%CD%\src\ctlib%CONFIG_DEBUG:~1,-1%;%CD%\src\dblib%CONFIG_DEBUG:~1,-1%;%CD%\src\apps%CONFIG_DEBUG:~1,-1%;%PATH%
146+
PATH=%CD%\src\ctlib%CONFIG_DEBUG:~1,-1%;%CD%\src\dblib%CONFIG_DEBUG:~1,-1%;%PATH%
178147
# register ODBC driver
179148
- >-
180149
%WINDIR%\SysWOW64\regsvr32 /s src\odbc\%CONFIG_DEBUG:~2%tdsodbc.dll ||

src/apps/unittests/defncopy.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,18 +396,27 @@ update_path(void)
396396
assert(len > 0);
397397
setenv(name, path, 1);
398398
#else
399+
const tds_dir_char only = L"PATH=..";
400+
const tds_dir_char start = L"PATH=..;%s";
399401
tds_dir_char *p;
400402
size_t len;
401403

404+
#ifdef CMAKE_INTDIR
405+
if (CMAKE_INTDIR[0]) {
406+
only = L"PATH=..\\..\\" TDS_DIR(CMAKE_INTDIR);
407+
start = L"PATH=..\\..\\" TDS_DIR(CMAKE_INTDIR) L";%s";
408+
}
409+
#endif
410+
402411
if (!path) {
403-
_wputenv(L"PATH=..");
412+
_wputenv(only);
404413
return;
405414
}
406415

407-
len = tds_dir_len(path) + 10;
416+
len = tds_dir_len(path) + 100;
408417
p = tds_new(tds_dir_char, len);
409418
assert(p);
410-
tds_dir_snprintf(p, len, TDS_DIR("PATH=..;%s"), path);
419+
tds_dir_snprintf(p, len, start, path);
411420
path = p;
412421
_wputenv(path);
413422
#endif

0 commit comments

Comments
 (0)