Skip to content

Commit 30d8351

Browse files
authored
Merge pull request #3088 from xoviat/msvc
add misc fixes.
2 parents 8f6a744 + 609ea80 commit 30d8351

File tree

7 files changed

+193
-149
lines changed

7 files changed

+193
-149
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ build.*
8989
*.swp
9090
benchmark/*.goto
9191
benchmark/smallscaling
92+
.vscode
9293
CMakeCache.txt
9394
CMakeFiles/*
9495
.vscode

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ include(GNUInstallDirs)
1414

1515
include(CMakePackageConfigHelpers)
1616

17+
if(MSVC AND NOT DEFINED NOFORTRAN)
18+
set(NOFORTRAN ON)
19+
endif()
1720

1821
#######
1922
if(MSVC)
@@ -229,7 +232,7 @@ if (NOT NO_CBLAS)
229232
add_subdirectory(utest)
230233
endif()
231234

232-
if (NOT MSVC AND NOT NOFORTRAN)
235+
if (NOT NOFORTRAN)
233236
# Build test and ctest
234237
add_subdirectory(test)
235238
if(NOT NO_CBLAS)

appveyor.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,5 @@ build_script:
7373
- cmake --build .
7474

7575
test_script:
76-
- echo Running Test
77-
- cd utest
78-
- openblas_utest
76+
- ctest -j2
7977

ctest/CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@ enable_language(Fortran)
55

66
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DADD${BU} -DCBLAS")
77

8+
if(WIN32)
9+
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.ps1
10+
"$ErrorActionPreference = \"Stop\"\n"
11+
"Get-Content $args[1] | & $args[0]\n"
12+
)
13+
set(test_helper powershell -ExecutionPolicy Bypass "${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.ps1")
14+
else()
815
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.sh
916
"$1 < $2\n"
1017
)
18+
set(test_helper sh "${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.sh")
19+
endif()
1120

1221
foreach(float_type ${FLOAT_TYPES})
1322
string(SUBSTRING ${float_type} 0 1 float_char_upper)
@@ -21,7 +30,7 @@ foreach(float_type ${FLOAT_TYPES})
2130
c_${float_char}blas1.c)
2231
target_link_libraries(x${float_char}cblat1 ${OpenBLAS_LIBNAME})
2332
add_test(NAME "x${float_char}cblat1"
24-
COMMAND "${CMAKE_CURRENT_BINARY_DIR}/x${float_char}cblat1")
33+
COMMAND $<TARGET_FILE:x${float_char}cblat1>)
2534

2635
#level2
2736
add_executable(x${float_char}cblat2
@@ -33,7 +42,7 @@ foreach(float_type ${FLOAT_TYPES})
3342
constant.c)
3443
target_link_libraries(x${float_char}cblat2 ${OpenBLAS_LIBNAME})
3544
add_test(NAME "x${float_char}cblat2"
36-
COMMAND sh "${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.sh" "${CMAKE_CURRENT_BINARY_DIR}/x${float_char}cblat2" "${PROJECT_SOURCE_DIR}/ctest/${float_char}in2")
45+
COMMAND ${test_helper} $<TARGET_FILE:x${float_char}cblat2> "${PROJECT_SOURCE_DIR}/ctest/${float_char}in2")
3746

3847
#level3
3948
add_executable(x${float_char}cblat3
@@ -45,6 +54,6 @@ foreach(float_type ${FLOAT_TYPES})
4554
constant.c)
4655
target_link_libraries(x${float_char}cblat3 ${OpenBLAS_LIBNAME})
4756
add_test(NAME "x${float_char}cblat3"
48-
COMMAND sh "${CMAKE_CURRENT_BINARY_DIR}/test_cblas_helper.sh" "${CMAKE_CURRENT_BINARY_DIR}/x${float_char}cblat3" "${PROJECT_SOURCE_DIR}/ctest/${float_char}in3")
57+
COMMAND ${test_helper} $<TARGET_FILE:x${float_char}cblat3> "${PROJECT_SOURCE_DIR}/ctest/${float_char}in3")
4958

5059
endforeach()

lapack-netlib/TESTING/CMakeLists.txt

Lines changed: 106 additions & 92 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)