3 add_definitions(-DUNICODE)
4 add_definitions(-D_UNICODE)
5 add_definitions(-D_FEATURE_NO_HOST)
6 add_definitions(-D__ILASM__)
8 add_definitions(-DFEATURE_CORECLR)
10 include_directories(.)
11 include_directories(../ildasm/unixcoreclrloader)
13 if(CLR_CMAKE_PLATFORM_UNIX)
14 add_compile_options(-fPIE)
15 endif(CLR_CMAKE_PLATFORM_UNIX)
27 set_source_files_properties( prebuilt/asmparse.c PROPERTIES LANGUAGE CXX )
29 if(CLR_CMAKE_PLATFORM_UNIX)
30 add_compile_options(-x c++)
31 # Need generate a right form of asmparse.c to avoid the following options.
32 # Clang also produces a bad-codegen on this prebuilt file with optimization.
33 # https://github.com/dotnet/coreclr/issues/2305
34 add_compile_options(-Wno-delete-non-virtual-dtor)
35 add_compile_options(-Wno-deprecated-register)
36 add_compile_options(-Wno-array-bounds)
37 add_compile_options(-Wno-unused-label)
38 set_source_files_properties( prebuilt/asmparse.c PROPERTIES COMPILE_FLAGS -O0 )
39 endif(CLR_CMAKE_PLATFORM_UNIX)
45 set(ILASM_LINK_LIBRARIES
52 if(CLR_CMAKE_PLATFORM_UNIX)
53 target_link_libraries(ilasm
54 ${ILASM_LINK_LIBRARIES}
63 # FreeBSD and NetBSD implement dlopen(3) in libc
64 if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
65 target_link_libraries(ilasm
68 endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
70 target_link_libraries(ilasm
71 ${ILASM_LINK_LIBRARIES}
77 endif(CLR_CMAKE_PLATFORM_UNIX)