Skip to content

Commit 8c255c8

Browse files
committed
Fixed boost 1.88 issues
1 parent ff934b6 commit 8c255c8

File tree

6 files changed

+17
-19
lines changed

6 files changed

+17
-19
lines changed

a2lexplorer/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ else()
6161

6262
target_link_libraries(a2lexplorer PRIVATE EXPAT::EXPAT)
6363
target_link_libraries(a2lexplorer PRIVATE ${wxWidgets_LIBRARIES})
64-
target_link_libraries(a2lexplorer PRIVATE ${wxWidgets_LIB_DIR}/wxscintillad.lib)
65-
target_link_libraries(a2lexplorer PRIVATE ${wxWidgets_LIB_DIR}/wxlexillad.lib)
6664
target_link_libraries(a2lexplorer PRIVATE ${Boost_LIBRARIES})
6765
endif()
6866

a2lexplorer/src/a2ldocument.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,13 @@
33
* SPDX-License-Identifier: MIT
44
*/
55
#include <sstream>
6-
76
#include <filesystem>
8-
#include <boost/process.hpp>
9-
#if (_MSC_VER)
10-
#include <boost/process/windows.hpp>
11-
#endif
12-
#include <boost/filesystem.hpp>
137

148
#include <wx/msgdlg.h>
159

1610
#include <util/logstream.h>
11+
1712
#include "a2ldocument.h"
18-
#include "windowid.h"
1913
#include "a2lexplorer.h"
2014

2115
using namespace util::log;

a2lexplorer/src/a2lexplorer.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <filesystem>
66
#include <codecvt>
77
#define BOOST_LOCALE_HIDE_AUTO_PTR
8+
9+
#include <boost/asio.hpp>
810
#include <boost/process.hpp>
911
#include <boost/filesystem.hpp>
1012
#include <boost/locale.hpp>
@@ -28,6 +30,10 @@ using namespace a2l;
2830

2931
wxIMPLEMENT_APP(a2lgui::A2lExplorer);
3032

33+
namespace {
34+
boost::asio::io_context kIoContext;
35+
}
36+
3137
namespace a2lgui {
3238

3339
wxBEGIN_EVENT_TABLE(A2lExplorer, wxApp)
@@ -119,12 +125,10 @@ void A2lExplorer::OnUpdateOpenLogFile(wxUpdateUIEvent &event) {
119125
}
120126

121127

122-
// utf8
123128
void A2lExplorer::OpenFile(const std::string& filename) const {
124129
if (!notepad_.empty()) {
125-
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
126-
const auto utf16 = convert.from_bytes(filename);
127-
boost::process::spawn(notepad_, std::wstring(utf16.begin(), utf16.end()));
130+
boost::process::process proc(kIoContext, notepad_, {filename} );
131+
proc.detach();
128132
}
129133
}
130134

script/boost.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ if (NOT Boost_FOUND)
77
set(Boost_ARCHITECTURE -x64)
88
set(Boost_NO_WARN_NEW_VERSIONS ON)
99
set(Boost_DEBUG OFF)
10-
11-
find_package(Boost COMPONENTS locale filesystem system)
10+
if(POLICY CMP0167)
11+
cmake_policy(SET CMP0167 OLD)
12+
endif()
13+
find_package(Boost COMPONENTS locale filesystem system process)
1214
message(STATUS "Boost Found (Try 1): " ${Boost_FOUND})
1315
message(STATUS "Boost Version: " ${Boost_VERSION_STRING})
1416
message(STATUS "Boost Include Dirs: " ${Boost_INCLUDE_DIRS})
@@ -17,7 +19,7 @@ if (NOT Boost_FOUND)
1719
message(STATUS "Boost Root: " ${Boost_ROOT})
1820
if (NOT Boost_FOUND)
1921
set(Boost_ROOT ${COMP_DIR}/boost/latest)
20-
find_package(Boost REQUIRED COMPONENTS locale filesystem system)
22+
find_package(Boost REQUIRED COMPONENTS locale filesystem system process)
2123

2224
message(STATUS "Boost Found (Try 2): " ${Boost_FOUND})
2325
message(STATUS "Boost Version: " ${Boost_VERSION_STRING})

script/wxwidgets.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: MIT
33

44
if (NOT wxWidgets_FOUND )
5-
find_package(wxWidgets COMPONENTS stc richtext html xml propgrid adv core base)
5+
find_package(wxWidgets COMPONENTS propgrid adv core base)
66
endif()
77

88
if (wxWidgets_FOUND)
@@ -29,7 +29,7 @@ if (NOT wxWidgets_FOUND)
2929
endif()
3030
set(wxWidgets_USE_UNIVERSAL OFF)
3131
endif()
32-
find_package(wxWidgets COMPONENTS stc richtext html xml propgrid adv core base )
32+
find_package(wxWidgets COMPONENTS propgrid adv core base )
3333
include(${wxWidgets_USE_FILE})
3434

3535
endif()

vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"dependencies": [
55
"boost-locale",
66
"boost-endian",
7+
"boost-asio",
78
"boost-process",
89
"boost-filesystem"
910
],
1011
"features": {
1112
"tools": {
1213
"description": "Build GUI and daemons",
1314
"dependencies": [
14-
"boost-asio",
1515
"wxwidgets"
1616
]
1717
}

0 commit comments

Comments
 (0)