Skip to content

Commit 1cca7d0

Browse files
committed
win fix
1 parent ae37244 commit 1cca7d0

File tree

2 files changed

+9
-26
lines changed

2 files changed

+9
-26
lines changed

.github/workflows/python.yml

+4-25
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@ name: GitHub actions
22

33
on:
44
push:
5-
branches: [ "**" ]
5+
branches: ["**"]
66
pull_request:
7-
branches: [ "**" ]
7+
branches: ["**"]
88
repository_dispatch:
9-
types: [ "**" ]
9+
types: ["**"]
1010

1111
permissions:
1212
contents: read
1313

1414
env:
1515
BUILD_TYPE: Debug
16-
LD_LIBRARY_PATH: /usr/local/lib
17-
WIN_LIBOQS_INSTALL_PATH: C:\liboqs
1816

1917
jobs:
2018
build:
2119
strategy:
2220
matrix:
23-
os: [ ubuntu-latest, macos-latest, windows-latest ]
21+
os: [ubuntu-latest, macos-latest, windows-latest]
2422
runs-on: ${{ matrix.os }}
2523

2624
steps:
@@ -36,14 +34,6 @@ jobs:
3634
python -m pip install --upgrade pip
3735
pip install nose2
3836
39-
- name: Install liboqs POSIX
40-
if: matrix.os != 'windows-latest'
41-
run: |
42-
git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs
43-
cmake -S liboqs -B liboqs/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON
44-
cmake --build liboqs/build --parallel 4
45-
sudo cmake --build liboqs/build --target install
46-
4737
- name: Run examples POSIX
4838
if: matrix.os != 'windows-latest'
4939
run: |
@@ -59,20 +49,10 @@ jobs:
5949
run: |
6050
nose2 --verbose
6151
62-
- name: Install liboqs Windows
63-
if: matrix.os == 'windows-latest'
64-
shell: cmd
65-
run: |
66-
git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs
67-
cmake -S liboqs -B liboqs\build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.WIN_LIBOQS_INSTALL_PATH}} -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON
68-
cmake --build liboqs\build --parallel 4
69-
cmake --build liboqs\build --target install
70-
7152
- name: Run examples Windows
7253
if: matrix.os == 'windows-latest'
7354
shell: cmd
7455
run: |
75-
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
7656
pip install .
7757
python examples/kem.py
7858
echo.
@@ -84,5 +64,4 @@ jobs:
8464
shell: cmd
8565
if: matrix.os == 'windows-latest'
8666
run: |
87-
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
8867
nose2 --verbose

oqs/oqs.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ def _install_liboqs(directory, oqs_version):
9494

9595
home_dir = os.path.expanduser("~")
9696
oqs_install_dir = os.path.abspath(home_dir + os.path.sep + "oqs") # $HOME/oqs
97-
oqs_lib_dir = os.path.abspath(oqs_install_dir + os.path.sep + "lib") # $HOME/oqs/lib
97+
oqs_lib_dir = (
98+
os.path.abspath(oqs_install_dir + os.path.sep + "bin") # $HOME/oqs/bin
99+
if platform.system() == "Windows"
100+
else os.path.abspath(oqs_install_dir + os.path.sep + "lib") # $HOME/oqs/lib
101+
)
98102
try:
99103
_liboqs = _load_shared_obj(name="oqs", additional_searching_paths=[oqs_lib_dir])
100104
assert _liboqs

0 commit comments

Comments
 (0)