Skip to content
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

Fix PDAL support on MinGW-w64 #57373

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mingw-w64-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
-DPython_EXECUTABLE=${MINGW_PREFIX}/bin/python \
-DWITH_3D=ON \
-DWITH_DRACO=ON \
-DWITH_PDAL=OFF \
-DWITH_PDAL=ON \
-DWITH_CUSTOM_WIDGETS=ON \
-DWITH_BINDINGS=OFF \
-DWITH_GRASS=OFF \
Expand Down
4 changes: 4 additions & 0 deletions external/pdal_wrench/tile/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ std::vector<std::string> directoryList(const std::string& dir)
fs::directory_iterator end;
while (it != end)
{
#ifndef __MINGW32__
files.push_back(untwine::fromNative(it->path()));
#else
files.push_back(untwine::fromNative(it->path().string()));
#endif
it++;
}
}
Expand Down
8 changes: 8 additions & 0 deletions external/untwine/untwine/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ MapContext mapFile(const std::string& filename, bool readOnly, size_t pos, size_
#ifndef _WIN32
ctx.m_fd = ::open(filename.data(), readOnly ? O_RDONLY : O_RDWR);
#else
#ifdef _MSC_VER
ctx.m_fd = ::_wopen(toNative(filename).data(), readOnly ? _O_RDONLY : _O_RDWR);
#else
ctx.m_fd = ::_open(toNative(filename).data(), readOnly ? _O_RDONLY : _O_RDWR);
#endif
#endif

if (ctx.m_fd == -1)
Expand Down Expand Up @@ -129,7 +133,11 @@ std::vector<std::string> directoryList(const std::string& dir)
fs::directory_iterator end;
while (it != end)
{
#ifndef __MINGW32__
files.push_back(untwine::fromNative(it->path()));
#else
files.push_back(untwine::fromNative(it->path().string()));
#endif
it++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion external/untwine/untwine/Untwine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void cleanup(const std::string& dir, bool rmdir)

} // namespace untwine

#ifdef _WIN32
#ifdef _MSC_VER
int wmain( int argc, wchar_t *argv[ ], wchar_t *envp[ ] )
#else
int main(int argc, char *argv[])
Expand Down
Loading