Emscripten-Clang.cmake 983 B

123456789101112131415161718192021
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file LICENSE.rst or https://cmake.org/licensing for details.
  3. include_guard()
  4. macro(__emscripten_clang lang)
  5. set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-soname,")
  6. # FIXME(#27240): We do not add -sMAIN_MODULE to CMAKE_${lang}_LINK_EXECUTABLE
  7. # because it is not always needed, and can break things if added unnecessarily.
  8. # We also do not add -sMAIN_MODULE to CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS
  9. # to preserve legacy behavior in which projects added it as needed.
  10. # In the future we may add both flags with suitable controls.
  11. set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "")
  12. set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
  13. set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
  14. set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
  15. set(CMAKE_${lang}_COMPILE_OBJECT
  16. "<CMAKE_${lang}_COMPILER> -c <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -fPIC")
  17. endmacro()