-
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
Open
yumetodo
wants to merge
12
commits into
kazatsuyu:master
Choose a base branch
from
yumetodo:feat/support_msys2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f46b2c9
fix: set _WIN32_WINNT macro to VISTA version to enable some WINAPI
yumetodo 78af762
fix: configure filesystem include for msys2 gcc
yumetodo 07b7da2
fix(CMake): use CMAKE_CXX_STANDARD to force c++17
yumetodo 77e6c8a
fix(CMake): link libstdc++fs
yumetodo c3e3aa7
fix(test): improve iutest path finding
yumetodo bfa652e
fix: fix compile error in msys2 gcc
yumetodo 5efdccf
chore: update gitignroe for vscode
yumetodo ddceab0
fix: update iutest
yumetodo 098ad30
chore: update .gitignore for develop
yumetodo b13f170
fix(CMake): rename libfafnir_injection.dll to fafnir_injection.dll
yumetodo 8d9d0a7
fix: copy mingw dependent dlls
yumetodo 417c165
chore(PS): remove trailing spaces
yumetodo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# - Try to find iutest include dirs | ||
# | ||
# Usage of this module as follows: | ||
# | ||
# find_package(IUTEST) | ||
# | ||
# Variables used by this module, they can change the default behaviour and need | ||
# to be set before calling find_package: | ||
# | ||
# IUTEST_ROOT_DIR Set this variable to the root installation of | ||
# iutest if the module has problems finding the | ||
# proper installation path. | ||
# | ||
# Variables defined by this module: | ||
# | ||
# IUTEST_FOUND System has iutest, include dirs found | ||
# IUTEST_INCLUDE_DIR The iutest include directories. | ||
|
||
find_path(IUTEST_ROOT_DIR | ||
NAMES include/iutest.hpp | ||
HINTS | ||
ENV IUTEST_ROOT | ||
) | ||
|
||
find_path(IUTEST_INCLUDE_DIR | ||
NAMES iutest.hpp | ||
HINTS | ||
${IUTEST_ROOT_DIR}/include | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(IUTEST DEFAULT_MSG | ||
IUTEST_INCLUDE_DIR | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#include "set_winver.hpp" | ||
#include <fstream> | ||
|
||
#include "fafnir.hpp" | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. 文字コード変換をサボって雑にやっている。日本語パスが来た時にどうなるのか怖い |
||
} | ||
return orig_SetFileInformationByHandle(file, information_class, file_information, size); | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef FAFNIR_FILESYSTEM_HPP | ||
#define FAFNIR_FILESYSTEM_HPP | ||
|
||
#ifdef __GNUC__ | ||
# include <experimental/filesystem> | ||
#else | ||
# include <filesytsem> | ||
#endif | ||
namespace fs = std::experimental::filesystem; | ||
#endif //FAFNIR_FILESYSTEM_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#include "set_winver.hpp" | ||
#include <string_view> | ||
#include <iostream> | ||
#include <filesystem> | ||
#include "filesystem.hpp" | ||
#include <fstream> | ||
#include <vector> | ||
#include <sstream> | ||
|
@@ -61,7 +62,7 @@ file_type get_file_type(std::istream& in) noexcept { | |
} | ||
|
||
template<auto f> | ||
std::experimental::filesystem::path read_path_impl(std::istream& in) noexcept { | ||
fs::path read_path_impl(std::istream& in) noexcept { | ||
std::ostringstream ss; | ||
|
||
for (auto ch = f(in); ch != std::char_traits<char32_t>::eof(); ch = f(in)) { | ||
|
@@ -73,7 +74,7 @@ std::experimental::filesystem::path read_path_impl(std::istream& in) noexcept { | |
reinterpret_cast<const wchar_t*>(str.data() + str.size())}; | ||
} | ||
|
||
std::experimental::filesystem::path read_path(std::istream& in) noexcept { | ||
fs::path read_path(std::istream& in) noexcept { | ||
auto type = get_file_type(in); | ||
if (type == file_type::utf8_with_bom) { | ||
in.seekg(3); | ||
|
@@ -90,14 +91,14 @@ int main() { | |
using namespace fafnir; | ||
|
||
auto path = get_bin_path() / ".target"; | ||
if (!std::experimental::filesystem::exists(path)) { | ||
if (!fs::exists(path)) { | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. 文字コード変換をサボって雑にやっている。日本語パスが来た時にどうなるのか怖い |
||
auto target_path = read_path(target); | ||
target.close(); | ||
if (!std::experimental::filesystem::exists(target_path)) { | ||
if (!fs::exists(target_path)) { | ||
std::wcerr << "error: " << target_path << " doesn't exist." << std::endl; | ||
return 1; | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef FAFNIR_SET_WINVER_HPP | ||
#define FAFNIR_SET_WINVER_HPP | ||
#ifdef _WIN32_WINNT | ||
# if _WIN32_WINNT < 0x0600 | ||
# error "target OS must be Windows Vista or higher" | ||
# endif | ||
#endif | ||
#ifdef __GNUC__ | ||
# define _WIN32_WINNT 0x0600 // Windows Vista | ||
#endif | ||
#endif //FAFNIR_SET_WINVER_HPP |
Submodule iutest
updated
19 files
+2 −1 | .gitattributes | |
+12 −0 | CHANGES | |
+1 −1 | README.md | |
+2 −0 | F438docs/.gitignore | |
+1 −1 | docs/Doxyfile | |
+1 −1 | docs/cover.html | |
+49 −6 | docs/gource/Makefile | |
+3 −2 | docs/wandbox.html | |
+3 −3 | include/gtest/switch/iutest_switch_assert.hpp | |
+3 −3 | include/gtest/switch/iutest_switch_assume.hpp | |
+3 −3 | include/gtest/switch/iutest_switch_expect.hpp | |
+3 −3 | include/gtest/switch/iutest_switch_inform.hpp | |
+41 −9 | include/iutest.hpp | |
+12 −1 | include/iutest_expression_assertion.hpp | |
+2 −2 | include/iutest_matcher.hpp | |
+7 −2 | include/iutest_ver.hpp | |
+3 −0 | test/CommonMakefile.in | |
+22 −3 | test/expression_assertion_tests.cpp | |
+1 −1 | test/unit_tests.cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check
2A52
back later.
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を使っているのはそのため。回避策が分かるなら変更してもいい