pololu / libusbp

The Pololu USB Library (also known as libusbp) is a cross-platform C library for accessing USB devices.
Other
104 stars 32 forks source link

Fix compile issue when used as submodule #18

Open bruce87en opened 1 month ago

bruce87en commented 1 month ago

Fix compile issue when used as submodule: 1.Modify BUILD_SHARED_LIBS to BUILD_LIBUSBP_SHARED_LIBS to avoid potential conflicts. 2.Modify the header file include path relative to the current CMakeLists.txt to avoid compilation errors caused by the top-level project not being libusbp.

DavidEGrayson commented 1 month ago

Change 2 seems OK, but for change 1, the intention is to just use this standard CMake variable which automatically controls what type of library gets built, instead of defining our own:

https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html

So I think the BUILD_SHARED_LIBS code should stay is it is, but you could elaborate on what specific problem it's causing for you