Skip to content

Commit

Permalink
DOn't link stdc++fs on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
mariano54 committed Feb 3, 2020
1 parent 6d8205d commit 9535bb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ add_executable(RunTests
tests/test-main.cpp
tests/test.cpp
)
target_link_libraries(chiapos PRIVATE fse)
target_link_libraries(ProofOfSpace fse)
target_link_libraries(HellmanAttacks fse)
target_link_libraries(RunTests fse)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(chiapos PRIVATE fse)
target_link_libraries(ProofOfSpace fse)
target_link_libraries(HellmanAttacks fse)
target_link_libraries(RunTests fse)
else()
target_link_libraries(chiapos PRIVATE fse stdc++fs)
target_link_libraries(ProofOfSpace fse stdc++fs)
target_link_libraries(HellmanAttacks fse stdc++fs)
target_link_libraries(RunTests fse stdc++fs)
endif()
4 changes: 2 additions & 2 deletions src/plotter_disk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ class DiskPlotter {
filesystem::path final_filename = filesystem::path(final_dirname) / filesystem::path(filename);

// Check if the paths exist
if (!filesystem::directory_entry(tmp_dirname).exists()) {
if (!filesystem::exists(tmp_dirname)) {
std::string err_string = "Directory " + tmp_dirname + " does not exist";
std::cerr << err_string << std::endl;
throw err_string;
}

if (!filesystem::directory_entry(final_dirname).exists()) {
if (!filesystem::exists(final_dirname)) {
std::string err_string = "Directory " + final_dirname + " does not exist";
std::cerr << err_string << std::endl;
throw err_string;
Expand Down

0 comments on commit 9535bb4

Please sign in to comment.