Skip to content

Commit 0c99264

Browse files
authored
Fix MSVC build when CMAKE_UNITY_BUILD is globally on (#30)
On Microsoft Windows, the library fails to build when CMAKE_UNITY_BUILD is globally turned on. However, on Linux, it just works fine.
1 parent 8f0b4a3 commit 0c99264

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ if(WIN32)
160160
)
161161
target_compile_definitions(usb-1.0 PRIVATE $<$<C_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS=1>)
162162
target_link_libraries(usb-1.0 PRIVATE windowsapp)
163+
set_target_properties(usb-1.0 PROPERTIES UNITY_BUILD OFF)
163164
else()
164165
# common POSIX/non-Windows sources
165166
target_sources(usb-1.0 PRIVATE

0 commit comments

Comments
 (0)