Comments (16)
Seems these targets need some more work.
from plug.
Thanks!
Adding target_link_libraries
worked with the right target specified. (237-libusb...j824h:plug:patch-1)
from plug.
CMake seems to find libusb correctly, so I wonder why the include is missing. Can you check whether the CMake variable libusb-1.0_INCLUDE_DIR
points to a valid path containing libusb-1.0/libusb.h
?
I'm also getting a ton of errors about old-style-casting and unsigned-conversions, which I've ignored using make -i
Do these warning come from a library header or plug? Clang should handle system includes correctly, but I have not experience on Mac OS.
from plug.
I had to add
include_directories(/usr/local/include)
in src/com/CMakeLists.txt
, so that CMake can find libusb-1.0 installed by Homebrew.
Also for the root CMakeLists.txt
, I found disabling -pedantic
, -pedantic-errors
, -Wold-style-cast
helps.
from plug.
What does your libusb-1.0_INCLUDE_DIR
show?
Regarding warnings: Did compilation fail otherwise? What errors are shown? CI builds include Clang too, but only on Linux.
from plug.
Include errors
-- Found libusb-1.0: /usr/local/Cellar/libusb/1.0.26/lib/libusb-1.0.dylib
I see that libusb-1.0_INCLUDE_DIR
is /usr/local/include
.
Still, make
would complain.
/Users/j824h/Documents/plug/src/com/UsbComm.cpp:25:10: fatal error: 'libusb-1.0/libusb.h' file not found
Syntax errors
After include_directories(/usr/local/include)
, the errors come from the header.
In file included from /Users/j824h/Documents/plug/src/com/UsbComm.cpp:25:
/usr/local/include/libusb-1.0/libusb.h:168:15: error: use of old-style cast [-Werror,-Wold-style-cast]
_tmp.b8[1] = (uint8_t) (x >> 8);
^ ~~~~~~~~
/usr/local/include/libusb-1.0/libusb.h:169:15: error: use of old-style cast [-Werror,-Wold-style-cast]
_tmp.b8[0] = (uint8_t) (x & 0xff);
^ ~~~~~~~~~~
/usr/local/include/libusb-1.0/libusb.h:789:31: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
uint8_t dev_capability_data[ZERO_SIZED_ARRAY];
... and so on.
Clang correctly cast errors for the non-C++ syntax in libusb.h, according to the flags provided in CMakeLists.txt
In the other way round, I started to wonder why CI could build.
from plug.
Still, make would complain.
But /usr/local/include
contains libusb-1.0/libusb.h
!? Well … than there's something broken here.
Relying on PkgConfig not supported on Mac?
Clang correctly cast errors for the non-C++ syntax in libusb.h, according to the flags provided in CMakeLists.txt
In the other way round, I started to wonder why CI could build.
Yes and no, the reported issues come from an external library (libusb) and those are treated as system headers, which aren't affected by warnings etc..
Including through include_directories()
wont do this, but rather treat the headers as usual. You can test this (not a solution!):
include_directories(SYSTEM /usr/local/include)
I'm not sure whether this works on Mac Clang though.
To sum it up: Findlibusb-1.0.cmake
isn't working correctly here (--> include not found).
from plug.
Can you try the 237-libusb_missing_header
branch please?
from plug.
Clang correctly cast errors for the non-C++ syntax in libusb.h, according to the flags provided in CMakeLists.txt
In the other way round, I started to wonder why CI could build.Yes and no, the reported issues come from an external library (libusb) and those are treated as system headers, which aren't affected by warnings etc..
Including through
include_directories()
wont do this, but rather treat the headers as usual. You can test this (not a solution!):include_directories(SYSTEM /usr/local/include)I'm not sure whether this works on Mac Clang though.
To sum it up:
Findlibusb-1.0.cmake
isn't working correctly here (--> include not found).
Oh, thanks for the clarification! (I got much left to know about this CMake...)
include_directories(SYSTEM /usr/local/include)
For now, adding this is all I need to build.
Can you try the
237-libusb_missing_header
branch please?🤦
I will keep tracking this!
Now make
moves on to other targets referring to libusb.h
and gives errors there.
from plug.
Thanks, so I can merge the branch. What are the other targets / errors?
from plug.
- plug-communication-usb
- UsbContext.cpp
- UsbException.cpp
- UsbDevice.cpp
- plug-updater
- MustangUpdater.cpp
All of those, excluding the tests.
from plug.
Next try: 237-libusb
– both targets link libusb on this branch now.
from plug.
Great! Since you have the change already, could you submit a PR please?
from plug.
Changes merged into master
. Are there any build issues left?
from plug.
In a Homebrew environment, there's a subtlety, that Qt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5
should be passed to CMake.
I do think the blame is on the package manager's choice not to install Qt in a default path.
Otherwise, 8d93d21 is working great with libusb-1.0
and googletest
installed by Homebrew on MacOS.
from plug.
I'm going to close here since compilation works now. Feel free to reopen if there's an issue left. Thanks
from plug.
Related Issues (14)
- Invalid amp id: 0 HOT 19
- Loading effects from amp or file does not preserve the position HOT 23
- Cmake fails due to Gtest dependency on Ubuntu Studio 22.04 HOT 8
- Fedora 36 FTBFS due to warnings as error - Allow? HOT 3
- FTBFS GCC 13 HOT 2
- Fender G-DEC 30 Compatiblity HOT 1
- 'cmake ..' Fails on Antergos (kernel 5.4.6) HOT 4
- Mustang V v2 amp not recognized. HOT 26
- Could NOT find GTest HOT 8
- Compiling fails in Manjaro HOT 3
- "Invalid amp id: 0" on Mustang I V2 HOT 42
- Fender Rumble LT 25 support? HOT 23
- Fender Mustang 2 - Core Dumped HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plug.