2 # File List auto generated by waf2cmake.py, do not modify manually.
5 # -- crymonobridge.waf_files --
7 add_sources("CryMonoBridge_main_uber_1.cpp"
17 add_sources("CryMonoBridge_main_uber_2.cpp"
18 SOURCE_GROUP "Wrappers"
19 "Wrappers/MonoDomain.h"
20 "Wrappers/MonoDomain.cpp"
21 "Wrappers/RootMonoDomain.h"
22 "Wrappers/RootMonoDomain.cpp"
23 "Wrappers/AppDomain.h"
24 "Wrappers/AppDomain.cpp"
25 "Wrappers/MonoLibrary.h"
26 "Wrappers/MonoLibrary.cpp"
27 "Wrappers/CompiledMonoLibrary.h"
28 "Wrappers/CompiledMonoLibrary.cpp"
29 "Wrappers/MonoClass.h"
30 "Wrappers/MonoClass.cpp"
31 "Wrappers/MonoObject.h"
32 "Wrappers/MonoObject.cpp"
33 "Wrappers/MonoException.h"
34 "Wrappers/MonoException.cpp"
35 "Wrappers/MonoMethod.h"
36 "Wrappers/MonoMethod.cpp"
37 "Wrappers/MonoString.h"
38 "Wrappers/MonoString.cpp"
39 "Wrappers/MonoProperty.h"
40 "Wrappers/MonoProperty.cpp"
43 add_sources("CryMonoBridge_main_uber_3.cpp"
44 SOURCE_GROUP "NativeComponents"
45 "NativeComponents/EntityComponentFactory.h"
46 "NativeComponents/EntityComponentFactory.cpp"
47 "NativeComponents/ManagedEntityComponent.h"
48 "NativeComponents/ManagedEntityComponent.cpp"
51 add_sources("CryMonoBridge_main_uber_4.cpp"
52 SOURCE_GROUP "NativeToManagedInterfaces"
53 "NativeToManagedInterfaces/IMonoNativeToManagedInterface.h"
54 "NativeToManagedInterfaces/Entity.h"
55 "NativeToManagedInterfaces/Entity.cpp"
56 "NativeToManagedInterfaces/Console.h"
57 "NativeToManagedInterfaces/Console.cpp"
58 "NativeToManagedInterfaces/Audio.h"
59 "NativeToManagedInterfaces/Audio.cpp"
62 if (OPTION_CRYMONO_SWIG)
63 add_sources("CryMonoBridge_SWIG.cpp"
72 "SWIG/CryDynamicResponseSystem.i"
73 "SWIG/CryEntitySystem.i"
76 "SWIG/CryMonoBridge.i"
77 "SWIG/CryLiveCreate.i"
83 "SWIG/CryScriptSystem.i"
85 "SWIG/ForwardDeclarations.i"
89 add_sources("NoUberFile"
97 CryEngineModule(CryMonoBridge FORCE_SHARED_WIN PCH "StdAfx.cpp" SOLUTION_FOLDER "CryMono")
98 target_compile_options(${THIS_PROJECT} PRIVATE /EHsc /bigobj)
99 target_include_directories(${THIS_PROJECT} PRIVATE "${CRYENGINE_DIR}/Code/CryEngine/CryAction" )
101 # c# assembly generation should be uniform across all projects for 32 bit and 64 bit.
102 # Currently there are 4 other assemblies being generated
103 # 1. CryEngine.Common
105 # 3. CryEngine.Core.UI
106 # 4. CryEngine.Core.Tests
108 if (OPTION_CRYMONO_SWIG)
109 # Create the common mono assembly generation environment variables
110 create_mono_compiler_settings()
113 set(CMAKE_MODULE_LINKER_FLAGS_PROFILE ${CMAKE_SHARED_LINKER_FLAGS_PROFILE})
116 foreach(sourcefile ${SOURCES})
117 if ("${sourcefile}" MATCHES ".*\\.\\i$")
118 set(swig_inputs ${swig_inputs} "${sourcefile}")
120 if ("${sourcefile}" MATCHES ".*\\.\\swig$")
121 set(swig_globals ${swig_globals} "${sourcefile}")
125 set(SWIG_EXECUTABLE "${SDK_DIR}/swig/swig")
127 if (NOT PRODUCT_NAME)
128 set(PRODUCT_NAME ${THIS_PROJECT})
130 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${MONO_SWIG_OUTPUT_ASSEMBLY_NAME}_meta.cs"
131 "using System.Reflection;\n"
132 "using System.Runtime.CompilerServices;\n"
133 "[assembly: InternalsVisibleTo(\"CryEngine.Core\")]\n"
134 "[assembly: AssemblyProduct(\"${PRODUCT_NAME}\")]\n"
135 "[assembly: AssemblyTitle(\"${PRODUCT_NAME}\")]\n"
136 "[assembly: AssemblyDescription(\"${PRODUCT_NAME}\")]\n"
137 "[assembly: AssemblyVersion(\"${METADATA_VERSION}\")]\n"
138 "[assembly: AssemblyCompany(\"${METADATA_COMPANY}\")]\n"
139 "[assembly: AssemblyCopyright(\"${METADATA_COPYRIGHT}\")]\n"
142 set(mono_inputs "${CMAKE_CURRENT_BINARY_DIR}/${MONO_SWIG_OUTPUT_ASSEMBLY_NAME}_meta.cs")
144 foreach(f ${swig_inputs})
145 string(LENGTH "${f}" flen)
146 math(EXPR flen ${flen}-2)
147 string(SUBSTRING "${f}" 0 ${flen} basename)
148 file(RELATIVE_PATH bindir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
149 set(basename "${basename}")
150 set(f_cpp "${basename}.cpp")
151 set(f_cs "${basename}.cs")
152 set(f_h "${basename}.h")
154 set(defs -D_WIN32 -D_WIN64)
156 message(ERROR "Mono not supported on this platform")
159 get_target_property(target_defs ${THIS_PROJECT} COMPILE_DEFINITIONS)
160 foreach(d ${target_defs})
161 set(defs ${defs} -D${d})
163 set(defs ${defs} -D_MT -D_DLL -D_USRDLL)
165 get_filename_component(f_cs_dir "${f_cs}" DIRECTORY)
166 get_filename_component(f_cs_name "${f_cs}" NAME)
168 # Detect dependencies
170 COMMAND "${SWIG_EXECUTABLE}" -MM ${defs} -csharp "${f}"
171 OUTPUT_VARIABLE swig_deps
172 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
174 string(REGEX MATCHALL "\n [^ ][^ ][^ :]+" temp ${swig_deps})
177 string(STRIP "${t}" t)
178 set(swig_deps ${swig_deps} "${t}")
181 set(defs ${defs} -D_$<UPPER_CASE:$<CONFIG>> -D$<UPPER_CASE:$<CONFIG>>)
183 set(mono_inputs ${mono_inputs} "${f_cs}")
185 OUTPUT "${f_cpp}" "${f_h}" "${f_cs}"
186 COMMAND "${SWIG_EXECUTABLE}" -c++ ${defs} -DSWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR ${secondary_defs} -csharp -o "${bindir}/${f_cpp}" -outdir "${bindir}/${f_cs_dir}" -outfile "${f_cs_name}" -namespace ${MONO_SWIG_OUTPUT_ASSEMBLY_NAME} -pch-file "\\\"StdAfx.h\\\"" -fno-include-guards -dllimport ${THIS_PROJECT} "${f}"
187 MAIN_DEPENDENCY "${f}"
188 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
191 set_property(DIRECTORY "${CRYENGINE_DIR}" APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${swig_deps} "${CMAKE_CURRENT_SOURCE_DIR}/${f}")
192 set(secondary_defs -DSWIG_CXX_EXCLUDE_SWIG_INTERFACE_FUNCTIONS -DSWIG_CSHARP_EXCLUDE_STRING_HELPER -DSWIG_CSHARP_EXCLUDE_EXCEPTION_HELPER)
193 target_sources(${THIS_PROJECT} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${f_cpp}" "${CMAKE_CURRENT_BINARY_DIR}/${f_h}")
194 EXCLUDE_FILE_FROM_MSVC_PRECOMPILED_HEADER("${CMAKE_CURRENT_BINARY_DIR}/${f_cpp}")
195 source_group("Generated" FILES "${CMAKE_CURRENT_BINARY_DIR}/${f_cpp}" "${CMAKE_CURRENT_BINARY_DIR}/${f_h}")
196 set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/${f_h}" PROPERTIES HEADER_FILE_ONLY true GENERATED true)
200 TARGET ${THIS_PROJECT} PRE_LINK
201 COMMAND "${CSC_PATH}" /target:library /langversion:${MONO_LANGUAGE_VERSION} /platform:${MONO_CPU_PLATFORM} /optimize /debug:portable ${mono_inputs} /out:"${OUTPUT_DIRECTORY}/${MONO_SWIG_OUTPUT_ASSEMBLY_NAME}.dll"
202 DEPENDS ${mono_inputs}
203 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
208 target_include_directories(${THIS_PROJECT} PRIVATE "${SDK_DIR}/Mono/include/mono-2.0")
210 set_property(TARGET ${THIS_PROJECT} APPEND_STRING PROPERTY LINK_FLAGS " ${LIBPATH_FLAG}\"${SDK_DIR}/Mono/lib/x64\"")
211 target_link_libraries(${THIS_PROJECT} PRIVATE Shell32 libmono-static-sgen Mswsock Psapi Winmm version Shlwapi)