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)
28 set(ILASM_RESOURCES Native.rc)
29 add_definitions(-DFX_VER_INTERNALNAME_STR=ilasm.exe)
33 if(CLR_CMAKE_PLATFORM_UNIX)
34 # Need generate a right form of asmparse.cpp to avoid the following options.
35 # Clang also produces a bad-codegen on this prebuilt file with optimization.
36 # https://github.com/dotnet/coreclr/issues/2305
37 add_compile_options(-Wno-delete-non-virtual-dtor)
38 add_compile_options(-Wno-deprecated-register)
39 add_compile_options(-Wno-array-bounds)
40 add_compile_options(-Wno-unused-label)
41 set_source_files_properties( prebuilt/asmparse.cpp PROPERTIES COMPILE_FLAGS "-O0" )
42 endif(CLR_CMAKE_PLATFORM_UNIX)
49 set(ILASM_LINK_LIBRARIES
56 if(CLR_CMAKE_PLATFORM_UNIX)
57 target_link_libraries(ilasm
58 ${ILASM_LINK_LIBRARIES}
67 # FreeBSD and NetBSD implement dlopen(3) in libc
68 if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
69 target_link_libraries(ilasm
72 endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
74 target_link_libraries(ilasm
75 ${ILASM_LINK_LIBRARIES}
81 endif(CLR_CMAKE_PLATFORM_UNIX)