Skip to content

Commit 38289f3

Browse files
oltolmMegamouse
authored andcommitted
fix Windows build with GCC/Clang
1 parent 3d0a68c commit 38289f3

File tree

7 files changed

+26
-34
lines changed

7 files changed

+26
-34
lines changed

3rdparty/curl/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ else()
2626
endif()
2727
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "Use libSSH2")
2828
set(CURL_USE_LIBPSL OFF CACHE BOOL "Use libPSL")
29-
30-
set(CURL_DISABLE_TESTS ON)
29+
option(BUILD_TESTING "Build tests" OFF)
30+
option(BUILD_EXAMPLES "Build libcurl examples" OFF)
3131

3232
add_subdirectory(curl EXCLUDE_FROM_ALL)
3333

3rdparty/qt6.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Find the correct ppa at https://launchpad.net/~beineri and follow the instructio
3232
else()
3333
message("CMake was unable to find Qt6!")
3434
if(WIN32)
35-
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\${QT_MIN_VER}\\msvc2019_64\\)
36-
You can also try setting the Qt6_DIR preprocessor definiton.")
35+
message(FATAL_ERROR "Make sure the Qt6_ROOT environment variable has been set properly. (for example C:\\Qt\\${QT_MIN_VER}\\msvc2022_64\\)")
3736
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
3837
message(FATAL_ERROR "Make sure to install your distro's qt6 package!")
3938
else()

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
147147
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")
148148
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${PROJECT_BINARY_DIR}/bin")
149149

150+
if(BUILD_RPCS3_TESTS)
151+
enable_testing()
152+
endif()
150153
add_subdirectory(rpcs3)
151154

152155
set_directory_properties(PROPERTIES VS_STARTUP_PROJECT rpcs3)

buildfiles/cmake/FindFFMPEG.cmake

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
2222
# in cache already
2323
set(FFMPEG_FOUND TRUE)
24-
else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
24+
else ()
2525
# use pkg-config to get the directories and then use these values
2626
# in the FIND_PATH() and FIND_LIBRARY() calls
2727
find_package(PkgConfig)
@@ -31,7 +31,7 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
3131
pkg_check_modules(_FFMPEG_AVUTIL libavutil)
3232
pkg_check_modules(_FFMPEG_SWSCALE libswscale)
3333
pkg_check_modules(_FFMPEG_SWRESAMPLE libswresample)
34-
endif (PKG_CONFIG_FOUND)
34+
endif ()
3535

3636
find_path(FFMPEG_AVCODEC_INCLUDE_DIR
3737
NAMES libavcodec/avcodec.h
@@ -64,9 +64,10 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
6464
PATHS ${_FFMPEG_SWRESAMPLE_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
6565
)
6666

67-
if (FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVFORMAT AND FFMPEG_LIBSWSCALE AND FFMPEG_LIBSWRESAMPLE)
68-
set(FFMPEG_FOUND TRUE)
69-
endif()
67+
find_package_handle_standard_args(FFMPEG
68+
DEFAULT_MSG
69+
FFMPEG_LIBAVCODEC FFMPEG_LIBAVFORMAT FFMPEG_LIBSWSCALE FFMPEG_LIBSWRESAMPLE
70+
)
7071

7172
if (FFMPEG_FOUND)
7273
set(FFMPEG_INCLUDE_DIR ${FFMPEG_AVCODEC_INCLUDE_DIR})
@@ -79,17 +80,6 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
7980
${FFMPEG_LIBSWRESAMPLE}
8081
)
8182

82-
endif (FFMPEG_FOUND)
83-
84-
if (FFMPEG_FOUND)
85-
if (NOT FFMPEG_FIND_QUIETLY)
86-
message(STATUS "Found FFMPEG or Libav: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}")
87-
endif (NOT FFMPEG_FIND_QUIETLY)
88-
else (FFMPEG_FOUND)
89-
if (FFMPEG_FIND_REQUIRED)
90-
message(FATAL_ERROR "Could not find libavcodec or libavformat or libavutil or libswscale or libswresample")
91-
endif (FFMPEG_FIND_REQUIRED)
92-
endif (FFMPEG_FOUND)
93-
94-
endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
83+
endif ()
9584

85+
endif ()

buildfiles/cmake/FindWayland.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ IF (NOT WIN32)
4949

5050
include(FindPackageHandleStandardArgs)
5151

52-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR)
53-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR)
54-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR)
55-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CURSOR DEFAULT_MSG WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR)
56-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR)
52+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT REQUIRED_VARS WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR NAME_MISMATCHED)
53+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER REQUIRED_VARS WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR NAME_MISMATCHED)
54+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL REQUIRED_VARS WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR NAME_MISMATCHED)
55+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CURSOR REQUIRED_VARS WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR NAME_MISMATCHED)
56+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND REQUIRED_VARS WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR NAME_MISMATCHED)
5757

5858
MARK_AS_ADVANCED(
5959
WAYLAND_INCLUDE_DIR WAYLAND_LIBRARIES

rpcs3/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ set(CMAKE_CXX_STANDARD 20)
1313
set(ADDITIONAL_LIBS "")
1414
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
1515
#on some Linux distros shm_unlink and similar functions are in librt only
16-
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "rt")
16+
list(APPEND ADDITIONAL_LIBS "rt")
1717
elseif(NOT WIN32 AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG")
1818
#it seems like glibc includes the iconv functions we use but other libc
1919
#implementations like the one on OSX don't seem implement them
20-
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "iconv")
20+
list(APPEND ADDITIONAL_LIBS "iconv")
2121
endif()
2222

2323
if(UNIX AND NOT APPLE AND NOT ANDROID)
24-
add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}/rpcs3")
24+
add_compile_definitions(DATADIR="${CMAKE_INSTALL_FULL_DATADIR}/rpcs3")
2525
# Optionally enable X11 for window management
2626
find_package(X11)
2727
if(X11_FOUND)
28-
add_definitions(-DHAVE_X11)
28+
add_compile_definitions(HAVE_X11)
2929
endif()
3030
find_package(Wayland)
3131
if(WAYLAND_FOUND)
32-
add_definitions(-DHAVE_WAYLAND)
32+
add_compile_definitions(HAVE_WAYLAND)
3333
endif()
3434
endif()
3535

@@ -188,7 +188,6 @@ endif()
188188

189189
# Unit tests
190190
if(BUILD_RPCS3_TESTS)
191-
enable_testing()
192191
find_package(GTest REQUIRED)
193192

194193
message(STATUS "Building unit tests...")
@@ -206,6 +205,7 @@ if(BUILD_RPCS3_TESTS)
206205
target_link_libraries(rpcs3_test
207206
PRIVATE
208207
rpcs3_lib
208+
rpcs3_emu
209209
GTest::gtest
210210
)
211211

rpcs3/Input/hid_pad_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "Utilities/CRC.h"
55
#include "Utilities/Thread.h"
66

7-
#include "hidapi.h"
7+
#include <hidapi.h>
88

99
#ifdef ANDROID
1010
#include "hidapi_libusb.h"

0 commit comments

Comments
 (0)