Skip to content

[Fix issue1323] FileSystem::ModulePath()の結果絶対パスになるように修正する - #1333

Open
FujiwaraNaoto wants to merge 2 commits into
Siv3D:v6_developfrom
FujiwaraNaoto:fix-issue1323/change-to-absolutepath
Open

FujiwaraNaoto wants to merge 2 commits into
Siv3D:v6_developfrom
FujiwaraNaoto:fix-issue1323/change-to-absolutepath

Conversation

@FujiwaraNaoto

@FujiwaraNaoto FujiwaraNaoto commented Feb 21, 2026 •

Copy link
Copy Markdown

概要

issue1323に対する修正

レビューをお願いします

検証

以下のようなMain.cppを用意する

# include <Siv3D.hpp> // Siv3D v0.6.16
SIV3D_SET(EngineOption::Renderer::Headless) // Force non-graphical mode
void Main()
{
	Console << U"\n----------------";
	Console << U"Hello, Siv3D!";
	Console << U"You are running a non-graphical program.";
	Console << U"You can code a graphical program in Linux/App/Main.cpp";
	Console << U"----------------\n";
+	Console << FileSystem::ModulePath();
}

本PRの変更をビルドし,Main.cppをビルド

実行結果

/Linux配下
aoto@naoto-MB-K700:~/OSS/Siv3D/fork/OpenSiv3D/Linux$ pwd
/home/naoto/OSS/Siv3D/fork/OpenSiv3D/Linux
naoto@naoto-MB-K700:~/OSS/Siv3D/fork/OpenSiv3D/Linux$ ./App/Siv3DTest 
OpenSiv3D for Linux
0: [info]    ℹ️ 2026-02-21 19:37:45
0: [info]    ℹ️ Siv3D Engine (0.6.16) Linux [Release build]
0: [info]    ℹ️ OS: Ubuntu 22.04.5 LTS (22.4.0.0)
0: [info]    ℹ️ CPU: GenuineIntel Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 6.158.13 (CPU packages: 1, Physical CPUs: 12, Logical CPUs: 12)
0: [info]    ℹ️ Memory: [Physical Available: 27.6GiB Total: 31.2GiB] [Virtual: Available: 32TiB Total: 32TiB]
0: [info]    ℹ️ Connected displays: 0
0: [info]    ⌛ Preparing for setup...
0: [info]    soundfontCacheDirectory: /home/naoto/.cache/Siv3D/0.6.16/soundfont/
0: [info]    ℹ️ Engine font `GMGSx.sf2` found in the user cache directory
1: [info]    libmpg123 is available
4: [info]    🎧 Audio backend: MiniAudio (channel count: 2, sample rate: 44100, buffer size: 441)
6: [info]    ℹ️ SoundTouch is available
6: [info]    Default Screenshot directory: "/home/naoto/OSS/Siv3D/fork/OpenSiv3D/Linux/Screenshot/"
6: [info]    fontCacheDirectory: /home/naoto/.cache/Siv3D/0.6.16/font/
6: [info]    ℹ️ Engine font `noto-cjk/NotoSansCJK-Regular.ttc` found in the user cache directory
6: [info]    ℹ️ Engine font `noto-emoji/NotoEmoji-Regular.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `noto-emoji/NotoColorEmoji.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-thin.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-light.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-regular.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-medium.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-bold.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-heavy.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-black.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `fontawesome/fontawesome-solid.otf` found in the user cache directory
6: [info]    ℹ️ Engine font `fontawesome/fontawesome-brands.otf` found in the user cache directory
6: [info]    ℹ️ Engine font `materialdesignicons/materialdesignicons-webfont.ttf` found in the user cache directory

----------------
Hello, Siv3D!
You are running a non-graphical program.
You can code a graphical program in Linux/App/Main.cpp
----------------

/home/naoto/OSS/Siv3D/fork/OpenSiv3D/Linux/App/Siv3DTest
2009: [info]    ✅ Siv3D engine has terminated
2009: [info]    ℹ️ 2026-02-21 19:37:47
/Linux/App配下
naoto@naoto-MB-K700:~/OSS/Siv3D/fork/OpenSiv3D/Linux/App$ ./Siv3DTest 
OpenSiv3D for Linux
0: [info]    ℹ️ 2026-02-21 19:39:03
0: [info]    ℹ️ Siv3D Engine (0.6.16) Linux [Release build]
0: [info]    ℹ️ OS: Ubuntu 22.04.5 LTS (22.4.0.0)
0: [info]    ℹ️ CPU: GenuineIntel Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 6.158.13 (CPU packages: 1, Physical CPUs: 12, Logical CPUs: 12)
0: [info]    ℹ️ Memory: [Physical Available: 27.6GiB Total: 31.2GiB] [Virtual: Available: 32TiB Total: 32TiB]
0: [info]    ℹ️ Connected displays: 0
0: [info]    ⌛ Preparing for setup...
0: [info]    soundfontCacheDirectory: /home/naoto/.cache/Siv3D/0.6.16/soundfont/
0: [info]    ℹ️ Engine font `GMGSx.sf2` found in the user cache directory
0: [info]    libmpg123 is available
4: [info]    🎧 Audio backend: MiniAudio (channel count: 2, sample rate: 44100, buffer size: 441)
6: [info]    ℹ️ SoundTouch is available
6: [info]    Default Screenshot directory: "/home/naoto/OSS/Siv3D/fork/OpenSiv3D/Linux/App/Screenshot/"
6: [info]    fontCacheDirectory: /home/naoto/.cache/Siv3D/0.6.16/font/
6: [info]    ℹ️ Engine font `noto-cjk/NotoSansCJK-Regular.ttc` found in the user cache directory
6: [info]    ℹ️ Engine font `noto-emoji/NotoEmoji-Regular.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `noto-emoji/NotoColorEmoji.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-thin.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-light.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-regular.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-medium.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-bold.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-heavy.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-black.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `fontawesome/fontawesome-solid.otf` found in the user cache directory
6: [info]    ℹ️ Engine font `fontawesome/fontawesome-brands.otf` found in the user cache directory
6: [info]    ℹ️ Engine font `materialdesignicons/materialdesignicons-webfont.ttf` found in the user cache directory

