Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Silence warnings. #9071

Merged
merged 1 commit into from Oct 26, 2020
Merged

cmake: Silence warnings. #9071

merged 1 commit into from Oct 26, 2020

Conversation

orbea
Copy link
Contributor

@orbea orbea commented Sep 9, 2020

Silences many warnings with newer cmake versions, tested with cmake-3.18.2.

There are two issues.

  • There are many instances of find_package(Foo) which calls FindFoo.cmake and includes many FOO_ variables. It should use one name consistently. For example find_package(FOO), FindFOO.cmake and FOO_FOUND.
  • It seems better to use find_package(PkgConfig) instead of include(FindPkgConfig), most of the cmake files in dolphin already do this and upstream cmake also does this in their own modules.

Examples:

CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (CUBEB) does
  not match the name of the calling package (Cubeb).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  CMake/FindCubeb.cmake:6 (find_package_handle_standard_args)
  CMakeLists.txt:682 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (PulseAudio).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_standard_args)
  CMake/FindPulseAudio.cmake:9 (include)
  Source/Core/AudioCommon/CMakeLists.txt:51 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Full log: dolphin.log

@@ -485,8 +485,8 @@ if(OPROFILING)
endif()

if(ENABLE_EVDEV)
find_package(Libudev REQUIRED)
find_package(Libevdev REQUIRED)
find_package(LIBUDEV REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really for this review but just surprised we use if(LIBUDEV_FOUND...) when we specify REQURIED

Copy link
Contributor Author

@orbea orbea Sep 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like you said, that is out of scope for this PR, but it should probably be fixed later... It might be possible to make them entirely optional?

$ find . -type f -iname '*cmake*' | xargs grep -e LIBUDEV_FOUND -e LIBEVDEV_FOUND
./Externals/libusb/CMakeLists.txt:    if(LIBUDEV_FOUND)
./Externals/hidapi/CMakeLists.txt:  if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LIBUDEV_FOUND)
./Source/Core/InputCommon/CMakeLists.txt:if(LIBEVDEV_FOUND AND LIBUDEV_FOUND)
./CMake/FindLIBEVDEV.cmake:#  LIBEVDEV_FOUND - System has libevdev
./CMake/FindLIBUDEV.cmake:#  LIBUDEV_FOUND - System has LIBUDEV
./CMakeLists.txt:  if(LIBUDEV_FOUND AND LIBEVDEV_FOUND)

@leoetlino leoetlino merged commit 23c9179 into dolphin-emu:master Oct 26, 2020
10 checks passed
@orbea orbea deleted the cmake branch October 26, 2020 17:49
Zopolis4 added a commit to Zopolis4/dolphin that referenced this pull request May 28, 2022
Zopolis4 added a commit to Zopolis4/dolphin that referenced this pull request May 30, 2022
Minty-Meeo pushed a commit to Minty-Meeo/dolphin that referenced this pull request Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants