BlueGeneL.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #the compute nodes on BlueGene/L don't support shared libs
  2. set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
  3. set(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
  4. set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "") # -shared
  5. set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
  6. set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath
  7. set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
  8. set(CMAKE_LINK_LIBRARY_SUFFIX "")
  9. set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
  10. set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
  11. set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
  12. set(CMAKE_SHARED_LIBRARY_SUFFIX ".a") # .a
  13. set(CMAKE_EXECUTABLE_SUFFIX "") # .exe
  14. set(CMAKE_DL_LIBS "" )
  15. set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
  16. set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
  17. include(Platform/UnixPaths)
  18. if(CMAKE_COMPILER_IS_GNUCC)
  19. set(CMAKE_C_LINK_EXECUTABLE
  20. "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
  21. else()
  22. # when using IBM xlc we probably don't want to link to -lgcc
  23. set(CMAKE_C_LINK_EXECUTABLE
  24. "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lc -lnss_files -lnss_dns -lresolv")
  25. endif()
  26. if(CMAKE_COMPILER_IS_GNUCXX)
  27. set(CMAKE_CXX_LINK_EXECUTABLE
  28. "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
  29. else()
  30. # when using the IBM xlC we probably don't want to link to -lgcc
  31. set(CMAKE_CXX_LINK_EXECUTABLE
  32. "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv")
  33. endif()