Switch source build property to DotNetBuildFromSource
[platform/upstream/coreclr.git] / src / tools / crossgen / CMakeLists.txt
1 project(crossgen)
2
3 include(${CLR_DIR}/crossgen.cmake)
4
5 set(CMAKE_INCLUDE_CURRENT_DIR ON)
6 include_directories(../util)
7 include_directories(../../pal/prebuilt/corerror)
8
9 set(crossgen_SOURCES crossgen.cpp ../util/consoleargs.cpp)
10 if(WIN32)
11     set(crossgen_RESOURCES Native.rc)
12     add_definitions(-D_CRT_NON_CONFORMING_WCSTOK)
13 endif()
14
15 if(CLR_CMAKE_PLATFORM_UNIX)
16   add_compile_options(-fPIE)
17   add_definitions(-DNO_NGENPDB)
18 endif(CLR_CMAKE_PLATFORM_UNIX)
19
20 add_definitions(-DFX_VER_INTERNALNAME_STR=crossgen.exe)
21
22 add_executable_clr(crossgen
23   ${crossgen_SOURCES}
24   ${crossgen_RESOURCES}
25 )
26
27 if(FEATURE_MERGE_JIT_AND_ENGINE)
28     set(CLRJIT_CROSSGEN clrjit_crossgen)
29 endif(FEATURE_MERGE_JIT_AND_ENGINE)
30
31 target_link_libraries(crossgen
32     cee_crossgen
33     mdcompiler_crossgen
34     mdruntime_crossgen
35     mdruntimerw_crossgen
36     mdhotdata_crossgen
37     corguids
38     ${CLRJIT_CROSSGEN}
39     gcinfo_crossgen
40     corzap_crossgen
41     mscorlib_crossgen
42     strongname_crossgen
43     utilcode_crossgen
44     v3binder_crossgen
45 )
46
47 if(CLR_CMAKE_PLATFORM_UNIX)
48     target_link_libraries(crossgen
49         mscorrc_debug
50         coreclrpal
51         palrt
52     )
53 else()
54     target_link_libraries(crossgen
55         advapi32
56         ole32
57         oleaut32
58         uuid
59         user32
60         version
61         shlwapi
62         bcrypt
63         mdwinmd_crossgen
64         ${STATIC_MT_CRT_LIB}
65         ${STATIC_MT_VCRT_LIB}
66     )
67
68 endif(CLR_CMAKE_PLATFORM_UNIX)
69
70 add_subdirectory(../../zap/crossgen ../../zap/crossgen)
71 add_subdirectory(../../vm/crossgen ../../vm/crossgen)
72 add_subdirectory(../../vm/crossgen_mscorlib ../../vm/crossgen_mscorlib)
73
74 # add the install targets
75 install_clr(crossgen)