udev rules location

This commit is contained in:
wb2osz 2025-04-24 13:32:07 -04:00
parent 22c1042882
commit ea93fcd424
2 changed files with 9 additions and 3 deletions

View File

@ -210,6 +210,7 @@ if (C_CLANG OR C_GCC)
# TODO: # TODO:
# Try error checking -fsanitize=bounds-strict -fsanitize=leak # Try error checking -fsanitize=bounds-strict -fsanitize=leak
# Requires libubsan and liblsan, respectively. # Requires libubsan and liblsan, respectively.
# Maybe -fstack-protector-all, -fstack-check
###set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wvla -ffast-math -ftree-vectorize -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE ${EXTRA_FLAGS}") ###set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wvla -ffast-math -ftree-vectorize -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE ${EXTRA_FLAGS}")
if(FREEBSD) if(FREEBSD)

View File

@ -28,10 +28,15 @@ file(WRITE "${CMAKE_BINARY_DIR}/direwolf.conf" "${file_content}")
# There are two locations. The one in /etc/udev/rules.d is meant for local customization and # There are two locations. The one in /etc/udev/rules.d is meant for local customization and
# takes precedence for the same name. # takes precedence for the same name.
# https://sources.debian.org/src/direwolf/1.7+dfsg-2/debian/patches/lib-udev-rules/ # https://sources.debian.org/src/direwolf/1.7+dfsg-2/debian/patches/lib-udev-rules/
# says that we should use the /usr/lib/udev/rules.d location. # says that we should use the /usr/lib/udev/rules.d location when building a package.
# TODO: I think the proper solution is to select the location based on whether
# the application installation location is /usr/local or /usr.
if(LINUX) if(LINUX)
#install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/) if (CMAKE_INSTALL_PREFIX STREQUAL "/usr/local")
install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /usr/lib/udev/rules.d/) install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/)
else()
install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /usr/lib/udev/rules.d/)
endif()
endif() endif()
install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR}) install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR})