kripken/emscripten — pull request #2386 by mhenschel (2014-05-28 17:49:18+00:00)
Title: Turn on response files in cmake toolchain file(2)

This fixes issue #2295

I think the individual CMAKE_C/CXX_ARCHIVE_CREATE and CMAKE_C/CXX_ARCHIVE_APPEND directives are not necessary anymore. They might have been necessary in the past because CMAKE_AR was not set correctly as a cache variable before.
The CMAKE_C/CXX_CREATE_STATIC_LIBRARY calls are required to force cmake to use response files for objects. This is necessary because cmake has a hard coded limit for the command line which does not work well for windows because emscripten uses bat files to call the compiler. Bat files have a maximum command line length that is smaller than the general limit for windows executables.

I added a test for building shared and static libraries with cmake. The tests generate 60 source files to trigger the bug in #2295. Because all tests are being run in debug and release configs for all available build systems this might increase the time cmakes tests run quite a bit. Running it on mingw and MSVC takes about 4 minutes on my machine. Only testing with 2 source files takes about one minute. Is this a problem?

This pull request replaces #2359. I didn't know that a pull request should have a dedicated branch as source. I'm not used to git(hub) so please bear with me.