From 01a05502e87b85527b069838cc698b388ab7e0ac Mon Sep 17 00:00:00 2001 From: oltolm Date: Wed, 2 Aug 2023 00:33:45 +0200 Subject: [PATCH] cmake: replace add_compile_definitions with target_compile_definitions --- CMakeLists.txt | 5 ----- rpcs3/CMakeLists.txt | 1 + rpcs3/Emu/CMakeLists.txt | 1 + rpcs3/rpcs3qt/CMakeLists.txt | 1 + 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8b39077f2..4aa13efff4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,11 +105,6 @@ if(CCACHE_FOUND) set(CMAKE_CXX_COMPILER_LAUNCHER ccache) endif() -if(WIN32) - add_compile_definitions(UNICODE) - add_compile_definitions(_WIN32_WINNT=0x0602) -endif() - if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64") include_directories(/opt/homebrew/include) link_directories(/opt/homebrew/lib) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 0bf6f5ebbb..ebad9bfeb3 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -42,6 +42,7 @@ add_subdirectory(rpcs3qt) if(WIN32) add_executable(rpcs3 WIN32) target_sources(rpcs3 PRIVATE rpcs3.rc) + target_compile_definitions(rpcs3 PRIVATE UNICODE _UNICODE) elseif(APPLE) add_executable(rpcs3 MACOSX_BUNDLE) target_sources(rpcs3 PRIVATE rpcs3.icns) diff --git a/rpcs3/Emu/CMakeLists.txt b/rpcs3/Emu/CMakeLists.txt index 4c3e348ccc..b1673a8077 100644 --- a/rpcs3/Emu/CMakeLists.txt +++ b/rpcs3/Emu/CMakeLists.txt @@ -163,6 +163,7 @@ if(WIN32) Audio/XAudio2/XAudio2Backend.cpp Audio/XAudio2/xaudio2_enumerator.cpp ) + target_compile_definitions(rpcs3_emu PRIVATE UNICODE _UNICODE _WIN32_WINNT=0x0602) endif() target_link_libraries(rpcs3_emu diff --git a/rpcs3/rpcs3qt/CMakeLists.txt b/rpcs3/rpcs3qt/CMakeLists.txt index 45abc35bf8..7408976176 100644 --- a/rpcs3/rpcs3qt/CMakeLists.txt +++ b/rpcs3/rpcs3qt/CMakeLists.txt @@ -124,6 +124,7 @@ add_library(rpcs3_ui STATIC if(WIN32) target_sources(rpcs3_ui PUBLIC "../windows.qrc") + target_compile_definitions(rpcs3_ui PRIVATE UNICODE _UNICODE) endif() set_target_properties(rpcs3_ui