summaryrefslogtreecommitdiff
path: root/src/ilasm/CMakeLists.txt
diff options
context:
space:
mode:
authorKyungwoo Lee <kyulee@microsoft.com>2015-12-08 14:26:54 -0800
committerKyungwoo Lee <kyulee@microsoft.com>2015-12-09 17:43:10 -0800
commitc09a2320ed6184f2ad0f0c59cdd6884c76c9e038 (patch)
treeec7fb163cb438237d19fdc849d121f84c3dbdac5 /src/ilasm/CMakeLists.txt
parentd1633211ee01ed05f467cacd36418f313e7a3d71 (diff)
downloadcoreclr-c09a2320ed6184f2ad0f0c59cdd6884c76c9e038.tar.gz
coreclr-c09a2320ed6184f2ad0f0c59cdd6884c76c9e038.tar.bz2
coreclr-c09a2320ed6184f2ad0f0c59cdd6884c76c9e038.zip
Enable ILASM for Windows
This enables ILASM/mscorpe on CoreCLR for Windows. 1. Fusion/StrongName(Full Sign) dependencies are removed since these are not CoreCLR features. 2. mscorpe is statically built/linked to ilasm. 3. asmparse.c is auto-generated by an internal version of yacc so I added it under prebuilt directory for now. Will create an issue so that we can build it using a standard tool like bison.
Diffstat (limited to 'src/ilasm/CMakeLists.txt')
-rw-r--r--src/ilasm/CMakeLists.txt52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/ilasm/CMakeLists.txt b/src/ilasm/CMakeLists.txt
new file mode 100644
index 0000000000..3481eb4a7a
--- /dev/null
+++ b/src/ilasm/CMakeLists.txt
@@ -0,0 +1,52 @@
+project(ilasm)
+
+add_definitions(-DUNICODE)
+add_definitions(-D_UNICODE)
+add_definitions(-D_FEATURE_NO_HOST)
+add_definitions(-D__ILASM__)
+
+add_definitions(-DFEATURE_CORECLR)
+
+include_directories(.)
+
+set(ILASM_SOURCES
+ assem.cpp
+ writer.cpp
+ writer_enc.cpp
+ method.cpp
+ asmman.cpp
+ main.cpp
+ assembler.cpp
+ prebuilt/asmparse.c
+)
+if(WIN32)
+ set_source_files_properties(prebuilt/asmparse.c PROPERTIES COMPILE_FLAGS "/TP")
+endif(WIN32)
+
+add_executable(ilasm
+ ${ILASM_SOURCES}
+)
+
+set(ILASM_LINK_LIBRARIES
+ mscorpe
+ utilcodestaticnohost
+ mdhotdata_full
+ corguids
+)
+
+if(CLR_CMAKE_PLATFORM_UNIX)
+ #TODO
+else()
+ target_link_libraries(ilasm
+ ${ILASM_LINK_LIBRARIES}
+ coreclr
+ msvcrt
+ ole32
+ oleaut32
+ shell32
+ )
+
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/ilasm.pdb DESTINATION PDB)
+endif(CLR_CMAKE_PLATFORM_UNIX)
+
+install (TARGETS ilasm DESTINATION .)