From cc40a91343b124abf87ab0ae2fae22abf1f9561b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1zaro=20Albuquerque?= <33807434+lzralbu@users.noreply.github.com> Date: Sun, 16 Jun 2024 04:42:50 -0400 Subject: [PATCH] [build] Fix some warnings on web builds and remove some redundant flags. (#4069) * update * Revert "update" This reverts commit e8adcabd94830be66938e12143c8fe23cdeab605. * update * remove a not stricly required flag --- cmake/LibraryConfigurations.cmake | 1 - examples/CMakeLists.txt | 5 ++--- src/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmake/LibraryConfigurations.cmake b/cmake/LibraryConfigurations.cmake index 23a7ec2f..f6dd4f31 100644 --- a/cmake/LibraryConfigurations.cmake +++ b/cmake/LibraryConfigurations.cmake @@ -59,7 +59,6 @@ if (${PLATFORM} MATCHES "Desktop") elseif (${PLATFORM} MATCHES "Web") set(PLATFORM_CPP "PLATFORM_WEB") set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 --profiling") set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") elseif (${PLATFORM} MATCHES "Android") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 28550eae..64b6d760 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -96,10 +96,9 @@ if (${PLATFORM} MATCHES "Android") list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_basic_lighting.c) elseif (${PLATFORM} MATCHES "Web") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os") # Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s WASM=1 -s ASYNCIFY -s ALLOW_MEMORY_GROWTH=1 --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html") set(CMAKE_EXECUTABLE_SUFFIX ".html") list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/raylib_opengl_interop.c) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 38766570..bfb4b05b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -69,7 +69,7 @@ else() endif() if (${PLATFORM} MATCHES "Web") - target_link_options(raylib PRIVATE "-sUSE_GLFW=3") + target_link_options(raylib PUBLIC "-sUSE_GLFW=3") endif() set_target_properties(raylib PROPERTIES