Skip to content

Commit c020d7a

Browse files
authored
fix: LinuxではシステムのVulkanローダをリンクするように修正
1 parent a7e6014 commit c020d7a

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

.github/workflows/build-ubuntu.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ jobs:
112112
runs-on: ubuntu-latest
113113
needs: build
114114
steps:
115+
- name: Install dependencies
116+
run: |
117+
sudo apt-get update
118+
sudo apt-get remove --purge man-db
119+
sudo apt-get install -y --no-install-recommends libvulkan1
120+
115121
- name: Download orge artifacts
116122
uses: actions/download-artifact@v4
117123
with:
@@ -123,7 +129,7 @@ jobs:
123129
export PKG_CONFIG_PATH=$(pwd)/orge/installed-static/lib/pkgconfig
124130
mkdir ./static
125131
cd ./static
126-
g++ ../orge/examples/simple/main.cpp $(pkg-config orge --cflags --libs --static)
132+
g++ ../orge/examples/simple/main.cpp $(pkg-config orge --cflags --libs --static) /lib/x86_64-linux-gnu/libvulkan.so.1
127133
128134
- name: Test build with shared
129135
run: |

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Orgeではorgeで扱うすべてのメッシュデータをアセットとして
3535
> 1.0.0現在、orgeは非同期的なAPI呼出しに対応していない。
3636
> そのため、orgeのAPI呼出しは必ず同一のスレッドから行うこと。
3737
38+
> [!WARNING]
39+
> Linuxでorge (静的ライブラリ)をリンクする場合、システムにインストールされたVulkanローダもリンクすること。
40+
3841
## License
3942

4043
Orge自体はCC0 1.0 Universalの下に公開されている。

meson.build

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ else
246246
meson.current_source_dir() / 'scripts' / 'install_linux.py',
247247
vcpkg_libdir,
248248
get_option('prefix') / get_option('libdir'),
249-
get_option('default_library'),
250-
vulkan_dep.version()
249+
get_option('default_library')
251250
)
252251
endif
253252

@@ -277,7 +276,6 @@ elif host_system == 'darwin'
277276
endforeach
278277
cflags += ['-lpthread', '-lm']
279278
else
280-
libraries += ['-lvulkan']
281279
libraries_private += ['-lSDL3']
282280
endif
283281

scripts/install_linux.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@ def install(src, dst):
1414
srcdir = sys.argv[1]
1515
dstdir = sys.argv[2]
1616
default_library = sys.argv[3]
17-
vulkan_version = sys.argv[4]
18-
19-
vulkan_lib = 'libvulkan.so.' + vulkan_version
20-
21-
install(srcdir + '/' + vulkan_lib, dstdir + '/libvulkan.so')
2217

2318
if default_library == 'static':
2419
install(srcdir + '/libSDL3.a', dstdir)
2520
install(srcdir + '/libyaml-cpp.a', dstdir)
26-
27-
print('Change libvulkan.so ID to libvulkan.so')
28-
subprocess.run(['patchelf', '--set-soname', 'libvulkan.so', dstdir + '/libvulkan.so'])
29-
30-
if default_library == 'shared':
31-
print('Change liborge.so dependence from ' + vulkan_lib + ' to libvulkan.so')
32-
subprocess.run(['patchelf', '--replace-needed', vulkan_lib, 'libvulkan.so', dstdir + '/liborge.so'])

0 commit comments

Comments
 (0)