Skip to content

Commit d352a62

Browse files
committed
Use std::filesystem::path::preferred_separator. NFC
The emsdk TODO is no longer necessary after emscripten-core/emsdk#1637
1 parent aa77b42 commit d352a62

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
# https://launchpad.net/ubuntu/focal/+source/cmake
33
cmake_minimum_required(VERSION 3.16.3)
44

5-
# Needed for C++17 (std::variant)
6-
# TODO(https://github.com/WebAssembly/binaryen/issues/4299): We need
7-
# to reduce this for compatability with emsdk.
8-
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version")
5+
# Needed for C++17 (std::path)
6+
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
97

108
project(binaryen LANGUAGES C CXX VERSION 125)
119
include(GNUInstallDirs)

src/support/path.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// Command line helpers.
1919
//
2020

21+
#include <filesystem>
22+
2123
#include "support/path.h"
2224
#ifdef USE_WSTRING_PATHS
2325
#include "windows.h"
@@ -52,15 +54,7 @@ std::string wstring_to_string(const std::wstring& s) {
5254
PathString to_path(const std::string& s) { return s; }
5355
#endif
5456

55-
char getPathSeparator() {
56-
// TODO: use c++17's path separator
57-
// http://en.cppreference.com/w/cpp/experimental/fs/path
58-
#if defined(WIN32) || defined(_WIN32)
59-
return '\\';
60-
#else
61-
return '/';
62-
#endif
63-
}
57+
char getPathSeparator() { return std::filesystem::path::preferred_separator; }
6458

6559
static std::string getAllPathSeparators() {
6660
// The canonical separator on Windows is `\`, but it also accepts `/`.

0 commit comments

Comments
 (0)