Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set clr support to true with cmake

I am trying generate a managed c++ code with cmake. Below is the script which i have added for

 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/clr") 
 STRING(REPLACE "/EHsc" "/EHa" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
 STRING(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /clr")  

It does not set clrsupport to true.How do we do it cmake.

-swetha

like image 974
swetha Avatar asked Oct 22 '25 16:10

swetha


1 Answers

This does the trick for me, on Visual Studio 2017:

set_target_properties(${PROJECT_NAME} PROPERTIES COMMON_LANGUAGE_RUNTIME "")

Note that the values "pure" and "safe" have been removed with Visual Studio 2017, and the empty string "" as above will get you a "mixed" (native/managed) dll.

like image 77
Evgeniy Berezovsky Avatar answered Oct 25 '25 21:10

Evgeniy Berezovsky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!