pathHelper: Only compile on win builds

This commit is contained in:
Greg Davill 2022-10-23 18:52:47 +10:30
parent 74ac8bba24
commit 53e72a944a
No known key found for this signature in database
GPG Key ID: CAFD6B08836425EC
3 changed files with 8 additions and 3 deletions

View File

@ -111,7 +111,6 @@ set(OPENFPGALOADER_SOURCE
src/jlink.cpp src/jlink.cpp
src/lattice.cpp src/lattice.cpp
src/progressBar.cpp src/progressBar.cpp
src/pathHelper.cpp
src/fsparser.cpp src/fsparser.cpp
src/mcsParser.cpp src/mcsParser.cpp
src/ftdispi.cpp src/ftdispi.cpp
@ -139,7 +138,6 @@ set(OPENFPGALOADER_HEADERS
src/ice40.hpp src/ice40.hpp
src/ihexParser.hpp src/ihexParser.hpp
src/progressBar.hpp src/progressBar.hpp
src/pathHelper.hpp
src/rawParser.hpp src/rawParser.hpp
src/usbBlaster.hpp src/usbBlaster.hpp
src/bitparser.hpp src/bitparser.hpp
@ -198,6 +196,9 @@ target_link_libraries(openFPGALoader
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# winsock provides ntohs # winsock provides ntohs
target_link_libraries(openFPGALoader ws2_32) target_link_libraries(openFPGALoader ws2_32)
target_sources(openFPGALoader PRIVATE src/pathHelper.cpp)
list(APPEND OPENFPGALOADER_HEADERS src/pathHelper.hpp)
endif() endif()
# libusb_attach_kernel_driver is only available on Linux. # libusb_attach_kernel_driver is only available on Linux.

View File

@ -13,8 +13,10 @@
#include "device.hpp" #include "device.hpp"
#include "epcq.hpp" #include "epcq.hpp"
#include "progressBar.hpp" #include "progressBar.hpp"
#include "pathHelper.hpp"
#include "rawParser.hpp" #include "rawParser.hpp"
#if defined (_WIN64) || defined (_WIN32)
#include "pathHelper.hpp"
#endif
#define IDCODE 6 #define IDCODE 6
#define USER0 0x0C #define USER0 0x0C

View File

@ -24,7 +24,9 @@
#include "xilinxMapParser.hpp" #include "xilinxMapParser.hpp"
#include "part.hpp" #include "part.hpp"
#include "progressBar.hpp" #include "progressBar.hpp"
#if defined (_WIN64) || defined (_WIN32)
#include "pathHelper.hpp" #include "pathHelper.hpp"
#endif
Xilinx::Xilinx(Jtag *jtag, const std::string &filename, Xilinx::Xilinx(Jtag *jtag, const std::string &filename,
const std::string &file_type, const std::string &file_type,