----------------
Hello, Siv3D!
You are running a non-graphical program.
You can code a graphical program in Linux/App/Main.cpp
----------------

/home/naoto/OSS/Siv3D/fork/OpenSiv3D/Linux/App/Siv3DTest
2010: [info]    ✅ Siv3D engine has terminated
2010: [info]    ℹ️ 2026-02-21 19:39:05
絶対パスで実行
naoto@naoto-MB-K700:~/OSS/Siv3D/fork/OpenSiv3D/Linux/App$ ls
CMakeCache.txt  CMakeLists.txt     CPackSourceConfig.cmake  Siv3DTest  build.ninja          example
CMakeFiles      CPackConfig.cmake  Main.cpp                 build      cmake_install.cmake  resources
naoto@naoto-MB-K700:~$ /home/naoto/OSS/Siv3D/fork/OpenSiv3D/Linux/App/Siv3DTest
OpenSiv3D for Linux
0: [info]    ℹ️ 2026-02-21 19:44:09
0: [info]    ℹ️ Siv3D Engine (0.6.16) Linux [Release build]
0: [info]    ℹ️ OS: Ubuntu 22.04.5 LTS (22.4.0.0)
0: [info]    ℹ️ CPU: GenuineIntel Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 6.158.13 (CPU packages: 1, Physical CPUs: 12, Logical CPUs: 12)
0: [info]    ℹ️ Memory: [Physical Available: 27.6GiB Total: 31.2GiB] [Virtual: Available: 32TiB Total: 32TiB]
0: [info]    ℹ️ Connected displays: 0
0: [info]    ⌛ Preparing for setup...
0: [info]    soundfontCacheDirectory: /home/naoto/.cache/Siv3D/0.6.16/soundfont/
0: [info]    ℹ️ Engine font `GMGSx.sf2` found in the user cache directory
1: [info]    libmpg123 is available
4: [info]    🎧 Audio backend: MiniAudio (channel count: 2, sample rate: 44100, buffer size: 441)
6: [info]    ℹ️ SoundTouch is available
6: [info]    Default Screenshot directory: "/home/naoto/Screenshot/"
6: [info]    fontCacheDirectory: /home/naoto/.cache/Siv3D/0.6.16/font/
6: [info]    ℹ️ Engine font `noto-cjk/NotoSansCJK-Regular.ttc` found in the user cache directory
6: [info]    ℹ️ Engine font `noto-emoji/NotoEmoji-Regular.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `noto-emoji/NotoColorEmoji.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-thin.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-light.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-regular.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-medium.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-bold.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-heavy.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `mplus/mplus-1p-black.ttf` found in the user cache directory
6: [info]    ℹ️ Engine font `fontawesome/fontawesome-solid.otf` found in the user cache directory
6: [info]    ℹ️ Engine font `fontawesome/fontawesome-brands.otf` found in the user cache directory
6: [info]    ℹ️ Engine font `materialdesignicons/materialdesignicons-webfont.ttf` found in the user cache directory

----------------
Hello, Siv3D!
You are running a non-graphical program.
You can code a graphical program in Linux/App/Main.cpp
----------------

/home/naoto/OSS/Siv3D/fork/OpenSiv3D/Linux/App/Siv3DTest
2010: [info]    ✅ Siv3D engine has terminated
2010: [info]    ℹ️ 2026-02-21 19:44:11

@FujiwaraNaoto
FujiwaraNaoto changed the base branch from main to v6_develop February 21, 2026 10:46
@FujiwaraNaoto FujiwaraNaoto changed the title Fix issue1323/change to absolutepath [Fix issue1323] FileSystem::ModulePath()の結果絶対パスになるように修正する Feb 21, 2026
@Reputeless

Copy link
Copy Markdown
Member

PR ありがとうございます。確認します。

@FujiwaraNaoto

Copy link
Copy Markdown
Author

こちらレビューいかがでしょうか?

@Reputeless Reputeless moved this to Investigating in v0.6 Roadmap Mar 26, 2026
@Reputeless

Copy link
Copy Markdown
Member

v0.6.17 のマイルストーンに載せました。進行までしばらくお待ちください。

@Raclamusi

Copy link
Copy Markdown
Member

以下の箇所で FullPath() を使うと、もっとシンプルに修正できるはずです。

void InitModulePath(const char* arg)
{
g_modulePath = Unicode::Widen(arg);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Investigating

Development

Successfully merging this pull request may close these issues.

3 participants