emscripten/tests/cmake
Matt McCormick b206b9e304 Override CMake CheckTypeSize.
The CMake CheckTypeSize module is used by many projects to get sizes of types
for the target platform. Its standard implementation builds a file that
contains the type size with the try_compile command, then uses file(STRINGS on
the built function to extract the size from the contents of the built binary.

Since emscripten produces javascript and html instead of binaries, the string
is not embedded directly in the 'binary' as expected.  Alternatively, we use a
try_run and return the size of the type in the return value.
2015-05-12 09:58:03 -04:00
..
target_html Fix a long-standing CMake toolchain issue where the toolchain was not able to specify a default suffix (.js) for generated executables and the suffix that was set got silently erased. Previously the default suffix was empty "", which meant all user CMakeLists.txt files had to explicitly specify the suffix. Fixing this adds support for CMake built-in check_function_exists() detection macro which is used e.g. by SDL2 CMakeLists.txt path. To build html files, add the directive 'SET(CMAKE_EXECUTABLE_SUFFIX ".html")' like before. 2014-07-10 19:45:30 +03:00
target_js Override CMake CheckTypeSize. 2015-05-12 09:58:03 -04:00
target_library add test for building shared and static libraries with cmake 2014-05-28 19:30:04 +02:00