Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMAKE for /DEF and /NODEFAULTLIB

How do I add linker-flags "DEF" and "NODEFAULTLIB" to vs2012 project via CMAKE?

like image 661
etwas77 Avatar asked Sep 13 '13 12:09

etwas77


1 Answers

You can append them to CMAKE_EXE_LINKER_FLAGS:

if(MSVC)
  set(CMAKE_EXE_LINKER_FLAGS
      "${CMAKE_EXE_LINKER_FLAGS} /DEF:my_defs.def /NODEFAULTLIB")
endif()
like image 141
Fraser Avatar answered Sep 21 '22 18:09

Fraser