From b31280e387b6acbd76af771d11e87913982fa521 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sat, 7 Sep 2024 15:17:12 +0000 Subject: [PATCH] Fix GCC compilation for windows --- buildfiles/cmake/ConfigureCompiler.cmake | 9 +++++---- rpcs3/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/buildfiles/cmake/ConfigureCompiler.cmake b/buildfiles/cmake/ConfigureCompiler.cmake index b4f21e88ab..e7efd5ba13 100644 --- a/buildfiles/cmake/ConfigureCompiler.cmake +++ b/buildfiles/cmake/ConfigureCompiler.cmake @@ -100,10 +100,6 @@ else() add_link_options(-no-pie) endif() elseif(APPLE) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - add_compile_options(-stdlib=libc++) - endif() - if (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64") add_link_options(-Wl,-image_base,0x10000 -Wl,-pagezero_size,0x10000) add_link_options(-Wl,-no_pie) @@ -119,4 +115,9 @@ else() add_link_options(-Wl,--image-base,0x10000) endif() + + # Specify C++ library to use as standard C++ when using clang + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_compile_options(-stdlib=libc++) + endif() endif() diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 97a19447d2..a70756d3be 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -114,7 +114,7 @@ if(UNIX) endif() if(WIN32) - target_link_libraries(rpcs3 PRIVATE bcrypt ws2_32 Iphlpapi Winmm Psapi gdi32 setupapi pdh c++) + target_link_libraries(rpcs3 PRIVATE bcrypt ws2_32 Iphlpapi Winmm Psapi gdi32 setupapi pdh) else() target_link_libraries(rpcs3 PRIVATE ${CMAKE_DL_LIBS}) endif()