Skip to content

Commit

Permalink
Switched to 64-bit builds by default. Fixed temp paths problem in tes…
Browse files Browse the repository at this point in the history
…t.pl.
  • Loading branch information
anderskaplan committed Mar 27, 2017
1 parent 5aab59f commit 0c52ae6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
14 changes: 8 additions & 6 deletions msvc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,25 @@ The MSVC adaptation is intended to be as non-intrusive and lightweight as
possible, meaning for example:
- #ifdefs and other modifications of the htslib sources are avoided as far as
possible.
- Although it could have been nice to use cmake for the build, that option was
not selected, because it would require another tool to be installed.
- Visual Studio solution files and NMake makefiles are preferred over, for
example, CMake build scripts.

Prerequisites
-------------
This guide assumes that you have installed the following:
- Microsoft Visual Studio 2015
- Git for Windows (earlier msysGit): this is a convenient way to get access to
perl, bash, and other tools required by the test suite.
- Git for Windows (earlier msysGit): not strictly necessary, but a convenient
way to get access to perl, bash, diff, and other unix tools required to run
the test suite.

How to build htslib
-------------------
1. Install zlib and pthreads-w32 as described below.
2. Open a command prompt, change to the msvc directory, and run the command
"perl version.pl".
3. Open the libhts.sln solution file with Visual Studio and select Build/Build
Solution.
3. Open the libhts.sln solution file with Visual Studio, select the x64 platform
and the Debug configuration, then Build/Build Solution.
4. Switch to the Release configuration and build again.

Installing zlib
---------------
Expand Down
4 changes: 2 additions & 2 deletions msvc/testapps.mak
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# nmake makefile for test apps
# usage: nmake /f testapps.mak [Platform=x64] [Configuration=Release] test
# usage: nmake /f testapps.mak [Platform=Win32] [Configuration=Release] test

!IF "$(Configuration)" == ""
Configuration = Debug
!ENDIF

!IF "$(Platform)" == ""
Platform = Win32
Platform = x64
!ENDIF

!IF "$(Platform)" == "Win32"
Expand Down
12 changes: 11 additions & 1 deletion test/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ sub error
"\n";
exit 1;
}
sub safe_tempdir
{
my $dir = tempdir(CLEANUP=>1);
if ($^O eq 'msys')
{
$dir = `cygpath -m $dir`;
$dir =~ s/\015?\012//;
}
return $dir;
}
sub parse_params
{
my $opts = { keep_files=>0, nok=>0, nfailed=>0 };
Expand All @@ -80,7 +90,7 @@ sub parse_params
'h|?|help' => \$help
);
if ( !$ret or $help ) { error(); }
$$opts{tmp} = $$opts{keep_files} ? $$opts{keep_files} : tempdir(CLEANUP=>1);
$$opts{tmp} = $$opts{keep_files} ? $$opts{keep_files} : safe_tempdir();
if ( $$opts{keep_files} ) { cmd("mkdir -p $$opts{keep_files}"); }
$$opts{path} = $FindBin::RealBin;
$$opts{bin} = $FindBin::RealBin;
Expand Down

0 comments on commit 0c52ae6

Please sign in to comment.