<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">You have to use SHELL token (see documentation of add_link_options)
<div dir="auto"><br /></div>
<div dir="auto">add_link_options ("SHELL:-s USE_WEBGL2=1"  "SHELL:-s FULL_ES2=1")</div>
<div dir="auto"><br /></div>
</div>
</div>
<div name="messageReplySection">Le 12 mai 2019 à 21:14 +0200, Fredrik Orderud <forderud@gmail.com>, a écrit :<br />
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">I'm struggling to figure out how to pass "-s USE_WEBGL2=1 -s<br />
FULL_ES2=1" (without the quotes) as linker options to _all_ CMake<br />
targets when using Emscripten targeting WebAssembly.<br />
<br />
I've already tried add_link_options(-s USE_WEBGL2=1 -s FULL_ES2=1),<br />
but that caused the second "-s" to disappear before reaching the<br />
linker. Also, calling add_link_options("-s USE_WEBGL2=1 -s<br />
FULL_ES2=1") causes quotes to be added to the linker call.<br />
<br />
I'm currently using set_target_properties(target PROPERTIES LINK_FLAGS<br />
"-s USE_WEBGL2=1 -s FULL_ES2=1") as temporary solution. This works<br />
fine, but am not satisfied with having to apply this manually to all<br />
targets.<br />
<br />
Any suggestions?<br />
--<br />
<br />
Powered by www.kitware.com<br />
<br />
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br />
<br />
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br />
<br />
CMake Support: http://cmake.org/cmake/help/support.html<br />
CMake Consulting: http://cmake.org/cmake/help/consulting.html<br />
CMake Training Courses: http://cmake.org/cmake/help/training.html<br />
<br />
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br />
<br />
Follow this link to subscribe/unsubscribe:<br />
https://cmake.org/mailman/listinfo/cmake<br /></blockquote>
</div>
</body>
</html>