Browse Source

PLATFORM_EMSCRIPTEN -> EMSCRIPTEN

eden-wasm
lizzie 3 days ago
parent
commit
ab932a21f5
  1. 4
      CMakeLists.txt
  2. 4
      externals/cmake-modules/DetectPlatform.cmake
  3. 12
      externals/ffmpeg/CMakeLists.txt
  4. 2
      src/common/CMakeLists.txt
  5. 4
      src/core/CMakeLists.txt
  6. 2
      src/input_common/CMakeLists.txt
  7. 2
      src/yuzu_cmd/CMakeLists.txt

4
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($<$<COMPILE_LANGUAGE:C,CXX>:-pthread>)
add_link_options($<$<COMPILE_LANGUAGE:C,CXX>:-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()

4
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()

12
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)

2
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()

4
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()

2
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)

2
src/yuzu_cmd/CMakeLists.txt

@ -76,7 +76,7 @@ if (NOT MSVC)
$<$<COMPILE_LANGUAGE:C,CXX>:-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

Loading…
Cancel
Save