Enable and fix CMake warnings

This commit is contained in:
Chris Thrasher 2024-02-21 20:39:13 -07:00
parent 4315c3d290
commit 75b1e0ca71
No known key found for this signature in database
GPG Key ID: 56FB686C9DFC8E2C
8 changed files with 24 additions and 7 deletions

View File

@ -69,6 +69,12 @@ if(SFML_OS_MACOS OR SFML_OS_IOS)
# add an option to automatically install Xcode templates # add an option to automatically install Xcode templates
sfml_set_option(SFML_INSTALL_XCODE_TEMPLATES FALSE BOOL "TRUE to automatically install the Xcode templates, FALSE to do nothing about it. The templates are compatible with Xcode 4 and 5.") sfml_set_option(SFML_INSTALL_XCODE_TEMPLATES FALSE BOOL "TRUE to automatically install the Xcode templates, FALSE to do nothing about it. The templates are compatible with Xcode 4 and 5.")
# add option to set iOS deployment target
sfml_set_option(SFML_IOS_DEPLOYMENT_TARGET "" STRING "iOS deployment target")
# add option to set code sign identity
sfml_set_option(SFML_CODE_SIGN_IDENTITY "" STRING "iOS code sign identity")
endif() endif()
# Android options # Android options
@ -301,6 +307,7 @@ else()
sfml_set_stdlib(SFML) sfml_set_stdlib(SFML)
# edit target properties # edit target properties
set(MACOSX_FRAMEWORK_ICON_FILE "")
set_target_properties(SFML PROPERTIES set_target_properties(SFML PROPERTIES
FRAMEWORK TRUE FRAMEWORK TRUE
FRAMEWORK_VERSION ${PROJECT_VERSION} FRAMEWORK_VERSION ${PROJECT_VERSION}

View File

@ -11,6 +11,15 @@
"SFML_BUILD_EXAMPLES": "ON", "SFML_BUILD_EXAMPLES": "ON",
"SFML_BUILD_TEST_SUITE": "ON", "SFML_BUILD_TEST_SUITE": "ON",
"SFML_WARNINGS_AS_ERRORS": "ON" "SFML_WARNINGS_AS_ERRORS": "ON"
},
"warnings": {
"dev": true,
"deprecated": true,
"uninitialized": true
},
"errors": {
"dev": true,
"deprecated": true
} }
} }
] ]

View File

@ -1,3 +1,5 @@
set(SFML_OS_ANDROID "")
# detect the OS # detect the OS
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(SFML_OS_WINDOWS 1) set(SFML_OS_WINDOWS 1)
@ -6,6 +8,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(OPENGL_ES 0) set(OPENGL_ES 0)
# detect the architecture # detect the architecture
set(ARCH_64BITS "")
if(CMAKE_SIZEOF_VOID_P EQUAL 4) if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(ARCH_32BITS 1) set(ARCH_32BITS 1)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)

View File

@ -190,6 +190,7 @@ macro(sfml_add_library module)
if((SFML_OS_MACOS OR SFML_OS_IOS) AND BUILD_SHARED_LIBS AND NOT THIS_STATIC) if((SFML_OS_MACOS OR SFML_OS_IOS) AND BUILD_SHARED_LIBS AND NOT THIS_STATIC)
if(SFML_BUILD_FRAMEWORKS) if(SFML_BUILD_FRAMEWORKS)
# adapt target to build frameworks instead of dylibs # adapt target to build frameworks instead of dylibs
set(MACOSX_FRAMEWORK_ICON_FILE "")
set_target_properties(${target} PROPERTIES set_target_properties(${target} PROPERTIES
FRAMEWORK TRUE FRAMEWORK TRUE
FRAMEWORK_VERSION ${PROJECT_VERSION} FRAMEWORK_VERSION ${PROJECT_VERSION}

View File

@ -14,14 +14,11 @@ find_path(
libudev.h libudev.h
/usr/include /usr/include
/usr/local/include /usr/local/include
${UDEV_PATH_INCLUDES}
) )
find_library( find_library(
UDEV_LIBRARIES UDEV_LIBRARIES
NAMES udev libudev NAMES udev libudev
PATHS ${ADDITIONAL_LIBRARY_PATHS}
${UDEV_PATH_LIB}
) )
if(UDEV_LIBRARIES AND UDEV_INCLUDE_DIR) if(UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
@ -41,10 +38,6 @@ if(UDEV_FOUND)
message(STATUS " include: ${UDEV_INCLUDE_DIR}") message(STATUS " include: ${UDEV_INCLUDE_DIR}")
else() else()
message(STATUS "UDev not found.") message(STATUS "UDev not found.")
message(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
message(STATUS " currently found includes: ${UDEV_INCLUDE_DIR}")
message(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
message(STATUS " currently found libs: ${UDEV_LIBRARIES}")
if(UDev_FIND_REQUIRED) if(UDev_FIND_REQUIRED)
message(FATAL_ERROR "Could not find UDev library") message(FATAL_ERROR "Could not find UDev library")
endif() endif()

View File

@ -1,6 +1,7 @@
# all source files # all source files
set(SRC OpenGL.cpp) set(SRC OpenGL.cpp)
set(RESOURCES "")
if(SFML_OS_IOS) if(SFML_OS_IOS)
set(RESOURCES set(RESOURCES
resources/background.jpg resources/background.jpg

View File

@ -1,5 +1,7 @@
# all source files # all source files
set(SRC Tennis.cpp) set(SRC Tennis.cpp)
set(RESOURCES "")
if(SFML_OS_IOS) if(SFML_OS_IOS)
set(RESOURCES set(RESOURCES
resources/ball.wav resources/ball.wav

View File

@ -174,6 +174,7 @@ if(SFML_ENABLE_COVERAGE AND SFML_OS_WINDOWS AND NOT SFML_COMPILER_GCC)
) )
endif() endif()
set(COVERAGE_PREFIX "")
if(SFML_ENABLE_COVERAGE AND OpenCppCoverage_FOUND) if(SFML_ENABLE_COVERAGE AND OpenCppCoverage_FOUND)
# Use OpenCppCoverage # Use OpenCppCoverage
message(STATUS "Using OpenCppCoverage to generate coverage report") message(STATUS "Using OpenCppCoverage to generate coverage report")