Skip to content

CMAKE_AR in cmake toolchain file doesn't work #2288

Closed

Description

@mhenschel

Setting CMAKE_AR in Emscripten.cmake doesn't seem to have any effect. I found this which seems to be the same issue:
http://www.cmake.org/Bug/view.php?id=13038

So I tried this:
set(CMAKE_AR "${EMSCRIPTEN_ROOT_PATH}/emar${EMCC_SUFFIX}" CACHE FILEPATH "Archiver")

This seems to help. CMAKE_AR isn't empty anymore after setting this.

Activity

  1. juj commented on Apr 14, 2014

    @juj
    Collaborator

    Does it work if you replace this line https://github.com/kripken/emscripten/blob/master/cmake/Platform/Emscripten.cmake#L69 with the following?

    set(CMAKE_AR "${EMSCRIPTEN_ROOT_PATH}/emar${EMCC_SUFFIX}") CACHE FILEPATH "Emscripten Archiver")

    The question being whether one needs to use the CACHE parameter when setting that variable. After making that change to the Emscripten.cmake file, try deleting the CMakeCache.txt and CMakeFiles directory or make a new clean CMake configure step just to be sure.

  2. mhenschel commented on Apr 14, 2014

    @mhenschel
    ContributorAuthor

    I tried the line I posted first and I can see CMAKE_AR being set to the right value. I didn't try what you suggested because it seems to be the same to me except that you forgot to remove a bracket before CACHE.

    I cannot fully test this though because I have several other issues with the cmake build. It seems like the logic to force response files isn't working for me and I get errors when linking a static library because the command line gets too long. So I'm starting to find out what's wrong. This issue is just the first thing I noticed.

  3. mhenschel commented on Apr 14, 2014

    @mhenschel
    ContributorAuthor

    I got the cmake build running and I can confirm that making CMAKE_AR a CACHE variable works as it should.

  4. added a commit that references this issue on Apr 14, 2014
    cfecdac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions