diff --git a/README.md b/README.md index b12376d..b2b317c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![raylib-cpp Logo](projects/Doxygen/raylib-cpp_256x256.png) -# raylib-cpp [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) +# raylib-cpp ![Targeting raylib 4.5](https://img.shields.io/badge/for_raylib-4.5-blue) [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) [raylib-cpp](https://github.com/robloach/raylib-cpp) is a C++ wrapper library for [raylib](https://www.raylib.com), a simple and easy-to-use library to enjoy videogames programming. This C++ header provides object-oriented wrappers around *raylib*'s struct interfaces. *raylib-cpp* is not required to use *raylib* in C++, but the classes do bring using the raylib API more inline with C++'s language paradigm. diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index 513d21e..fcd8770 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -35,6 +35,9 @@ target_link_libraries(${PROJECT_NAME} PUBLIC raylib raylib_cpp) if (${PLATFORM} STREQUAL "Web") # Tell Emscripten to build an example.html file. set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html") + + # Required linker flags for using Raylib with Emscripten + target_link_options(${PROJECT_NAME} PRIVATE -sEXPORTED_FUNCTIONS=['_main','_malloc'] -sEXPORTED_RUNTIME_METHODS=ccall -sUSE_GLFW=3) endif() # That's it! You should have an example executable that you can run. Have fun! diff --git a/projects/CMake/README.md b/projects/CMake/README.md index 2337682..481181e 100644 --- a/projects/CMake/README.md +++ b/projects/CMake/README.md @@ -16,7 +16,7 @@ make ``` mkdir build cd build -emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" +emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release emmake make ```