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)
43 list(APPEND ILASM_SOURCES ${ILASM_HEADERS})
45 set(ILASM_RESOURCES Native.rc)
46 add_definitions(-DFX_VER_INTERNALNAME_STR=ilasm.exe)
50 if(CLR_CMAKE_PLATFORM_UNIX)
51 # Need generate a right form of asmparse.cpp to avoid the following options.
52 # Clang also produces a bad-codegen on this prebuilt file with optimization.
53 # https://github.com/dotnet/coreclr/issues/2305
54 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-delete-non-virtual-dtor")
55 add_compile_options(-Wno-register)
56 add_compile_options(-Wno-array-bounds)
57 add_compile_options(-Wno-unused-label)
58 set_source_files_properties( prebuilt/asmparse.cpp PROPERTIES COMPILE_FLAGS "-O0" )
59 endif(CLR_CMAKE_PLATFORM_UNIX)
66 set(ILASM_LINK_LIBRARIES
73 if(CLR_CMAKE_PLATFORM_UNIX)
74 target_link_libraries(ilasm
75 ${ILASM_LINK_LIBRARIES}
84 # FreeBSD and NetBSD implement dlopen(3) in libc
85 if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
86 target_link_libraries(ilasm
89 endif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
91 target_link_libraries(ilasm
92 ${ILASM_LINK_LIBRARIES}
98 endif(CLR_CMAKE_PLATFORM_UNIX)