|
| 1 | +# libspnavdev - direct 6dof device handling library |
| 2 | +# Copyright (C) 2021 Collabora, Ltd. |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: GPL-3-or-later |
| 5 | +# |
| 6 | +# This program is free software: you can redistribute it and/or modify |
| 7 | +# it under the terms of the GNU General Public License as published by |
| 8 | +# the Free Software Foundation, either version 3 of the License, or |
| 9 | +# (at your option) any later version. |
| 10 | +# |
| 11 | +# This program is distributed in the hope that it will be useful, |
| 12 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +# GNU General Public License for more details. |
| 15 | +# |
| 16 | +# You should have received a copy of the GNU General Public License |
| 17 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + |
| 19 | +add_executable(test test.c) |
| 20 | +target_link_libraries(test PRIVATE spnavdev) |
| 21 | + |
| 22 | +if(EMSCRIPTEN) |
| 23 | + set(M_LIBRARY "" CACHE STRING "libm (not necessary)" FORCE) |
| 24 | + |
| 25 | +# set(CMAKE_EXECUTABLE_SUFFIX ".html") |
| 26 | + |
| 27 | + set(SHELL ${CMAKE_CURRENT_SOURCE_DIR}/test.html) |
| 28 | + |
| 29 | + set_target_properties(test PROPERTIES LINK_FLAGS |
| 30 | + "--bind |
| 31 | + --no-heap-copy -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s ASYNCIFY=1 |
| 32 | + -s DYNCALLS=1 -s ASSERTIONS=1 |
| 33 | + -s EXPORTED_RUNTIME_METHODS=ccall,cwrap |
| 34 | + -s EXPORTED_FUNCTIONS=_test,_main |
| 35 | + -s TOTAL_STACK=33554432 -s TOTAL_MEMORY=134217728") |
| 36 | +endif() |
0 commit comments