CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. add_executable (GCStress
  2. GCStress.cpp
  3. RecyclerTestObject.cpp
  4. stdafx.cpp
  5. StubExternalApi.cpp
  6. )
  7. include_directories(..)
  8. target_include_directories (GCStress
  9. PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
  10. $<BUILD_INTERFACE:${ROOT_SOURCE_DIR}/lib/Common>
  11. $<BUILD_INTERFACE:${ROOT_SOURCE_DIR}/lib/Common/Memory>
  12. )
  13. set(LINK_FLAGS ${LINK_FLAGS} "-Wl,-whole-archive")
  14. if(CMAKE_SYSTEM_NAME STREQUAL Linux)
  15. set(lib_target
  16. -Wl,--no-undefined
  17. -Wl,--start-group
  18. )
  19. elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
  20. set(lib_target
  21. -Wl,-undefined,error
  22. )
  23. else()
  24. message("This platform is not yet supported")
  25. endif() # Linux ?
  26. # make sure to include Common.Core before others
  27. # this will help linker on some platforms for correct
  28. # initialization order
  29. set(lib_target "${lib_target}"
  30. Chakra.Common.Core
  31. )
  32. # common link deps
  33. set(lib_target "${lib_target}"
  34. Chakra.Common.Memory
  35. Chakra.Runtime.PlatformAgnostic
  36. Chakra.Common.Common
  37. Chakra.Common.DataStructures
  38. Chakra.Common.Exceptions
  39. )
  40. if(CMAKE_SYSTEM_NAME STREQUAL Linux)
  41. set(lib_target "${lib_target}"
  42. -Wl,--end-group
  43. Chakra.Pal
  44. )
  45. elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
  46. set(lib_target "${lib_target}"
  47. Chakra.Pal
  48. )
  49. endif() # Linux ?
  50. target_link_libraries (GCStress ${lib_target})