Skip to content

Commit

Permalink
v2: Support Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Apr 20, 2024
1 parent 442f07c commit 34944b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions v2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ add_executable(nj
)
target_link_libraries(nj PRIVATE libninja libninja-re2c Boost::headers Threads::Threads)
target_compile_features(nj PUBLIC cxx_std_23)
if(WIN32)
target_compile_definitions(nj PRIVATE _WIN32_WINNT=0x0601 BOOST_ALL_NO_LIB)
endif()
5 changes: 5 additions & 0 deletions v2/status_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
#include "../src/graph.h"
#include "../src/metrics.h"

#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#endif

extern boost::asio::io_context gContext;

Status* Status::factory(const BuildConfig& config) {
Expand Down

0 comments on commit 34944b4

Please sign in to comment.