|
| 1 | +set(CMAKE_INCLUDE_CURRENT_DIR ON) |
| 2 | +set(INTERPRETER_SOURCES |
| 3 | + compiler.cpp |
| 4 | + compileropt.cpp |
| 5 | + intops.cpp |
| 6 | + eeinterp.cpp) |
| 7 | + |
| 8 | +set(INTERPRETER_LINK_LIBRARIES |
| 9 | +) |
| 10 | + |
| 11 | +if(CLR_CMAKE_HOST_WIN32) |
| 12 | + list(APPEND INTERPRETER_LINK_LIBRARIES |
| 13 | + ${STATIC_MT_CRT_LIB} |
| 14 | + ${STATIC_MT_VCRT_LIB} |
| 15 | + ) |
| 16 | +endif(CLR_CMAKE_HOST_WIN32) |
| 17 | + |
| 18 | +if(CLR_CMAKE_HOST_WIN32) |
| 19 | + set(CLRINTERPRETER_EXPORTS ${CMAKE_CURRENT_LIST_DIR}/clrinterpreter.exports) |
| 20 | + set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/clrinterpreter.def) |
| 21 | + preprocess_file(${CLRINTERPRETER_EXPORTS} ${EXPORTS_FILE}) |
| 22 | + list(APPEND INTERPRETER_SOURCES ${EXPORTS_FILE}) |
| 23 | + add_custom_target(interpreter_exports DEPENDS ${EXPORTS_FILE}) |
| 24 | +else() |
| 25 | + set(CLRINTERPRETER_EXPORTS ${CMAKE_CURRENT_LIST_DIR}/clrinterpreter_unixexports.src) |
| 26 | + set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/clrinterpreter.exports) |
| 27 | + generate_exports_file(${CLRINTERPRETER_EXPORTS} ${EXPORTS_FILE}) |
| 28 | + add_custom_target(interpreter_exports DEPENDS ${EXPORTS_FILE}) |
| 29 | +endif() |
| 30 | + |
| 31 | +add_library_clr(clrinterpreter SHARED ${INTERPRETER_SOURCES}) |
| 32 | + |
| 33 | +add_dependencies(clrinterpreter interpreter_exports) |
| 34 | + |
| 35 | +if(NOT CLR_CMAKE_HOST_WIN32) |
| 36 | + set_exports_linker_option(${EXPORTS_FILE}) |
| 37 | + set_property(TARGET clrinterpreter APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION}) |
| 38 | +endif() |
| 39 | + |
| 40 | +target_link_libraries(clrinterpreter |
| 41 | + PRIVATE |
| 42 | + ${INTERPRETER_LINK_LIBRARIES} |
| 43 | + ) |
| 44 | + |
| 45 | +set_property(TARGET clrinterpreter APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE}) |
| 46 | + |
| 47 | +install_clr(TARGETS clrinterpreter DESTINATIONS . COMPONENT runtime) |
0 commit comments