File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ function(generate_config_file)
5050
5151 check_struct_has_member("struct timespec" tv_sec time.h HAVE_STRUCT_TIMESPEC)
5252
53+ if (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU" )
54+ check_c_compiler_flag("-fvisibility=hidden" HAVE_VISIBILITY)
55+ else ()
56+ set (HAVE_VISIBILITY OFF )
57+ endif ()
58+
5359 if (HAVE_VISIBILITY)
5460 set (DEFAULT_VISIBILITY "__attribute__((visibility(\" default\" )))" )
5561 else ()
@@ -74,10 +80,6 @@ function(generate_config_file)
7480 set (LIBUSB_WINDOWS_HOTPLUG 1)
7581 endif ()
7682
77- if (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU" )
78- check_c_compiler_flag("-fvisibility=hidden" HAVE_VISIBILITY)
79- endif ()
80-
8183 file (MAKE_DIRECTORY "${LIBUSB_GEN_INCLUDES} " )
8284 if (NOT MSVC )
8385 set (_GNU_SOURCE TRUE )
You can’t perform that action at this time.
0 commit comments