diff --git a/CMakeLists.txt b/CMakeLists.txt index d87705d26f..8cb9698071 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -382,7 +382,7 @@ find_package(Threads REQUIRED) # but it also fixes several issues related to MT operations. # ...and CMake doesn't include it by default even when we specify # that we prefer the pthread flag; why is that? I don't know. -if (PLATFORM_EMSCRIPTEN) +if (EMSCRIPTEN) add_compile_options($<$:-pthread>) add_link_options($<$:-pthread>) endif() @@ -414,7 +414,7 @@ set(BUILD_TESTING OFF) set(ENABLE_TESTING OFF) # boost -if (PLATFORM_EMSCRIPTEN) +if (EMSCRIPTEN) set(BOOST_INCLUDE_LIBRARIES algorithm icl pool container heap headers filesystem crc variant) set(BOOST_CONTAINER_HEADER_ONLY ON) else() diff --git a/externals/cmake-modules/DetectPlatform.cmake b/externals/cmake-modules/DetectPlatform.cmake index 5c081e6f3d..52735a1d6f 100644 --- a/externals/cmake-modules/DetectPlatform.cmake +++ b/externals/cmake-modules/DetectPlatform.cmake @@ -101,7 +101,7 @@ if (MINGW) "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${MINGW_FLAGS}") endif() -if (PLATFORM_EMSCRIPTEN) +if (EMSCRIPTEN) set(EMSCRIPTEN_C_FLAGS "-s MEMORY64 -m64 -pipe -sMEMORY64=1") set(EMSCRIPTEN_LINK_FLAGS "-sMEMORY64=1 -m64 -Wl,-mwasm64 -sASYNCIFY=1") @@ -119,6 +119,6 @@ if (PLATFORM_EMSCRIPTEN) endif() # awesome -if (PLATFORM_FREEBSD OR PLATFORM_DRAGONFLYBSD) +if (FREEBSD OR DRAGONFLYBSD) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_SYSROOT}/usr/local/lib") endif() diff --git a/externals/ffmpeg/CMakeLists.txt b/externals/ffmpeg/CMakeLists.txt index 82fd08d7b0..4c969f8714 100644 --- a/externals/ffmpeg/CMakeLists.txt +++ b/externals/ffmpeg/CMakeLists.txt @@ -41,9 +41,8 @@ if (NOT YUZU_USE_BUNDLED_FFMPEG) # If YOUR OS/platform has actual native support: # 1. fucking congrats # 2. feel free to add it on the condition below - if (NOT (PLATFORM_NETBSD OR PLATFORM_SUN OR PLATFORM_FREEBSD - OR PLATFORM_OPENBSD OR PLATFORM_DRAGONFLYBSD OR PLATFORM_HAIKU - OR PLATFORM_LINUX OR PLATFORM_MSYS OR WIN32 OR ANDROID OR APPLE)) + if (NOT (NETBSD OR SOLARIS OR FREEBSD OR OPENBSD OR DRAGONFLYBSD OR HAIKU + OR LINUX OR MSYS OR WIN32 OR ANDROID OR APPLE)) set(FFmpeg_SYSTEM_NAME "none") endif() # TODO: Can we really do better? Auto-detection? Something clever? @@ -51,9 +50,8 @@ if (NOT YUZU_USE_BUNDLED_FFMPEG) --enable-cross-compile --arch="${CMAKE_SYSTEM_PROCESSOR}" --target-os="${FFmpeg_SYSTEM_NAME}") - if (PLATFORM_EMSCRIPTEN) - # funniest trolling from emscripten, such a classic! - # maybe I should PR so they use CMAKE_SYSROOT... y'know? + # Emscripten doesn't use CMAKE_SYSROOT I'm afraid, but it does well use EMSCRIPTEN_SYSROOT + if (EMSCRIPTEN) list(APPEND FFmpeg_CROSS_COMPILE_FLAGS --sysroot="${EMSCRIPTEN_SYSROOT}") else() list(APPEND FFmpeg_CROSS_COMPILE_FLAGS --sysroot="${CMAKE_SYSROOT}") @@ -277,7 +275,7 @@ else() # Some SDKs (especially wasm) require us, actually, WANT us to use their "emconfigure" # otherwise they will cry a billion tears - if (PLATFORM_EMSCRIPTEN) + if (EMSCRIPTEN) find_program(FFmpeg_CONFIGURE_WRAPPER emconfigure REQUIRED) else() find_program(FFmpeg_CONFIGURE_WRAPPER bash REQUIRED) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 961977ff83..4a9e46bcbd 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -237,7 +237,7 @@ else() endif() target_link_libraries(common PRIVATE OpenSSL::SSL) target_link_libraries(common PUBLIC Boost::filesystem httplib::httplib nlohmann_json::nlohmann_json) -if (NOT PLATFORM_EMSCRIPTEN) +if (NOT EMSCRIPTEN) # Emscripten is: "bring your own implementation", boost doesn't add upstream support sadly target_link_libraries(common PRIVATE Boost::context) endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 8cd002b2c3..c7f0e89362 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1162,7 +1162,7 @@ add_library(core STATIC tools/freezer.h tools/renderdoc.cpp tools/renderdoc.h) -if (NOT PLATFORM_EMSCRIPTEN) +if (NOT EMSCRIPTEN) # incompatible with wasm's async model target_sources(core PRIVATE debugger/gdbstub.cpp @@ -1214,7 +1214,7 @@ target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network vid if (BOOST_NO_HEADERS) target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::crc) - if (NOT PLATFORM_EMSCRIPTEN) + if (NOT EMSCRIPTEN) target_link_libraries(core PUBLIC Boost::asio Boost::process) endif() else() diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index 01cf6a52f2..d857a27528 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt @@ -33,7 +33,7 @@ add_library(input_common STATIC input_poller.h main.cpp main.h) -if (NOT PLATFORM_EMSCRIPTEN) +if (NOT EMSCRIPTEN) target_sources(input_common PRIVATE drivers/udp_client.cpp drivers/udp_client.h) diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 616b865e73..7ad9c05715 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -76,7 +76,7 @@ if (NOT MSVC) $<$:-Wno-missing-field-initializers>) endif() -if (PLATFORM_EMSCRIPTEN) +if (EMSCRIPTEN) # 10GB is required at max... yikes! target_link_options(yuzu-cmd PRIVATE -sALLOW_MEMORY_GROWTH=1