-
Notifications
You must be signed in to change notification settings - Fork 3
Feat: support msys2 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大体C++標準ではstd::ofstream
のctorにwchar_t系の文字列渡せないのが問題。
std::wcerr << "error: " << path << " doesn't exist." << std::endl; | ||
return 1; | ||
} | ||
std::ifstream target(path, std::ios::binary); | ||
std::ifstream target(path.string(), std::ios::binary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文字コード変換をサボって雑にやっている。日本語パスが来た時にどうなるのか怖い
@@ -143,7 +144,7 @@ BOOL WINAPI set_file_information_by_handle( | |||
) { | |||
if (information_class == FileRenameInfo) { | |||
auto& info = *static_cast<PFILE_RENAME_INFO>(file_information); | |||
std::ofstream(info.FileName, std::ios::ate | std::ios::binary); | |||
std::ofstream(fs::path(info.FileName).string(), std::ios::ate | std::ios::binary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文字コード変換をサボって雑にやっている。日本語パスが来た時にどうなるのか怖い
http://en.cppreference.com/w/cpp/io/basic_fstream/basic_fstream |
正直な話Win32APIないしboostで書き換えたい。filesystem使うには時期尚早。そもそもmingwの |
規模これ以上は大きくならないだろうと思われるためboostには依存したくない。 |
cmake_minimum_required(VERSION 3.10.0) | ||
enable_language(CXX) | ||
set(CMAKE_CXX_STANDARD 17) # C++17... | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この方法に変えてしまうと非mingw環境で動かないので戻してください
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
どう動かないのでしょう?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMakeの-Gオプションで"Visual Studio 15 2017" を指定した場合に set(CMAKE_CXX_STANDARD 17)
だと-std=c++17もしくは/std:c++17オプションが付かない。原因を詳しく調査はしていないが、CMAKE_CXX_FLAGSを使っているのはそのため。回避策が分かるなら変更してもいい
msys2のgcc(clangはだめ)でもビルドできたらいいなと思い対応してみた。