Re: [CMake] [CMAKE] cmake_device_link.o: nvcc fatal: Unknown option 'Wl, -start-group'

2018-09-08 Thread Alvin Chu
Thank you Marc, here we have to put " -Wl,-start-group" and " -Wl,-end-group" in target_link_libraries because these two link flags are special, must used between link targets. Now my way to fix is to use "-Xlinker -start-group" and "-Xlinker -end-group" instead. Thanks. Alvin On Fri, Sep 7,

Re: [CMake] [CMAKE] cmake_device_link.o: nvcc fatal: Unknown option 'Wl, -start-group'

2018-09-08 Thread Marc CHEVRIER
Hi, To avoid this, put link flags in ‘LINK_FLAGS’ target properly. ´target_link_libraries’ is populating ´LINK_LIBRARIES’ target property. Le sam. 8 sept. 2018 à 01:40, Alvin Chu a écrit : > Hi cmake team, > I'm using cmake 3.12.1, and building a project which has cuda codes, the > cmake file

[CMake] [CMAKE] cmake_device_link.o: nvcc fatal: Unknown option 'Wl, -start-group'

2018-09-07 Thread Alvin Chu
Hi cmake team, I'm using cmake 3.12.1, and building a project which has cuda codes, the cmake file looks like, list(APPEND ALL_OBJECTS $) list(APPEND ALL_OBJECTS $) add_library(lib1 SHARED ${ALL_OBJECTS}) list(APPEND ALL_LIBRARIES -Wl,-start-group) list(APPEND ALL_LIBRARIES ${SOME_LIBS})