CMakeLists.txt 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187
  1. #
  2. # Copyright (c) 2006-2024 LOVE Development Team
  3. #
  4. # This software is provided 'as-is', without any express or implied
  5. # warranty. In no event will the authors be held liable for any damages
  6. # arising from the use of this software.
  7. #
  8. # Permission is granted to anyone to use this software for any purpose,
  9. # including commercial applications, and to alter it and redistribute it
  10. # freely, subject to the following restrictions:
  11. #
  12. # 1. The origin of this software must not be misrepresented; you must not
  13. # claim that you wrote the original software. If you use this software
  14. # in a product, an acknowledgment in the product documentation would be
  15. # appreciated but is not required.
  16. # 2. Altered source versions must be plainly marked as such, and must not be
  17. # misrepresented as being the original software.
  18. # 3. This notice may not be removed or altered from any source distribution.
  19. #
  20. if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
  21. # Protip: run cmake like this: cmake -G "<generator>" -H. -Bbuild
  22. message(FATAL_ERROR "Prevented in-tree build.")
  23. endif()
  24. cmake_minimum_required(VERSION 3.16)
  25. project(love)
  26. set(CMAKE_MODULE_PATH "${love_SOURCE_DIR}/extra/cmake" ${CMAKE_MODULE_PATH})
  27. set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) # Needed for shared libs on Linux. (-fPIC).
  28. set(CMAKE_CXX_STANDARD 17)
  29. set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Allow grouping projects in Visual Studio
  30. if(APPLE)
  31. message(WARNING "CMake is not an officially supported build system for love on Apple platforms.")
  32. message(WARNING "Use the prebuilt .app or the xcode project in platform/xcode/ instead.")
  33. endif()
  34. if(MINGW)
  35. message(WARNING "MinGW is not an officially supported build system for love.")
  36. message(WARNING "Use megasource with Visual Studio instead.")
  37. message(WARNING "Please see https://github.com/love2d/megasource")
  38. endif()
  39. include(LoveMacros)
  40. # Extract version.h contents.
  41. file(READ ${CMAKE_CURRENT_SOURCE_DIR}/src/common/version.h LOVE_VERSION_FILE_CONTENTS)
  42. # Extract one of LOVE_VERSION_MAJOR/MINOR/REV.
  43. function(match_version ARG_STRING OUT_VAR)
  44. string(REGEX MATCH "VERSION_${ARG_STRING} = ([0-9]+);" TMP_VER "${LOVE_VERSION_FILE_CONTENTS}")
  45. string(REGEX MATCH "[0-9]+" TMP_VER "${TMP_VER}")
  46. set(${OUT_VAR} ${TMP_VER} PARENT_SCOPE)
  47. endfunction()
  48. match_version("MAJOR" LOVE_VERSION_MAJOR)
  49. match_version("MINOR" LOVE_VERSION_MINOR)
  50. match_version("REV" LOVE_VERSION_REV)
  51. set(LOVE_VERSION_STR "${LOVE_VERSION_MAJOR}.${LOVE_VERSION_MINOR}")
  52. message(STATUS "Version: ${LOVE_VERSION_STR}")
  53. set(LOVE_EXE_NAME love CACHE STRING "The name of the executable, usually 'love'")
  54. set(LOVE_DEFAULT_LIB_NAME liblove)
  55. if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
  56. set(LOVE_DEFAULT_LIB_NAME "${LOVE_EXE_NAME}-${LOVE_VERSION_STR}")
  57. endif()
  58. set(LOVE_LIB_NAME ${LOVE_DEFAULT_LIB_NAME} CACHE STRING "The name of the lua library, usually 'liblove' or 'love'")
  59. set(LOVE_CONSOLE_EXE_NAME "${LOVE_EXE_NAME}c" CACHE STRING "The name of the console version of the executable, usually 'lovec'")
  60. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  61. set(LOVE_X64 TRUE)
  62. set(LOVE_TARGET_PLATFORM x64)
  63. else()
  64. set(LOVE_X86 TRUE)
  65. set(LOVE_TARGET_PLATFORM x86)
  66. endif()
  67. if(APPLE)
  68. set(LOVE_DEFAULT_JIT FALSE)
  69. else()
  70. set(LOVE_DEFAULT_JIT TRUE)
  71. endif()
  72. option(LOVE_JIT "Use LuaJIT" ${LOVE_DEFAULT_JIT})
  73. if(LOVE_JIT)
  74. if(APPLE)
  75. message(WARNING "JIT not supported yet on Mac.")
  76. endif()
  77. message(STATUS "LuaJIT: Enabled")
  78. else()
  79. message(STATUS "LuaJIT: Disabled")
  80. endif()
  81. message(STATUS "Target platform: ${LOVE_TARGET_PLATFORM}")
  82. add_library(lovedep::SDL INTERFACE IMPORTED)
  83. add_library(lovedep::Freetype INTERFACE IMPORTED)
  84. add_library(lovedep::Harfbuzz INTERFACE IMPORTED)
  85. add_library(lovedep::OpenAL INTERFACE IMPORTED)
  86. add_library(lovedep::Modplug INTERFACE IMPORTED)
  87. add_library(lovedep::Theora INTERFACE IMPORTED)
  88. add_library(lovedep::Vorbis INTERFACE IMPORTED)
  89. add_library(lovedep::Ogg INTERFACE IMPORTED)
  90. add_library(lovedep::Zlib INTERFACE IMPORTED)
  91. add_library(lovedep::Lua INTERFACE IMPORTED)
  92. if(MEGA)
  93. # LOVE_MSVC_DLLS contains runtime DLLs that should be bundled with the love
  94. # binary (in e.g. the installer). Example: msvcp140.dll.
  95. set(LOVE_MSVC_DLLS ${MEGA_MSVC_DLLS})
  96. if(APPLE)
  97. # Some files do #include <SDL2/SDL.h>, but building with megasource
  98. # requires #include <SDL.h>.
  99. add_definitions(-DLOVE_MACOSX_SDL_DIRECT_INCLUDE)
  100. endif ()
  101. # SDL2 links with some DirectX libraries, and we apparently also
  102. # pull those libraries in for linkage because we link with SDL2.
  103. set(LOVE_LINK_DIRS ${SDL_LINK_DIR})
  104. # These DLLs are moved next to the love binary in a post-build step to
  105. # love runnable from inside Visual Studio.
  106. #
  107. # LOVE_MOVE_DLLS can contain CMake targets, in which case the target's
  108. # output is assumed to be a DLL, or it can contain paths to actual files.
  109. # We detect whether or not each item is a target, and take the appropriate
  110. # action.
  111. set(LOVE_MOVE_DLLS
  112. ${MEGA_SDL2}
  113. ${MEGA_SDL3}
  114. ${MEGA_OPENAL}
  115. )
  116. # LOVE_EXTRA_DLLS are non-runtime DLLs which should be bundled with the
  117. # love binary in installers, etc. It's only needed for external
  118. # (non-CMake) targets, i.e. LuaJIT.
  119. if(NOT DEFINED LOVE_EXTRA_DLLS)
  120. set(LOVE_EXTRA_DLLS)
  121. endif()
  122. target_link_libraries(lovedep::SDL INTERFACE ${MEGA_SDL2} ${MEGA_SDL2MAIN} ${MEGA_SDL3})
  123. target_link_libraries(lovedep::Freetype INTERFACE ${MEGA_FREETYPE})
  124. target_link_libraries(lovedep::Harfbuzz INTERFACE ${MEGA_HARFBUZZ})
  125. target_link_libraries(lovedep::OpenAL INTERFACE ${MEGA_OPENAL})
  126. target_link_libraries(lovedep::Modplug INTERFACE ${MEGA_MODPLUG})
  127. target_link_libraries(lovedep::Theora INTERFACE ${MEGA_LIBTHEORA})
  128. target_link_libraries(lovedep::Vorbis INTERFACE ${MEGA_LIBVORBIS} ${MEGA_LIBVORBISFILE})
  129. target_link_libraries(lovedep::Ogg INTERFACE ${MEGA_LIBOGG})
  130. target_link_libraries(lovedep::Zlib INTERFACE ${MEGA_ZLIB})
  131. if(LOVE_JIT)
  132. target_include_directories(lovedep::Lua INTERFACE ${MEGA_LUAJIT_INCLUDE})
  133. target_link_libraries(lovedep::Lua INTERFACE ${MEGA_LUAJIT_LIB})
  134. set(LOVE_EXTRA_DLLS ${LOVE_EXTRA_DLLS} ${MEGA_LUAJIT_DLL})
  135. set(LOVE_EXTRA_DEPENDECIES luajit)
  136. set(LOVE_MOVE_DLLS
  137. ${LOVE_MOVE_DLLS}
  138. ${MEGA_LUAJIT_DLL}
  139. )
  140. else()
  141. # MEGA_LUA51 is a CMake target, so includes are handled
  142. # automatically.
  143. target_link_libraries(lovedep::Lua INTERFACE ${MEGA_LUA51})
  144. set(LOVE_MOVE_DLLS
  145. ${LOVE_MOVE_DLLS}
  146. ${MEGA_LUA51}
  147. )
  148. endif()
  149. else()
  150. if(MSVC OR ANDROID)
  151. message(FATAL_ERROR "
  152. It is currently only possible to build with megasource on Windows and Android.
  153. Please see https://github.com/love2d/megasource
  154. ")
  155. endif()
  156. # required for enet
  157. add_definitions(-D HAS_SOCKLEN_T)
  158. find_package(SDL2 2.0.9 REQUIRED CONFIG COMPONENTS SDL2main)
  159. target_include_directories(lovedep::SDL INTERFACE ${SDL2_INCLUDE_DIRS})
  160. target_link_libraries(lovedep::SDL INTERFACE ${SDL2_LIBRARIES})
  161. find_package(Freetype REQUIRED)
  162. target_include_directories(lovedep::Freetype INTERFACE ${FREETYPE_INCLUDE_DIRS})
  163. target_link_libraries(lovedep::Freetype INTERFACE ${FREETYPE_LIBRARY})
  164. find_package(Harfbuzz REQUIRED)
  165. target_include_directories(lovedep::Harfbuzz INTERFACE ${HARFBUZZ_INCLUDE_DIR})
  166. target_link_libraries(lovedep::Harfbuzz INTERFACE ${HARFBUZZ_LIBRARY})
  167. find_package(OpenAL REQUIRED)
  168. target_include_directories(lovedep::OpenAL INTERFACE ${OPENAL_INCLUDE_DIR})
  169. target_link_libraries(lovedep::OpenAL INTERFACE ${OPENAL_LIBRARY})
  170. find_package(ModPlug REQUIRED)
  171. target_include_directories(lovedep::Modplug INTERFACE ${MODPLUG_INCLUDE_DIR})
  172. target_link_libraries(lovedep::Modplug INTERFACE ${MODPLUG_LIBRARY})
  173. find_package(Theora REQUIRED)
  174. target_include_directories(lovedep::Theora INTERFACE ${THEORA_INCLUDE_DIR})
  175. target_link_libraries(lovedep::Theora INTERFACE ${THEORA_LIBRARY} ${THEORADEC_LIBRARY})
  176. find_package(Vorbis REQUIRED)
  177. target_include_directories(lovedep::Vorbis INTERFACE ${VORBIS_INCLUDE_DIR})
  178. target_link_libraries(lovedep::Vorbis INTERFACE ${VORBISFILE_LIBRARY})
  179. find_package(Ogg REQUIRED)
  180. target_include_directories(lovedep::Ogg INTERFACE ${OGG_INCLUDE_DIR})
  181. target_link_libraries(lovedep::Ogg INTERFACE ${OGG_LIBRARY})
  182. find_package(ZLIB REQUIRED)
  183. target_include_directories(lovedep::Zlib INTERFACE ${ZLIB_INCLUDE_DIRS})
  184. target_link_libraries(lovedep::Zlib INTERFACE ${ZLIB_LIBRARY})
  185. if(LOVE_JIT)
  186. find_package(LuaJIT REQUIRED)
  187. target_include_directories(lovedep::Lua INTERFACE ${LUAJIT_INCLUDE_DIR})
  188. target_link_libraries(lovedep::Lua INTERFACE ${LUAJIT_LIBRARY})
  189. else()
  190. find_package(Lua51 REQUIRED)
  191. target_include_directories(lovedep::Lua INTERFACE ${LUA_INCLUDE_DIR})
  192. target_link_libraries(lovedep::Lua INTERFACE ${LUA_LIBRARY})
  193. endif()
  194. endif()
  195. ###
  196. ### No Megasource-specific stuff beyond this point!
  197. ###
  198. if(MSVC)
  199. set(DISABLE_WARNING_FLAG -W0)
  200. else()
  201. set(DISABLE_WARNING_FLAG -w)
  202. endif()
  203. function(love_disable_warnings ARG_TARGET)
  204. target_compile_options(${ARG_TARGET} PRIVATE ${DISABLE_WARNING_FLAG})
  205. endfunction()
  206. #
  207. # common
  208. #
  209. add_library(love_common STATIC
  210. src/common/android.cpp
  211. src/common/android.h
  212. src/common/b64.cpp
  213. src/common/b64.h
  214. src/common/Color.h
  215. src/common/config.h
  216. src/common/Data.cpp
  217. src/common/Data.h
  218. src/common/delay.cpp
  219. src/common/delay.h
  220. src/common/deprecation.cpp
  221. src/common/deprecation.h
  222. src/common/EnumMap.h
  223. src/common/Exception.cpp
  224. src/common/Exception.h
  225. src/common/floattypes.cpp
  226. src/common/floattypes.h
  227. src/common/int.h
  228. src/common/math.h
  229. src/common/Matrix.cpp
  230. src/common/Matrix.h
  231. src/common/memory.cpp
  232. src/common/memory.h
  233. src/common/Module.cpp
  234. src/common/Module.h
  235. src/common/Object.cpp
  236. src/common/Object.h
  237. src/common/Optional.h
  238. src/common/pixelformat.cpp
  239. src/common/pixelformat.h
  240. src/common/Range.h
  241. src/common/Reference.cpp
  242. src/common/Reference.h
  243. src/common/runtime.cpp
  244. src/common/runtime.h
  245. src/common/Stream.cpp
  246. src/common/Stream.h
  247. src/common/StringMap.cpp
  248. src/common/StringMap.h
  249. src/common/types.cpp
  250. src/common/types.h
  251. src/common/utf8.cpp
  252. src/common/utf8.h
  253. src/common/Variant.cpp
  254. src/common/Variant.h
  255. #src/common/Vector.cpp # Vector.cpp is empty.
  256. src/common/Vector.h
  257. src/common/version.h
  258. )
  259. target_link_libraries(love_common PUBLIC
  260. lovedep::Lua
  261. lovedep::SDL
  262. )
  263. if (APPLE)
  264. target_sources(love_common PRIVATE
  265. src/common/apple.mm
  266. )
  267. target_link_libraries(love_common PUBLIC
  268. objc
  269. "-framework CoreFoundation"
  270. )
  271. if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
  272. target_sources(love_common PRIVATE
  273. src/common/macos.mm
  274. )
  275. target_link_libraries(love_common PUBLIC
  276. "-framework AppKit"
  277. )
  278. else()
  279. target_sources(love_common PRIVATE
  280. src/common/ios.mm
  281. )
  282. target_link_libraries(love_common PUBLIC
  283. "-framework UIKit"
  284. )
  285. endif()
  286. endif()
  287. #
  288. # love.audio
  289. #
  290. add_library(love_audio_root STATIC
  291. src/modules/audio/Audio.cpp
  292. src/modules/audio/Audio.h
  293. src/modules/audio/Source.cpp
  294. src/modules/audio/Source.h
  295. src/modules/audio/RecordingDevice.cpp
  296. src/modules/audio/RecordingDevice.h
  297. src/modules/audio/Filter.cpp
  298. src/modules/audio/Filter.h
  299. src/modules/audio/Effect.cpp
  300. src/modules/audio/Effect.h
  301. src/modules/audio/wrap_Audio.cpp
  302. src/modules/audio/wrap_Audio.h
  303. src/modules/audio/wrap_Source.cpp
  304. src/modules/audio/wrap_Source.h
  305. src/modules/audio/wrap_RecordingDevice.cpp
  306. src/modules/audio/wrap_RecordingDevice.h
  307. )
  308. target_link_libraries(love_audio_root PUBLIC
  309. lovedep::Lua
  310. lovedep::OpenAL
  311. )
  312. add_library(love_audio_null STATIC
  313. src/modules/audio/null/Audio.cpp
  314. src/modules/audio/null/Audio.h
  315. src/modules/audio/null/Source.cpp
  316. src/modules/audio/null/Source.h
  317. src/modules/audio/null/RecordingDevice.cpp
  318. src/modules/audio/null/RecordingDevice.h
  319. )
  320. add_library(love_audio_openal STATIC
  321. src/modules/audio/openal/Audio.cpp
  322. src/modules/audio/openal/Audio.h
  323. src/modules/audio/openal/Pool.cpp
  324. src/modules/audio/openal/Pool.h
  325. src/modules/audio/openal/Source.cpp
  326. src/modules/audio/openal/Source.h
  327. src/modules/audio/openal/RecordingDevice.cpp
  328. src/modules/audio/openal/RecordingDevice.h
  329. src/modules/audio/openal/Filter.cpp
  330. src/modules/audio/openal/Filter.h
  331. src/modules/audio/openal/Effect.cpp
  332. src/modules/audio/openal/Effect.h
  333. )
  334. target_link_libraries(love_audio_openal PUBLIC
  335. lovedep::OpenAL
  336. )
  337. add_library(love_audio INTERFACE)
  338. target_link_libraries(love_audio INTERFACE
  339. love_audio_root
  340. love_audio_null
  341. love_audio_openal
  342. )
  343. #
  344. # love.data
  345. #
  346. add_library(love_data STATIC
  347. src/modules/data/ByteData.cpp
  348. src/modules/data/ByteData.h
  349. src/modules/data/CompressedData.cpp
  350. src/modules/data/CompressedData.h
  351. src/modules/data/Compressor.cpp
  352. src/modules/data/Compressor.h
  353. src/modules/data/DataModule.cpp
  354. src/modules/data/DataModule.h
  355. src/modules/data/DataStream.cpp
  356. src/modules/data/DataStream.h
  357. src/modules/data/DataView.cpp
  358. src/modules/data/DataView.h
  359. src/modules/data/HashFunction.cpp
  360. src/modules/data/HashFunction.h
  361. src/modules/data/wrap_ByteData.cpp
  362. src/modules/data/wrap_ByteData.h
  363. src/modules/data/wrap_CompressedData.cpp
  364. src/modules/data/wrap_CompressedData.h
  365. src/modules/data/wrap_Data.cpp
  366. src/modules/data/wrap_Data.h
  367. src/modules/data/wrap_Data.lua
  368. src/modules/data/wrap_DataModule.cpp
  369. src/modules/data/wrap_DataModule.h
  370. src/modules/data/wrap_DataView.cpp
  371. src/modules/data/wrap_DataView.h
  372. )
  373. target_link_libraries(love_data PUBLIC
  374. lovedep::Lua
  375. lovedep::Zlib
  376. )
  377. #
  378. # love.event
  379. #
  380. add_library(love_event_root STATIC
  381. src/modules/event/Event.cpp
  382. src/modules/event/Event.h
  383. src/modules/event/wrap_Event.cpp
  384. src/modules/event/wrap_Event.h
  385. src/modules/event/wrap_Event.lua
  386. )
  387. target_link_libraries(love_event_root PUBLIC
  388. lovedep::Lua
  389. lovedep::SDL
  390. )
  391. add_library(love_event_sdl STATIC
  392. src/modules/event/sdl/Event.cpp
  393. src/modules/event/sdl/Event.h
  394. )
  395. target_link_libraries(love_event_sdl PUBLIC
  396. lovedep::SDL
  397. )
  398. add_library(love_event INTERFACE)
  399. target_link_libraries(love_event INTERFACE
  400. love_event_root
  401. love_event_sdl
  402. )
  403. #
  404. # love.filesystem
  405. #
  406. add_library(love_filesystem_root STATIC
  407. src/modules/filesystem/File.cpp
  408. src/modules/filesystem/File.h
  409. src/modules/filesystem/FileData.cpp
  410. src/modules/filesystem/FileData.h
  411. src/modules/filesystem/Filesystem.cpp
  412. src/modules/filesystem/Filesystem.h
  413. src/modules/filesystem/NativeFile.cpp
  414. src/modules/filesystem/NativeFile.h
  415. src/modules/filesystem/wrap_File.cpp
  416. src/modules/filesystem/wrap_File.h
  417. src/modules/filesystem/wrap_FileData.cpp
  418. src/modules/filesystem/wrap_FileData.h
  419. src/modules/filesystem/wrap_Filesystem.cpp
  420. src/modules/filesystem/wrap_Filesystem.h
  421. src/modules/filesystem/wrap_NativeFile.cpp
  422. src/modules/filesystem/wrap_NativeFile.h
  423. )
  424. target_link_libraries(love_filesystem_root PUBLIC
  425. lovedep::Lua
  426. lovedep::SDL
  427. )
  428. add_library(love_filesystem_physfs STATIC
  429. src/modules/filesystem/physfs/File.cpp
  430. src/modules/filesystem/physfs/File.h
  431. src/modules/filesystem/physfs/Filesystem.cpp
  432. src/modules/filesystem/physfs/Filesystem.h
  433. src/modules/filesystem/physfs/PhysfsIo.h
  434. src/modules/filesystem/physfs/PhysfsIo.cpp
  435. )
  436. if(ANDROID)
  437. target_link_libraries(love_filesystem_physfs PUBLIC
  438. lovedep::SDL
  439. )
  440. endif()
  441. add_library(love_filesystem INTERFACE)
  442. target_link_libraries(love_filesystem INTERFACE
  443. love_filesystem_root
  444. love_filesystem_physfs
  445. )
  446. #
  447. # love.font
  448. #
  449. add_library(love_font_root STATIC
  450. src/modules/font/BMFontRasterizer.cpp
  451. src/modules/font/BMFontRasterizer.h
  452. src/modules/font/Font.cpp
  453. src/modules/font/Font.h
  454. src/modules/font/GenericShaper.cpp
  455. src/modules/font/GenericShaper.h
  456. src/modules/font/GlyphData.cpp
  457. src/modules/font/GlyphData.h
  458. src/modules/font/ImageRasterizer.cpp
  459. src/modules/font/ImageRasterizer.h
  460. src/modules/font/Rasterizer.cpp
  461. src/modules/font/Rasterizer.h
  462. src/modules/font/TextShaper.cpp
  463. src/modules/font/TextShaper.h
  464. src/modules/font/TrueTypeRasterizer.cpp
  465. src/modules/font/TrueTypeRasterizer.h
  466. src/modules/font/wrap_Font.cpp
  467. src/modules/font/wrap_Font.h
  468. src/modules/font/wrap_GlyphData.cpp
  469. src/modules/font/wrap_GlyphData.h
  470. src/modules/font/wrap_Rasterizer.cpp
  471. src/modules/font/wrap_Rasterizer.h
  472. )
  473. target_link_libraries(love_font_root PUBLIC
  474. lovedep::Lua
  475. lovedep::Freetype
  476. )
  477. add_library(love_font_freetype STATIC
  478. src/modules/font/freetype/Font.cpp
  479. src/modules/font/freetype/Font.h
  480. src/modules/font/freetype/HarfbuzzShaper.cpp
  481. src/modules/font/freetype/HarfbuzzShaper.h
  482. src/modules/font/freetype/TrueTypeRasterizer.cpp
  483. src/modules/font/freetype/TrueTypeRasterizer.h
  484. )
  485. target_link_libraries(love_font_freetype PUBLIC
  486. lovedep::Freetype
  487. lovedep::Harfbuzz
  488. )
  489. add_library(love_font INTERFACE)
  490. target_link_libraries(love_font INTERFACE
  491. love_font_root
  492. love_font_freetype
  493. )
  494. #
  495. # love.graphics
  496. #
  497. add_library(love_graphics_root STATIC
  498. src/modules/graphics/Buffer.cpp
  499. src/modules/graphics/Buffer.h
  500. src/modules/graphics/Deprecations.cpp
  501. src/modules/graphics/Deprecations.h
  502. src/modules/graphics/Drawable.cpp
  503. src/modules/graphics/Drawable.h
  504. src/modules/graphics/Font.cpp
  505. src/modules/graphics/Font.h
  506. src/modules/graphics/Graphics.cpp
  507. src/modules/graphics/Graphics.h
  508. src/modules/graphics/GraphicsReadback.cpp
  509. src/modules/graphics/GraphicsReadback.h
  510. src/modules/graphics/Mesh.cpp
  511. src/modules/graphics/Mesh.h
  512. src/modules/graphics/ParticleSystem.cpp
  513. src/modules/graphics/ParticleSystem.h
  514. src/modules/graphics/Polyline.cpp
  515. src/modules/graphics/Polyline.h
  516. src/modules/graphics/Quad.cpp
  517. src/modules/graphics/Quad.h
  518. src/modules/graphics/renderstate.cpp
  519. src/modules/graphics/renderstate.h
  520. src/modules/graphics/Resource.h
  521. src/modules/graphics/Shader.cpp
  522. src/modules/graphics/Shader.h
  523. src/modules/graphics/ShaderStage.cpp
  524. src/modules/graphics/ShaderStage.h
  525. src/modules/graphics/SpriteBatch.cpp
  526. src/modules/graphics/SpriteBatch.h
  527. src/modules/graphics/StreamBuffer.cpp
  528. src/modules/graphics/StreamBuffer.h
  529. src/modules/graphics/TextBatch.cpp
  530. src/modules/graphics/TextBatch.h
  531. src/modules/graphics/Texture.cpp
  532. src/modules/graphics/Texture.h
  533. src/modules/graphics/vertex.cpp
  534. src/modules/graphics/vertex.h
  535. src/modules/graphics/Video.cpp
  536. src/modules/graphics/Video.h
  537. src/modules/graphics/Volatile.cpp
  538. src/modules/graphics/Volatile.h
  539. src/modules/graphics/wrap_Buffer.cpp
  540. src/modules/graphics/wrap_Buffer.h
  541. src/modules/graphics/wrap_Font.cpp
  542. src/modules/graphics/wrap_Font.h
  543. src/modules/graphics/wrap_Graphics.cpp
  544. src/modules/graphics/wrap_Graphics.h
  545. src/modules/graphics/wrap_Graphics.lua
  546. src/modules/graphics/wrap_GraphicsReadback.cpp
  547. src/modules/graphics/wrap_GraphicsReadback.h
  548. src/modules/graphics/wrap_Mesh.cpp
  549. src/modules/graphics/wrap_Mesh.h
  550. src/modules/graphics/wrap_ParticleSystem.cpp
  551. src/modules/graphics/wrap_ParticleSystem.h
  552. src/modules/graphics/wrap_Quad.cpp
  553. src/modules/graphics/wrap_Quad.h
  554. src/modules/graphics/wrap_Shader.cpp
  555. src/modules/graphics/wrap_Shader.h
  556. src/modules/graphics/wrap_SpriteBatch.cpp
  557. src/modules/graphics/wrap_SpriteBatch.h
  558. src/modules/graphics/wrap_Texture.cpp
  559. src/modules/graphics/wrap_Texture.h
  560. src/modules/graphics/wrap_TextBatch.cpp
  561. src/modules/graphics/wrap_TextBatch.h
  562. src/modules/graphics/wrap_Video.cpp
  563. src/modules/graphics/wrap_Video.h
  564. src/modules/graphics/wrap_Video.lua
  565. )
  566. target_link_libraries(love_graphics_root PUBLIC
  567. lovedep::Lua
  568. )
  569. add_library(love_graphics_opengl STATIC
  570. src/modules/graphics/opengl/Buffer.cpp
  571. src/modules/graphics/opengl/Buffer.h
  572. src/modules/graphics/opengl/FenceSync.cpp
  573. src/modules/graphics/opengl/FenceSync.h
  574. src/modules/graphics/opengl/Graphics.cpp
  575. src/modules/graphics/opengl/Graphics.h
  576. src/modules/graphics/opengl/GraphicsReadback.cpp
  577. src/modules/graphics/opengl/GraphicsReadback.h
  578. src/modules/graphics/opengl/OpenGL.cpp
  579. src/modules/graphics/opengl/OpenGL.h
  580. src/modules/graphics/opengl/Shader.cpp
  581. src/modules/graphics/opengl/Shader.h
  582. src/modules/graphics/opengl/ShaderStage.cpp
  583. src/modules/graphics/opengl/ShaderStage.h
  584. src/modules/graphics/opengl/StreamBuffer.cpp
  585. src/modules/graphics/opengl/StreamBuffer.h
  586. src/modules/graphics/opengl/Texture.cpp
  587. src/modules/graphics/opengl/Texture.h
  588. )
  589. target_link_libraries(love_graphics_opengl PUBLIC
  590. lovedep::SDL
  591. )
  592. add_library(love_graphics INTERFACE)
  593. target_link_libraries(love_graphics INTERFACE
  594. love_graphics_root
  595. love_graphics_opengl
  596. )
  597. if(APPLE)
  598. add_library(love_graphics_metal STATIC
  599. src/modules/graphics/metal/Buffer.h
  600. src/modules/graphics/metal/Buffer.mm
  601. src/modules/graphics/metal/Graphics.h
  602. src/modules/graphics/metal/Graphics.mm
  603. src/modules/graphics/metal/GraphicsReadback.h
  604. src/modules/graphics/metal/GraphicsReadback.mm
  605. src/modules/graphics/metal/Metal.h
  606. src/modules/graphics/metal/Metal.mm
  607. src/modules/graphics/metal/Shader.h
  608. src/modules/graphics/metal/Shader.mm
  609. src/modules/graphics/metal/ShaderStage.h
  610. src/modules/graphics/metal/ShaderStage.mm
  611. src/modules/graphics/metal/StreamBuffer.h
  612. src/modules/graphics/metal/StreamBuffer.mm
  613. src/modules/graphics/metal/Texture.h
  614. src/modules/graphics/metal/Texture.mm
  615. )
  616. target_link_libraries(love_graphics_metal PUBLIC
  617. objc
  618. "-framework Metal"
  619. "-framework QuartzCore"
  620. )
  621. target_link_libraries(love_graphics INTERFACE
  622. love_graphics_metal
  623. )
  624. else()
  625. add_library(love_graphics_vulkan STATIC
  626. src/modules/graphics/vulkan/Graphics.h
  627. src/modules/graphics/vulkan/Graphics.cpp
  628. src/modules/graphics/vulkan/GraphicsReadback.h
  629. src/modules/graphics/vulkan/GraphicsReadback.cpp
  630. src/modules/graphics/vulkan/Shader.h
  631. src/modules/graphics/vulkan/Shader.cpp
  632. src/modules/graphics/vulkan/ShaderStage.h
  633. src/modules/graphics/vulkan/ShaderStage.cpp
  634. src/modules/graphics/vulkan/StreamBuffer.h
  635. src/modules/graphics/vulkan/StreamBuffer.cpp
  636. src/modules/graphics/vulkan/Buffer.h
  637. src/modules/graphics/vulkan/Buffer.cpp
  638. src/modules/graphics/vulkan/Texture.h
  639. src/modules/graphics/vulkan/Texture.cpp
  640. src/modules/graphics/vulkan/Vulkan.h
  641. src/modules/graphics/vulkan/Vulkan.cpp
  642. src/modules/graphics/vulkan/VulkanWrapper.h
  643. )
  644. target_link_libraries(love_graphics_vulkan PUBLIC
  645. lovedep::SDL
  646. )
  647. target_link_libraries(love_graphics INTERFACE
  648. love_graphics_vulkan
  649. )
  650. endif()
  651. #
  652. # love.image
  653. #
  654. add_library(love_image_root STATIC
  655. src/modules/image/CompressedImageData.cpp
  656. src/modules/image/CompressedImageData.h
  657. src/modules/image/CompressedSlice.cpp
  658. src/modules/image/CompressedSlice.h
  659. src/modules/image/FormatHandler.cpp
  660. src/modules/image/FormatHandler.h
  661. src/modules/image/Image.cpp
  662. src/modules/image/Image.h
  663. src/modules/image/ImageData.cpp
  664. src/modules/image/ImageData.h
  665. src/modules/image/ImageDataBase.cpp
  666. src/modules/image/ImageDataBase.h
  667. src/modules/image/wrap_CompressedImageData.cpp
  668. src/modules/image/wrap_CompressedImageData.h
  669. src/modules/image/wrap_Image.cpp
  670. src/modules/image/wrap_Image.h
  671. src/modules/image/wrap_ImageData.cpp
  672. src/modules/image/wrap_ImageData.h
  673. src/modules/image/wrap_ImageData.lua
  674. )
  675. target_link_libraries(love_image_root PUBLIC
  676. lovedep::Lua
  677. )
  678. add_library(love_image_magpie STATIC
  679. src/modules/image/magpie/ASTCHandler.cpp
  680. src/modules/image/magpie/ASTCHandler.h
  681. src/modules/image/magpie/ddsHandler.cpp
  682. src/modules/image/magpie/ddsHandler.h
  683. src/modules/image/magpie/EXRHandler.cpp
  684. src/modules/image/magpie/EXRHandler.h
  685. src/modules/image/magpie/KTXHandler.cpp
  686. src/modules/image/magpie/KTXHandler.h
  687. src/modules/image/magpie/PKMHandler.cpp
  688. src/modules/image/magpie/PKMHandler.h
  689. src/modules/image/magpie/PNGHandler.cpp
  690. src/modules/image/magpie/PNGHandler.h
  691. src/modules/image/magpie/PVRHandler.cpp
  692. src/modules/image/magpie/PVRHandler.h
  693. src/modules/image/magpie/STBHandler.cpp
  694. src/modules/image/magpie/STBHandler.h
  695. )
  696. target_link_libraries(love_image_magpie PUBLIC
  697. lovedep::Zlib
  698. )
  699. add_library(love_image INTERFACE)
  700. target_link_libraries(love_image INTERFACE
  701. love_image_root
  702. love_image_magpie
  703. )
  704. #
  705. # love.joystick
  706. #
  707. add_library(love_joystick_root STATIC
  708. src/modules/joystick/Joystick.cpp
  709. src/modules/joystick/Joystick.h
  710. src/modules/joystick/JoystickModule.h
  711. src/modules/joystick/wrap_Joystick.cpp
  712. src/modules/joystick/wrap_Joystick.h
  713. src/modules/joystick/wrap_JoystickModule.cpp
  714. src/modules/joystick/wrap_JoystickModule.h
  715. )
  716. target_link_libraries(love_joystick_root PUBLIC
  717. lovedep::Lua
  718. )
  719. add_library(love_joystick_sdl STATIC
  720. src/modules/joystick/sdl/Joystick.cpp
  721. src/modules/joystick/sdl/Joystick.h
  722. src/modules/joystick/sdl/JoystickSDL3.cpp
  723. src/modules/joystick/sdl/JoystickSDL3.h
  724. src/modules/joystick/sdl/JoystickModule.cpp
  725. src/modules/joystick/sdl/JoystickModule.h
  726. )
  727. target_link_libraries(love_joystick_sdl PUBLIC
  728. lovedep::SDL
  729. )
  730. add_library(love_joystick INTERFACE)
  731. target_link_libraries(love_joystick INTERFACE
  732. love_joystick_root
  733. love_joystick_sdl
  734. )
  735. #
  736. # love.keyboard
  737. #
  738. add_library(love_keyboard_root STATIC
  739. src/modules/keyboard/Keyboard.cpp
  740. src/modules/keyboard/Keyboard.h
  741. src/modules/keyboard/wrap_Keyboard.cpp
  742. src/modules/keyboard/wrap_Keyboard.h
  743. )
  744. target_link_libraries(love_keyboard_root PUBLIC
  745. lovedep::Lua
  746. lovedep::SDL
  747. )
  748. add_library(love_keyboard_sdl STATIC
  749. src/modules/keyboard/sdl/Keyboard.cpp
  750. src/modules/keyboard/sdl/Keyboard.h
  751. )
  752. target_link_libraries(love_keyboard_sdl PUBLIC
  753. lovedep::SDL
  754. )
  755. add_library(love_keyboard INTERFACE)
  756. target_link_libraries(love_keyboard INTERFACE
  757. love_keyboard_root
  758. love_keyboard_sdl
  759. )
  760. #
  761. # love.math
  762. #
  763. add_library(love_math STATIC
  764. src/modules/math/BezierCurve.cpp
  765. src/modules/math/BezierCurve.h
  766. src/modules/math/MathModule.cpp
  767. src/modules/math/MathModule.h
  768. src/modules/math/RandomGenerator.cpp
  769. src/modules/math/RandomGenerator.h
  770. src/modules/math/Transform.cpp
  771. src/modules/math/Transform.h
  772. src/modules/math/wrap_BezierCurve.cpp
  773. src/modules/math/wrap_BezierCurve.h
  774. src/modules/math/wrap_Math.cpp
  775. src/modules/math/wrap_Math.h
  776. src/modules/math/wrap_Math.lua
  777. src/modules/math/wrap_RandomGenerator.cpp
  778. src/modules/math/wrap_RandomGenerator.h
  779. src/modules/math/wrap_RandomGenerator.lua
  780. src/modules/math/wrap_Transform.cpp
  781. src/modules/math/wrap_Transform.h
  782. )
  783. target_link_libraries(love_math PUBLIC
  784. lovedep::Lua
  785. )
  786. #
  787. # love.mouse
  788. #
  789. add_library(love_mouse_root STATIC
  790. src/modules/mouse/Cursor.cpp
  791. src/modules/mouse/Cursor.h
  792. src/modules/mouse/Mouse.h
  793. src/modules/mouse/wrap_Cursor.cpp
  794. src/modules/mouse/wrap_Cursor.h
  795. src/modules/mouse/wrap_Mouse.cpp
  796. src/modules/mouse/wrap_Mouse.h
  797. )
  798. target_link_libraries(love_mouse_root PUBLIC
  799. lovedep::Lua
  800. lovedep::SDL
  801. )
  802. add_library(love_mouse_sdl STATIC
  803. src/modules/mouse/sdl/Cursor.cpp
  804. src/modules/mouse/sdl/Cursor.h
  805. src/modules/mouse/sdl/Mouse.cpp
  806. src/modules/mouse/sdl/Mouse.h
  807. )
  808. target_link_libraries(love_mouse_sdl PUBLIC
  809. lovedep::SDL
  810. )
  811. add_library(love_mouse INTERFACE)
  812. target_link_libraries(love_mouse INTERFACE
  813. love_mouse_root
  814. love_mouse_sdl
  815. )
  816. #
  817. # love.physics
  818. #
  819. add_library(love_physics_root STATIC
  820. src/modules/physics/Body.cpp
  821. src/modules/physics/Body.h
  822. src/modules/physics/Joint.cpp
  823. src/modules/physics/Joint.h
  824. src/modules/physics/Shape.cpp
  825. src/modules/physics/Shape.h
  826. )
  827. add_library(love_physics_box2d STATIC
  828. src/modules/physics/box2d/Body.cpp
  829. src/modules/physics/box2d/Body.h
  830. src/modules/physics/box2d/ChainShape.cpp
  831. src/modules/physics/box2d/ChainShape.h
  832. src/modules/physics/box2d/CircleShape.cpp
  833. src/modules/physics/box2d/CircleShape.h
  834. src/modules/physics/box2d/Contact.cpp
  835. src/modules/physics/box2d/Contact.h
  836. src/modules/physics/box2d/DistanceJoint.cpp
  837. src/modules/physics/box2d/DistanceJoint.h
  838. src/modules/physics/box2d/EdgeShape.cpp
  839. src/modules/physics/box2d/EdgeShape.h
  840. src/modules/physics/box2d/FrictionJoint.cpp
  841. src/modules/physics/box2d/FrictionJoint.h
  842. src/modules/physics/box2d/GearJoint.cpp
  843. src/modules/physics/box2d/GearJoint.h
  844. src/modules/physics/box2d/Joint.cpp
  845. src/modules/physics/box2d/Joint.h
  846. src/modules/physics/box2d/MotorJoint.cpp
  847. src/modules/physics/box2d/MotorJoint.h
  848. src/modules/physics/box2d/MouseJoint.cpp
  849. src/modules/physics/box2d/MouseJoint.h
  850. src/modules/physics/box2d/Physics.cpp
  851. src/modules/physics/box2d/Physics.h
  852. src/modules/physics/box2d/PolygonShape.cpp
  853. src/modules/physics/box2d/PolygonShape.h
  854. src/modules/physics/box2d/PrismaticJoint.cpp
  855. src/modules/physics/box2d/PrismaticJoint.h
  856. src/modules/physics/box2d/PulleyJoint.cpp
  857. src/modules/physics/box2d/PulleyJoint.h
  858. src/modules/physics/box2d/RevoluteJoint.cpp
  859. src/modules/physics/box2d/RevoluteJoint.h
  860. src/modules/physics/box2d/RopeJoint.cpp
  861. src/modules/physics/box2d/RopeJoint.h
  862. src/modules/physics/box2d/Shape.cpp
  863. src/modules/physics/box2d/Shape.h
  864. src/modules/physics/box2d/WeldJoint.cpp
  865. src/modules/physics/box2d/WeldJoint.h
  866. src/modules/physics/box2d/WheelJoint.cpp
  867. src/modules/physics/box2d/WheelJoint.h
  868. src/modules/physics/box2d/World.cpp
  869. src/modules/physics/box2d/World.h
  870. src/modules/physics/box2d/wrap_Body.cpp
  871. src/modules/physics/box2d/wrap_Body.h
  872. src/modules/physics/box2d/wrap_ChainShape.cpp
  873. src/modules/physics/box2d/wrap_ChainShape.h
  874. src/modules/physics/box2d/wrap_CircleShape.cpp
  875. src/modules/physics/box2d/wrap_CircleShape.h
  876. src/modules/physics/box2d/wrap_Contact.cpp
  877. src/modules/physics/box2d/wrap_Contact.h
  878. src/modules/physics/box2d/wrap_DistanceJoint.cpp
  879. src/modules/physics/box2d/wrap_DistanceJoint.h
  880. src/modules/physics/box2d/wrap_EdgeShape.cpp
  881. src/modules/physics/box2d/wrap_EdgeShape.h
  882. src/modules/physics/box2d/wrap_FrictionJoint.cpp
  883. src/modules/physics/box2d/wrap_FrictionJoint.h
  884. src/modules/physics/box2d/wrap_GearJoint.cpp
  885. src/modules/physics/box2d/wrap_GearJoint.h
  886. src/modules/physics/box2d/wrap_Joint.cpp
  887. src/modules/physics/box2d/wrap_Joint.h
  888. src/modules/physics/box2d/wrap_MotorJoint.cpp
  889. src/modules/physics/box2d/wrap_MotorJoint.h
  890. src/modules/physics/box2d/wrap_MouseJoint.cpp
  891. src/modules/physics/box2d/wrap_MouseJoint.h
  892. src/modules/physics/box2d/wrap_Physics.cpp
  893. src/modules/physics/box2d/wrap_Physics.h
  894. src/modules/physics/box2d/wrap_PolygonShape.cpp
  895. src/modules/physics/box2d/wrap_PolygonShape.h
  896. src/modules/physics/box2d/wrap_PrismaticJoint.cpp
  897. src/modules/physics/box2d/wrap_PrismaticJoint.h
  898. src/modules/physics/box2d/wrap_PulleyJoint.cpp
  899. src/modules/physics/box2d/wrap_PulleyJoint.h
  900. src/modules/physics/box2d/wrap_RevoluteJoint.cpp
  901. src/modules/physics/box2d/wrap_RevoluteJoint.h
  902. src/modules/physics/box2d/wrap_RopeJoint.cpp
  903. src/modules/physics/box2d/wrap_RopeJoint.h
  904. src/modules/physics/box2d/wrap_Shape.cpp
  905. src/modules/physics/box2d/wrap_Shape.h
  906. src/modules/physics/box2d/wrap_WeldJoint.cpp
  907. src/modules/physics/box2d/wrap_WeldJoint.h
  908. src/modules/physics/box2d/wrap_WheelJoint.cpp
  909. src/modules/physics/box2d/wrap_WheelJoint.h
  910. src/modules/physics/box2d/wrap_World.cpp
  911. src/modules/physics/box2d/wrap_World.h
  912. )
  913. target_link_libraries(love_physics_box2d PUBLIC
  914. lovedep::Lua
  915. )
  916. add_library(love_physics INTERFACE)
  917. target_link_libraries(love_physics INTERFACE
  918. love_physics_root
  919. love_physics_box2d
  920. )
  921. #
  922. # love.sensor
  923. #
  924. add_library(love_sensor_root STATIC
  925. src/modules/sensor/Sensor.cpp
  926. src/modules/sensor/Sensor.h
  927. src/modules/sensor/wrap_Sensor.cpp
  928. src/modules/sensor/wrap_Sensor.h
  929. )
  930. target_link_libraries(love_sensor_root PUBLIC
  931. lovedep::Lua
  932. lovedep::SDL
  933. )
  934. add_library(love_sensor_sdl STATIC
  935. src/modules/sensor/sdl/Sensor.cpp
  936. src/modules/sensor/sdl/Sensor.h
  937. )
  938. target_link_libraries(love_sensor_sdl PUBLIC
  939. lovedep::SDL
  940. )
  941. add_library(love_sensor INTERFACE)
  942. target_link_libraries(love_sensor INTERFACE
  943. love_sensor_root
  944. love_sensor_sdl
  945. )
  946. #
  947. # love.sound
  948. #
  949. add_library(love_sound_root STATIC
  950. src/modules/sound/Decoder.cpp
  951. src/modules/sound/Decoder.h
  952. src/modules/sound/Sound.cpp
  953. src/modules/sound/Sound.h
  954. src/modules/sound/SoundData.cpp
  955. src/modules/sound/SoundData.h
  956. src/modules/sound/wrap_Decoder.cpp
  957. src/modules/sound/wrap_Decoder.h
  958. src/modules/sound/wrap_Sound.cpp
  959. src/modules/sound/wrap_Sound.h
  960. src/modules/sound/wrap_SoundData.cpp
  961. src/modules/sound/wrap_SoundData.h
  962. src/modules/sound/wrap_SoundData.lua
  963. )
  964. target_link_libraries(love_sound_root PUBLIC
  965. lovedep::Lua
  966. )
  967. add_library(love_sound_lullaby STATIC
  968. src/modules/sound/lullaby/FLACDecoder.cpp
  969. src/modules/sound/lullaby/FLACDecoder.h
  970. src/modules/sound/lullaby/ModPlugDecoder.cpp
  971. src/modules/sound/lullaby/ModPlugDecoder.h
  972. src/modules/sound/lullaby/MP3Decoder.h
  973. src/modules/sound/lullaby/MP3Decoder.cpp
  974. src/modules/sound/lullaby/Sound.cpp
  975. src/modules/sound/lullaby/Sound.h
  976. src/modules/sound/lullaby/VorbisDecoder.cpp
  977. src/modules/sound/lullaby/VorbisDecoder.h
  978. src/modules/sound/lullaby/WaveDecoder.cpp
  979. src/modules/sound/lullaby/WaveDecoder.h
  980. )
  981. target_link_libraries(love_sound_lullaby PUBLIC
  982. lovedep::Modplug
  983. lovedep::Vorbis
  984. lovedep::Ogg
  985. )
  986. add_library(love_sound INTERFACE)
  987. target_link_libraries(love_sound INTERFACE
  988. love_sound_root
  989. love_sound_lullaby
  990. )
  991. #
  992. # love.system
  993. #
  994. add_library(love_system_root STATIC
  995. src/modules/system/System.cpp
  996. src/modules/system/System.h
  997. src/modules/system/wrap_System.cpp
  998. src/modules/system/wrap_System.h
  999. )
  1000. target_link_libraries(love_system_root PUBLIC
  1001. lovedep::Lua
  1002. lovedep::SDL
  1003. )
  1004. add_library(love_system_sdl STATIC
  1005. src/modules/system/sdl/System.cpp
  1006. src/modules/system/sdl/System.h
  1007. )
  1008. target_link_libraries(love_system_sdl PUBLIC
  1009. lovedep::SDL
  1010. )
  1011. add_library(love_system INTERFACE)
  1012. target_link_libraries(love_system INTERFACE
  1013. love_system_root
  1014. love_system_sdl
  1015. )
  1016. #
  1017. # love.thread
  1018. #
  1019. add_library(love_thread_root STATIC
  1020. src/modules/thread/Channel.cpp
  1021. src/modules/thread/Channel.h
  1022. src/modules/thread/LuaThread.cpp
  1023. src/modules/thread/LuaThread.h
  1024. src/modules/thread/Thread.h
  1025. src/modules/thread/ThreadModule.cpp
  1026. src/modules/thread/ThreadModule.h
  1027. src/modules/thread/threads.cpp
  1028. src/modules/thread/threads.h
  1029. src/modules/thread/wrap_Channel.cpp
  1030. src/modules/thread/wrap_Channel.h
  1031. src/modules/thread/wrap_LuaThread.cpp
  1032. src/modules/thread/wrap_LuaThread.h
  1033. src/modules/thread/wrap_ThreadModule.cpp
  1034. src/modules/thread/wrap_ThreadModule.h
  1035. )
  1036. target_link_libraries(love_thread_root PUBLIC
  1037. lovedep::Lua
  1038. )
  1039. add_library(love_thread_sdl STATIC
  1040. src/modules/thread/sdl/Thread.cpp
  1041. src/modules/thread/sdl/Thread.h
  1042. src/modules/thread/sdl/threads.cpp
  1043. src/modules/thread/sdl/threads.h
  1044. )
  1045. target_link_libraries(love_thread_sdl PUBLIC
  1046. lovedep::SDL
  1047. )
  1048. add_library(love_thread INTERFACE)
  1049. target_link_libraries(love_thread INTERFACE
  1050. love_thread_root
  1051. love_thread_sdl
  1052. )
  1053. #
  1054. # love.timer
  1055. #
  1056. add_library(love_timer STATIC
  1057. src/modules/timer/Timer.cpp
  1058. src/modules/timer/Timer.h
  1059. src/modules/timer/wrap_Timer.cpp
  1060. src/modules/timer/wrap_Timer.h
  1061. )
  1062. target_link_libraries(love_timer PUBLIC
  1063. lovedep::Lua
  1064. )
  1065. #
  1066. # love.touch
  1067. #
  1068. add_library(love_touch_root STATIC
  1069. src/modules/touch/Touch.h
  1070. src/modules/touch/wrap_Touch.cpp
  1071. src/modules/touch/wrap_Touch.h
  1072. )
  1073. target_link_libraries(love_touch_root PUBLIC
  1074. lovedep::Lua
  1075. lovedep::SDL
  1076. )
  1077. add_library(love_touch_sdl STATIC
  1078. src/modules/touch/sdl/Touch.cpp
  1079. src/modules/touch/sdl/Touch.h
  1080. )
  1081. target_link_libraries(love_touch_sdl PUBLIC
  1082. lovedep::SDL
  1083. )
  1084. add_library(love_touch INTERFACE)
  1085. target_link_libraries(love_touch INTERFACE
  1086. love_touch_root
  1087. love_touch_sdl
  1088. )
  1089. #
  1090. # love.video
  1091. #
  1092. add_library(love_video_root STATIC
  1093. src/modules/video/Video.h
  1094. src/modules/video/VideoStream.cpp
  1095. src/modules/video/VideoStream.h
  1096. src/modules/video/wrap_Video.cpp
  1097. src/modules/video/wrap_Video.h
  1098. src/modules/video/wrap_VideoStream.cpp
  1099. src/modules/video/wrap_VideoStream.h
  1100. )
  1101. target_link_libraries(love_video_root PUBLIC
  1102. lovedep::Lua
  1103. lovedep::Theora
  1104. lovedep::Ogg
  1105. )
  1106. add_library(love_video_theora STATIC
  1107. src/modules/video/theora/Video.cpp
  1108. src/modules/video/theora/Video.h
  1109. src/modules/video/theora/OggDemuxer.cpp
  1110. src/modules/video/theora/OggDemuxer.h
  1111. src/modules/video/theora/TheoraVideoStream.cpp
  1112. src/modules/video/theora/TheoraVideoStream.h
  1113. )
  1114. target_link_libraries(love_video_theora PUBLIC
  1115. lovedep::Theora
  1116. lovedep::Ogg
  1117. )
  1118. add_library(love_video INTERFACE)
  1119. target_link_libraries(love_video INTERFACE
  1120. love_video_root
  1121. love_video_theora
  1122. )
  1123. #
  1124. # love.window
  1125. #
  1126. add_library(love_window_root STATIC
  1127. src/modules/window/Window.cpp
  1128. src/modules/window/Window.h
  1129. src/modules/window/wrap_Window.cpp
  1130. src/modules/window/wrap_Window.h
  1131. )
  1132. target_link_libraries(love_window_root PUBLIC
  1133. lovedep::Lua
  1134. lovedep::SDL
  1135. )
  1136. add_library(love_window_sdl STATIC
  1137. src/modules/window/sdl/Window.cpp
  1138. src/modules/window/sdl/Window.h
  1139. )
  1140. target_link_libraries(love_window_sdl PUBLIC
  1141. lovedep::SDL
  1142. )
  1143. add_library(love_window INTERFACE)
  1144. target_link_libraries(love_window INTERFACE
  1145. love_window_root
  1146. love_window_sdl
  1147. )
  1148. ###################################
  1149. # Third-party libraries
  1150. ###################################
  1151. #
  1152. # Box2D
  1153. #
  1154. add_library(love_3p_box2d
  1155. src/libraries/box2d/Box2D.h
  1156. src/libraries/box2d/collision/b2_broad_phase.cpp
  1157. src/libraries/box2d/collision/b2_chain_shape.cpp
  1158. src/libraries/box2d/collision/b2_circle_shape.cpp
  1159. src/libraries/box2d/collision/b2_collide_circle.cpp
  1160. src/libraries/box2d/collision/b2_collide_edge.cpp
  1161. src/libraries/box2d/collision/b2_collide_polygon.cpp
  1162. src/libraries/box2d/collision/b2_collision.cpp
  1163. src/libraries/box2d/collision/b2_distance.cpp
  1164. src/libraries/box2d/collision/b2_dynamic_tree.cpp
  1165. src/libraries/box2d/collision/b2_edge_shape.cpp
  1166. src/libraries/box2d/collision/b2_polygon_shape.cpp
  1167. src/libraries/box2d/collision/b2_time_of_impact.cpp
  1168. src/libraries/box2d/common/b2_block_allocator.cpp
  1169. src/libraries/box2d/common/b2_draw.cpp
  1170. src/libraries/box2d/common/b2_math.cpp
  1171. src/libraries/box2d/common/b2_settings.cpp
  1172. src/libraries/box2d/common/b2_stack_allocator.cpp
  1173. src/libraries/box2d/common/b2_timer.cpp
  1174. src/libraries/box2d/dynamics/b2_body.cpp
  1175. src/libraries/box2d/dynamics/b2_chain_circle_contact.cpp
  1176. src/libraries/box2d/dynamics/b2_chain_circle_contact.h
  1177. src/libraries/box2d/dynamics/b2_chain_polygon_contact.cpp
  1178. src/libraries/box2d/dynamics/b2_chain_polygon_contact.h
  1179. src/libraries/box2d/dynamics/b2_circle_contact.cpp
  1180. src/libraries/box2d/dynamics/b2_circle_contact.h
  1181. src/libraries/box2d/dynamics/b2_contact.cpp
  1182. src/libraries/box2d/dynamics/b2_contact_manager.cpp
  1183. src/libraries/box2d/dynamics/b2_contact_solver.cpp
  1184. src/libraries/box2d/dynamics/b2_contact_solver.h
  1185. src/libraries/box2d/dynamics/b2_distance_joint.cpp
  1186. src/libraries/box2d/dynamics/b2_edge_circle_contact.cpp
  1187. src/libraries/box2d/dynamics/b2_edge_circle_contact.h
  1188. src/libraries/box2d/dynamics/b2_edge_polygon_contact.cpp
  1189. src/libraries/box2d/dynamics/b2_edge_polygon_contact.h
  1190. src/libraries/box2d/dynamics/b2_fixture.cpp
  1191. src/libraries/box2d/dynamics/b2_friction_joint.cpp
  1192. src/libraries/box2d/dynamics/b2_gear_joint.cpp
  1193. src/libraries/box2d/dynamics/b2_island.cpp
  1194. src/libraries/box2d/dynamics/b2_island.h
  1195. src/libraries/box2d/dynamics/b2_joint.cpp
  1196. src/libraries/box2d/dynamics/b2_motor_joint.cpp
  1197. src/libraries/box2d/dynamics/b2_mouse_joint.cpp
  1198. src/libraries/box2d/dynamics/b2_polygon_circle_contact.cpp
  1199. src/libraries/box2d/dynamics/b2_polygon_circle_contact.h
  1200. src/libraries/box2d/dynamics/b2_polygon_contact.cpp
  1201. src/libraries/box2d/dynamics/b2_polygon_contact.h
  1202. src/libraries/box2d/dynamics/b2_prismatic_joint.cpp
  1203. src/libraries/box2d/dynamics/b2_pulley_joint.cpp
  1204. src/libraries/box2d/dynamics/b2_revolute_joint.cpp
  1205. src/libraries/box2d/dynamics/b2_weld_joint.cpp
  1206. src/libraries/box2d/dynamics/b2_wheel_joint.cpp
  1207. src/libraries/box2d/dynamics/b2_world.cpp
  1208. src/libraries/box2d/dynamics/b2_world_callbacks.cpp
  1209. src/libraries/box2d/rope/b2_rope.cpp
  1210. )
  1211. love_disable_warnings(love_3p_box2d)
  1212. #
  1213. # ddsparse
  1214. #
  1215. add_library(love_3p_ddsparse
  1216. src/libraries/ddsparse/ddsinfo.h
  1217. src/libraries/ddsparse/ddsparse.cpp
  1218. src/libraries/ddsparse/ddsparse.h
  1219. )
  1220. #
  1221. # dr_flac
  1222. #
  1223. # dr_flac has no implementation files of its own.
  1224. #add_library(love_3p_drflac
  1225. # src/libraries/dr/dr_flac.h
  1226. #)
  1227. #
  1228. # dr_mp3
  1229. #
  1230. # dr_mp3 has no implementation files of its own.
  1231. #add_library(love_3p_drmp3
  1232. # src/libraries/dr/dr_mp3.h
  1233. #)
  1234. #
  1235. # enet
  1236. #
  1237. add_library(love_3p_enet
  1238. src/libraries/enet/enet.cpp
  1239. src/libraries/enet/lua-enet.h
  1240. src/libraries/enet/libenet/callbacks.c
  1241. src/libraries/enet/libenet/compress.c
  1242. src/libraries/enet/libenet/host.c
  1243. src/libraries/enet/libenet/list.c
  1244. src/libraries/enet/libenet/packet.c
  1245. src/libraries/enet/libenet/peer.c
  1246. src/libraries/enet/libenet/protocol.c
  1247. src/libraries/enet/libenet/unix.c
  1248. src/libraries/enet/libenet/win32.c
  1249. src/libraries/enet/libenet/include/enet/enet.h
  1250. src/libraries/enet/libenet/include/enet/list.h
  1251. src/libraries/enet/libenet/include/enet/protocol.h
  1252. src/libraries/enet/libenet/include/enet/time.h
  1253. src/libraries/enet/libenet/include/enet/types.h
  1254. src/libraries/enet/libenet/include/enet/unix.h
  1255. src/libraries/enet/libenet/include/enet/utility.h
  1256. src/libraries/enet/libenet/include/enet/win32.h
  1257. )
  1258. love_disable_warnings(love_3p_enet)
  1259. target_link_libraries(love_3p_enet lovedep::Lua)
  1260. target_include_directories(love_3p_enet PUBLIC src/libraries/enet/libenet/include)
  1261. if(MINGW)
  1262. target_link_libraries(love_3p_enet winmm.a)
  1263. endif()
  1264. #
  1265. # GLAD
  1266. #
  1267. add_library(love_3p_glad
  1268. src/libraries/glad/glad.cpp
  1269. src/libraries/glad/glad.hpp
  1270. src/libraries/glad/gladfuncs.hpp
  1271. )
  1272. #
  1273. # glslang
  1274. #
  1275. add_library(love_3p_glslang
  1276. src/libraries/glslang/glslang/build_info.h
  1277. src/libraries/glslang/glslang/GenericCodeGen/CodeGen.cpp
  1278. src/libraries/glslang/glslang/GenericCodeGen/Link.cpp
  1279. src/libraries/glslang/glslang/Include/arrays.h
  1280. src/libraries/glslang/glslang/Include/BaseTypes.h
  1281. src/libraries/glslang/glslang/Include/Common.h
  1282. src/libraries/glslang/glslang/Include/ConstantUnion.h
  1283. src/libraries/glslang/glslang/Include/InfoSink.h
  1284. src/libraries/glslang/glslang/Include/InitializeGlobals.h
  1285. src/libraries/glslang/glslang/Include/intermediate.h
  1286. src/libraries/glslang/glslang/Include/PoolAlloc.h
  1287. src/libraries/glslang/glslang/Include/ResourceLimits.h
  1288. src/libraries/glslang/glslang/Include/ShHandle.h
  1289. src/libraries/glslang/glslang/Include/SpirvIntrinsics.h
  1290. src/libraries/glslang/glslang/Include/Types.h
  1291. src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
  1292. src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp
  1293. src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp
  1294. src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h
  1295. src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
  1296. src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
  1297. src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h
  1298. src/libraries/glslang/glslang/MachineIndependent/attribute.cpp
  1299. src/libraries/glslang/glslang/MachineIndependent/attribute.h
  1300. src/libraries/glslang/glslang/MachineIndependent/Constant.cpp
  1301. src/libraries/glslang/glslang/MachineIndependent/gl_types.h
  1302. src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp
  1303. src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
  1304. src/libraries/glslang/glslang/MachineIndependent/InfoSink.cpp
  1305. src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp
  1306. src/libraries/glslang/glslang/MachineIndependent/Initialize.h
  1307. src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp
  1308. src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp
  1309. src/libraries/glslang/glslang/MachineIndependent/IntermTraverse.cpp
  1310. src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp
  1311. src/libraries/glslang/glslang/MachineIndependent/iomapper.h
  1312. src/libraries/glslang/glslang/MachineIndependent/limits.cpp
  1313. src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp
  1314. src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h
  1315. src/libraries/glslang/glslang/MachineIndependent/localintermediate.h
  1316. src/libraries/glslang/glslang/MachineIndependent/parseConst.cpp
  1317. src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp
  1318. src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp
  1319. src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h
  1320. src/libraries/glslang/glslang/MachineIndependent/parseVersions.h
  1321. src/libraries/glslang/glslang/MachineIndependent/pch.h
  1322. src/libraries/glslang/glslang/MachineIndependent/PoolAlloc.cpp
  1323. src/libraries/glslang/glslang/MachineIndependent/propagateNoContraction.cpp
  1324. src/libraries/glslang/glslang/MachineIndependent/propagateNoContraction.h
  1325. src/libraries/glslang/glslang/MachineIndependent/reflection.cpp
  1326. src/libraries/glslang/glslang/MachineIndependent/reflection.h
  1327. src/libraries/glslang/glslang/MachineIndependent/RemoveTree.cpp
  1328. src/libraries/glslang/glslang/MachineIndependent/RemoveTree.h
  1329. src/libraries/glslang/glslang/MachineIndependent/Scan.cpp
  1330. src/libraries/glslang/glslang/MachineIndependent/Scan.h
  1331. src/libraries/glslang/glslang/MachineIndependent/ScanContext.h
  1332. src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp
  1333. src/libraries/glslang/glslang/MachineIndependent/span.h
  1334. src/libraries/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
  1335. src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp
  1336. src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h
  1337. src/libraries/glslang/glslang/MachineIndependent/Versions.cpp
  1338. src/libraries/glslang/glslang/MachineIndependent/Versions.h
  1339. src/libraries/glslang/glslang/OSDependent/osinclude.h
  1340. src/libraries/glslang/glslang/Public/ResourceLimits.h
  1341. src/libraries/glslang/glslang/Public/ShaderLang.h
  1342. src/libraries/glslang/glslang/ResourceLimits/ResourceLimits.cpp
  1343. src/libraries/glslang/SPIRV/bitutils.h
  1344. src/libraries/glslang/SPIRV/disassemble.cpp
  1345. src/libraries/glslang/SPIRV/disassemble.h
  1346. src/libraries/glslang/SPIRV/doc.cpp
  1347. src/libraries/glslang/SPIRV/doc.h
  1348. src/libraries/glslang/SPIRV/GLSL.ext.AMD.h
  1349. src/libraries/glslang/SPIRV/GLSL.ext.ARM.h
  1350. src/libraries/glslang/SPIRV/GLSL.ext.EXT.h
  1351. src/libraries/glslang/SPIRV/GLSL.ext.KHR.h
  1352. src/libraries/glslang/SPIRV/GLSL.ext.NV.h
  1353. src/libraries/glslang/SPIRV/GLSL.ext.QCOM.h
  1354. src/libraries/glslang/SPIRV/GLSL.std.450.h
  1355. src/libraries/glslang/SPIRV/GlslangToSpv.cpp
  1356. src/libraries/glslang/SPIRV/GlslangToSpv.h
  1357. src/libraries/glslang/SPIRV/hex_float.h
  1358. src/libraries/glslang/SPIRV/InReadableOrder.cpp
  1359. src/libraries/glslang/SPIRV/Logger.cpp
  1360. src/libraries/glslang/SPIRV/Logger.h
  1361. src/libraries/glslang/SPIRV/NonSemanticDebugPrintf.h
  1362. src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo100.h
  1363. src/libraries/glslang/SPIRV/spirv.hpp
  1364. src/libraries/glslang/SPIRV/SpvBuilder.cpp
  1365. src/libraries/glslang/SPIRV/SpvBuilder.h
  1366. src/libraries/glslang/SPIRV/spvIR.h
  1367. src/libraries/glslang/SPIRV/SpvPostProcess.cpp
  1368. src/libraries/glslang/SPIRV/SPVRemapper.cpp
  1369. src/libraries/glslang/SPIRV/SPVRemapper.h
  1370. src/libraries/glslang/SPIRV/SpvTools.cpp
  1371. src/libraries/glslang/SPIRV/SpvTools.h
  1372. )
  1373. if(MSVC OR MINGW)
  1374. target_sources(love_3p_glslang PRIVATE
  1375. src/libraries/glslang/glslang/OSDependent/Windows/ossource.cpp
  1376. )
  1377. else()
  1378. target_sources(love_3p_glslang PRIVATE
  1379. src/libraries/glslang/glslang/OSDependent/Unix/ossource.cpp
  1380. )
  1381. endif()
  1382. #
  1383. # LodePNG
  1384. #
  1385. add_library(love_3p_lodepng
  1386. src/libraries/lodepng/lodepng.cpp
  1387. src/libraries/lodepng/lodepng.h
  1388. )
  1389. #
  1390. # luasocket
  1391. #
  1392. if(MINGW)
  1393. set(WIN32_LIB_EXT .a)
  1394. else()
  1395. set(WIN32_LIB_EXT .lib)
  1396. endif()
  1397. add_library(love_3p_luasocket
  1398. src/libraries/luasocket/luasocket.cpp
  1399. src/libraries/luasocket/luasocket.h
  1400. src/libraries/luasocket/libluasocket/auxiliar.c
  1401. src/libraries/luasocket/libluasocket/auxiliar.h
  1402. src/libraries/luasocket/libluasocket/buffer.c
  1403. src/libraries/luasocket/libluasocket/buffer.h
  1404. src/libraries/luasocket/libluasocket/compat.c
  1405. src/libraries/luasocket/libluasocket/compat.h
  1406. src/libraries/luasocket/libluasocket/except.c
  1407. src/libraries/luasocket/libluasocket/except.h
  1408. src/libraries/luasocket/libluasocket/ftp.lua.h
  1409. src/libraries/luasocket/libluasocket/headers.lua.h
  1410. src/libraries/luasocket/libluasocket/http.lua.h
  1411. src/libraries/luasocket/libluasocket/inet.c
  1412. src/libraries/luasocket/libluasocket/inet.h
  1413. src/libraries/luasocket/libluasocket/io.c
  1414. src/libraries/luasocket/libluasocket/io.h
  1415. src/libraries/luasocket/libluasocket/ltn12.lua.h
  1416. src/libraries/luasocket/libluasocket/luasocket.c
  1417. src/libraries/luasocket/libluasocket/luasocket.h
  1418. src/libraries/luasocket/libluasocket/mbox.lua.h
  1419. src/libraries/luasocket/libluasocket/mime.c
  1420. src/libraries/luasocket/libluasocket/mime.h
  1421. src/libraries/luasocket/libluasocket/mime.lua.h
  1422. src/libraries/luasocket/libluasocket/options.c
  1423. src/libraries/luasocket/libluasocket/options.h
  1424. src/libraries/luasocket/libluasocket/pierror.h
  1425. src/libraries/luasocket/libluasocket/select.c
  1426. src/libraries/luasocket/libluasocket/select.h
  1427. src/libraries/luasocket/libluasocket/smtp.lua.h
  1428. src/libraries/luasocket/libluasocket/socket.h
  1429. src/libraries/luasocket/libluasocket/socket.lua.h
  1430. src/libraries/luasocket/libluasocket/tcp.c
  1431. src/libraries/luasocket/libluasocket/tcp.h
  1432. src/libraries/luasocket/libluasocket/timeout.c
  1433. src/libraries/luasocket/libluasocket/timeout.h
  1434. src/libraries/luasocket/libluasocket/tp.lua.h
  1435. src/libraries/luasocket/libluasocket/udp.c
  1436. src/libraries/luasocket/libluasocket/udp.h
  1437. src/libraries/luasocket/libluasocket/url.lua.h
  1438. src/libraries/luasocket/libluasocket/unix.c
  1439. src/libraries/luasocket/libluasocket/unix.h
  1440. src/libraries/luasocket/libluasocket/unixdgram.c
  1441. src/libraries/luasocket/libluasocket/unixdgram.h
  1442. src/libraries/luasocket/libluasocket/unixstream.c
  1443. src/libraries/luasocket/libluasocket/unixstream.h
  1444. )
  1445. target_link_libraries(love_3p_luasocket lovedep::Lua)
  1446. love_disable_warnings(love_3p_luasocket)
  1447. if(MSVC OR MINGW)
  1448. target_sources(love_3p_luasocket PRIVATE
  1449. src/libraries/luasocket/libluasocket/wsocket.c
  1450. src/libraries/luasocket/libluasocket/wsocket.h
  1451. )
  1452. target_link_libraries(love_3p_luasocket
  1453. ws2_32${WIN32_LIB_EXT}
  1454. )
  1455. else()
  1456. target_sources(love_3p_luasocket PRIVATE
  1457. src/libraries/luasocket/libluasocket/serial.c
  1458. src/libraries/luasocket/libluasocket/usocket.c
  1459. src/libraries/luasocket/libluasocket/usocket.h
  1460. )
  1461. endif()
  1462. #
  1463. # APIs from Lua 5.3
  1464. #
  1465. add_library(love_3p_lua53
  1466. src/libraries/lua53/lprefix.h
  1467. src/libraries/lua53/lstrlib.c
  1468. src/libraries/lua53/lstrlib.h
  1469. src/libraries/lua53/lutf8lib.c
  1470. src/libraries/lua53/lutf8lib.h
  1471. )
  1472. target_link_libraries(love_3p_lua53 lovedep::Lua)
  1473. #
  1474. # Lua HTTPS
  1475. #
  1476. add_library(love_3p_luahttps
  1477. # These are platform-dependent but have ifdef guards to make sure they only
  1478. # compile on supported platforms.
  1479. src/libraries/luahttps/src/android/AndroidClient.cpp
  1480. src/libraries/luahttps/src/android/AndroidClient.h
  1481. src/libraries/luahttps/src/common/config.h
  1482. src/libraries/luahttps/src/common/Connection.h
  1483. src/libraries/luahttps/src/common/ConnectionClient.h
  1484. src/libraries/luahttps/src/common/HTTPRequest.cpp
  1485. src/libraries/luahttps/src/common/HTTPRequest.h
  1486. src/libraries/luahttps/src/common/HTTPS.cpp
  1487. src/libraries/luahttps/src/common/HTTPS.h
  1488. src/libraries/luahttps/src/common/HTTPSClient.cpp
  1489. src/libraries/luahttps/src/common/HTTPSClient.h
  1490. src/libraries/luahttps/src/common/LibraryLoader.h
  1491. src/libraries/luahttps/src/common/PlaintextConnection.cpp
  1492. src/libraries/luahttps/src/common/PlaintextConnection.h
  1493. src/libraries/luahttps/src/generic/CurlClient.cpp
  1494. src/libraries/luahttps/src/generic/CurlClient.h
  1495. src/libraries/luahttps/src/generic/LinktimeLibraryLoader.cpp
  1496. src/libraries/luahttps/src/generic/OpenSSLConnection.cpp
  1497. src/libraries/luahttps/src/generic/OpenSSLConnection.h
  1498. src/libraries/luahttps/src/generic/UnixLibraryLoader.cpp
  1499. src/libraries/luahttps/src/lua/main.cpp
  1500. src/libraries/luahttps/src/windows/SChannelConnection.cpp
  1501. src/libraries/luahttps/src/windows/SChannelConnection.h
  1502. src/libraries/luahttps/src/windows/WindowsLibraryLoader.cpp
  1503. src/libraries/luahttps/src/windows/WinINetClient.cpp
  1504. src/libraries/luahttps/src/windows/WinINetClient.h
  1505. )
  1506. target_link_libraries(love_3p_luahttps lovedep::Lua)
  1507. if (APPLE)
  1508. target_sources(love_3p_luahttps PRIVATE
  1509. src/libraries/luahttps/src/apple/NSURLClient.mm
  1510. src/libraries/luahttps/src/apple/NSURLClient.h
  1511. )
  1512. target_compile_options(love_3p_luahttps PRIVATE -fobjc-arc)
  1513. endif()
  1514. if(MSVC)
  1515. target_link_libraries(love_3p_luahttps
  1516. ws2_32
  1517. secur32
  1518. )
  1519. if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
  1520. target_link_libraries(love_3p_luahttps
  1521. wininet
  1522. )
  1523. endif()
  1524. endif()
  1525. #
  1526. # lz4
  1527. #
  1528. add_library(love_3p_lz4
  1529. src/libraries/lz4/lz4.c
  1530. src/libraries/lz4/lz4.h
  1531. src/libraries/lz4/lz4hc.c
  1532. src/libraries/lz4/lz4hc.h
  1533. src/libraries/lz4/lz4opt.h
  1534. )
  1535. #
  1536. # noise1234
  1537. #
  1538. add_library(love_3p_noise1234
  1539. src/libraries/noise1234/noise1234.cpp
  1540. src/libraries/noise1234/noise1234.h
  1541. src/libraries/noise1234/simplexnoise1234.cpp
  1542. src/libraries/noise1234/simplexnoise1234.h
  1543. )
  1544. #
  1545. # physfs
  1546. #
  1547. add_library(love_3p_physfs
  1548. src/libraries/physfs/physfs_archiver_7z.c
  1549. src/libraries/physfs/physfs_archiver_dir.c
  1550. src/libraries/physfs/physfs_archiver_grp.c
  1551. src/libraries/physfs/physfs_archiver_hog.c
  1552. src/libraries/physfs/physfs_archiver_iso9660.c
  1553. src/libraries/physfs/physfs_archiver_mvl.c
  1554. src/libraries/physfs/physfs_archiver_qpak.c
  1555. src/libraries/physfs/physfs_archiver_slb.c
  1556. src/libraries/physfs/physfs_archiver_unpacked.c
  1557. src/libraries/physfs/physfs_archiver_vdf.c
  1558. src/libraries/physfs/physfs_archiver_wad.c
  1559. src/libraries/physfs/physfs_archiver_zip.c
  1560. src/libraries/physfs/physfs_byteorder.c
  1561. src/libraries/physfs/physfs_casefolding.h
  1562. src/libraries/physfs/physfs_internal.h
  1563. src/libraries/physfs/physfs_lzmasdk.h
  1564. src/libraries/physfs/physfs_miniz.h
  1565. src/libraries/physfs/physfs_platform_android.c
  1566. src/libraries/physfs/physfs_platform_haiku.cpp
  1567. src/libraries/physfs/physfs_platform_os2.c
  1568. src/libraries/physfs/physfs_platform_posix.c
  1569. src/libraries/physfs/physfs_platform_qnx.c
  1570. src/libraries/physfs/physfs_platform_unix.c
  1571. src/libraries/physfs/physfs_platform_windows.c
  1572. src/libraries/physfs/physfs_platform_winrt.cpp
  1573. src/libraries/physfs/physfs_platforms.h
  1574. src/libraries/physfs/physfs_unicode.c
  1575. src/libraries/physfs/physfs.c
  1576. src/libraries/physfs/physfs.h
  1577. )
  1578. love_disable_warnings(love_3p_physfs)
  1579. if(APPLE)
  1580. target_sources(love_3p_physfs PRIVATE
  1581. src/libraries/physfs/physfs_platform_apple.m
  1582. )
  1583. target_link_libraries(love_3p_physfs INTERFACE
  1584. "-framework IOKit"
  1585. )
  1586. endif()
  1587. #
  1588. # spirv_cross
  1589. #
  1590. add_library(love_3p_spirv_cross
  1591. src/libraries/spirv_cross/GLSL.std.450.h
  1592. src/libraries/spirv_cross/spirv_cfg.cpp
  1593. src/libraries/spirv_cross/spirv_cfg.hpp
  1594. src/libraries/spirv_cross/spirv_common.hpp
  1595. src/libraries/spirv_cross/spirv_cpp.cpp
  1596. src/libraries/spirv_cross/spirv_cpp.hpp
  1597. src/libraries/spirv_cross/spirv_cross_containers.hpp
  1598. src/libraries/spirv_cross/spirv_cross_error_handling.hpp
  1599. src/libraries/spirv_cross/spirv_cross_parsed_ir.cpp
  1600. src/libraries/spirv_cross/spirv_cross_parsed_ir.hpp
  1601. src/libraries/spirv_cross/spirv_cross_util.cpp
  1602. src/libraries/spirv_cross/spirv_cross_util.hpp
  1603. src/libraries/spirv_cross/spirv_cross.cpp
  1604. src/libraries/spirv_cross/spirv_cross.hpp
  1605. src/libraries/spirv_cross/spirv_glsl.cpp
  1606. src/libraries/spirv_cross/spirv_glsl.hpp
  1607. src/libraries/spirv_cross/spirv_hlsl.cpp
  1608. src/libraries/spirv_cross/spirv_hlsl.hpp
  1609. src/libraries/spirv_cross/spirv_msl.cpp
  1610. src/libraries/spirv_cross/spirv_msl.hpp
  1611. src/libraries/spirv_cross/spirv_parser.cpp
  1612. src/libraries/spirv_cross/spirv_parser.hpp
  1613. src/libraries/spirv_cross/spirv_reflect.cpp
  1614. src/libraries/spirv_cross/spirv_reflect.hpp
  1615. src/libraries/spirv_cross/spirv.hpp
  1616. )
  1617. #
  1618. # stb_image
  1619. #
  1620. # stb_image has no implementation files of its own.
  1621. #add_library(love_3p_stb
  1622. # src/libraries/stb/stb_image.h
  1623. #)
  1624. #
  1625. # tiny exr
  1626. #
  1627. # tinyexr has no implementation files of its own.
  1628. #add_library(love_3p_tinyexr
  1629. # src/libraries/tinyexr/tinyexr.h
  1630. #)
  1631. #
  1632. # utf8
  1633. #
  1634. # This library is all headers ... so there is no need to
  1635. # add_library() here.
  1636. #add_library(love_3p_utf8
  1637. # src/libraries/utf8/utf8.h
  1638. # src/libraries/utf8/utf8/checked.h
  1639. # src/libraries/utf8/utf8/core.h
  1640. # src/libraries/utf8/utf8/unchecked.h
  1641. #)
  1642. #
  1643. # vma
  1644. #
  1645. # vulkan memory allocatory has no implementation files of its own.
  1646. #add_library(love_3p_vma
  1647. # src/libraries/vma/vk_mem_alloc.h
  1648. #)
  1649. #
  1650. # volk
  1651. #
  1652. # since we don't want to use the system vulkan header files we need to
  1653. # compile this library in the löve source code using VOLK_IMPLEMENTATION.
  1654. #add_library(love_3p_volk
  1655. # src/libraries/volk/volk.h
  1656. # src/libraries/volk/volk.c)
  1657. #
  1658. # vulkan headers
  1659. #
  1660. # vulkan headers has no implementation files of its own.
  1661. #add_library(love_3p_vulkan_headers
  1662. # src/libraries/vulkanheaders/vk_icd.h
  1663. # src/libraries/vulkanheaders/vk_layer.h
  1664. # src/libraries/vulkanheaders/vk_platform.h
  1665. # src/libraries/vulkanheaders/vk_sdk-platform.h
  1666. # src/libraries/vulkanheaders/vulkan_android.h
  1667. # src/libraries/vulkanheaders/vulkan_beta.h
  1668. # src/libraries/vulkanheaders/vulkan_core.h
  1669. # src/libraries/vulkanheaders/vulkan_directfb.h
  1670. # src/libraries/vulkanheaders/vulkan_enums.hpp
  1671. # src/libraries/vulkanheaders/vulkan_format_traits.hpp
  1672. # src/libraries/vulkanheaders/vulkan_fuchsia.h
  1673. # src/libraries/vulkanheaders/vulkan_funcs.h
  1674. # src/libraries/vulkanheaders/vulkan_ggp.h
  1675. # src/libraries/vulkanheaders/vulkan_handles.h
  1676. # src/libraries/vulkanheaders/vulkan_hash.hpp
  1677. # src/libraries/vulkanheaders/vulkan_ios.h
  1678. # src/libraries/vulkanheaders/vulkan_macos.h
  1679. # src/libraries/vulkanheaders/vulkan_metal.h
  1680. # src/libraries/vulkanheaders/vulkan_raii.hpp
  1681. # src/libraries/vulkanheaders/vulkan_screen.h
  1682. # src/libraries/vulkanheaders/vulkan_static_assertions.h
  1683. # src/libraries/vulkanheaders/vulkan_structs.hpp
  1684. # src/libraries/vulkanheaders/vulkan_to_string.h
  1685. # src/libraries/vulkanheaders/vulkan_vi.h
  1686. # src/libraries/vulkanheaders/vulkan_wayland.h
  1687. # src/libraries/vulkanheaders/vulkan_win32.h
  1688. # src/libraries/vulkanheaders/vulkan_xcb.h
  1689. # src/libraries/vulkanheaders/vulkan_xlib_xrandr.h
  1690. # src/libraries/vulkanheaders/vulkan_xlib.h
  1691. # src/libraries/vulkanheaders/vulkan.h
  1692. # src/libraries/vulkanheaders/vulkan.hpp
  1693. #)
  1694. #
  1695. # Wuff
  1696. #
  1697. add_library(love_3p_wuff
  1698. src/libraries/Wuff/wuff.c
  1699. src/libraries/Wuff/wuff.h
  1700. src/libraries/Wuff/wuff_config.h
  1701. src/libraries/Wuff/wuff_convert.c
  1702. src/libraries/Wuff/wuff_convert.h
  1703. src/libraries/Wuff/wuff_internal.c
  1704. src/libraries/Wuff/wuff_internal.h
  1705. src/libraries/Wuff/wuff_memory.c
  1706. )
  1707. #
  1708. # xxHash
  1709. #
  1710. add_library(love_3p_xxhash
  1711. src/libraries/xxHash/xxhash.c
  1712. src/libraries/xxHash/xxhash.h
  1713. )
  1714. #
  1715. # liblove
  1716. #
  1717. include_directories(
  1718. BEFORE
  1719. src
  1720. src/libraries
  1721. src/libraries/box2D
  1722. src/modules
  1723. )
  1724. link_directories(${LOVE_LINK_DIRS})
  1725. if(MINGW)
  1726. # UTF-16 flags passed to windres. windres invokes gcc as preprocessor
  1727. # -> gcc outputs utf8, so windres must read-in codepage 65001 (utf8)
  1728. set(CMAKE_RC_FLAGS ${CMAKE_RC_FLAGS} "-c 65001 --preprocessor-arg=-finput-charset=UTF-16LE")
  1729. endif()
  1730. add_library(liblove SHARED
  1731. src/modules/love/love.cpp
  1732. src/modules/love/love.h
  1733. # These are here so they show up in Visual Studio:
  1734. src/modules/love/arg.lua
  1735. src/modules/love/boot.lua
  1736. src/modules/love/callbacks.lua
  1737. src/modules/love/jitsetup.lua
  1738. src/scripts/nogame.lua
  1739. )
  1740. set_target_properties(liblove PROPERTIES
  1741. C_VISIBILITY_PRESET hidden
  1742. CXX_VISIBILITY_PRESET hidden
  1743. VISIBILITY_INLINES_HIDDEN ON
  1744. LIBRARY_OUTPUT_NAME "${LOVE_LIB_NAME}")
  1745. set(LIBLOVE_DEPENDENCIES
  1746. love_common
  1747. love_audio
  1748. love_data
  1749. love_event
  1750. love_filesystem
  1751. love_font
  1752. love_graphics
  1753. love_image
  1754. love_joystick
  1755. love_keyboard
  1756. love_math
  1757. love_mouse
  1758. love_physics
  1759. love_sensor
  1760. love_sound
  1761. love_system
  1762. love_thread
  1763. love_timer
  1764. love_touch
  1765. love_video
  1766. love_window
  1767. )
  1768. set(LIBLOVE_LIBRARIES
  1769. love_3p_box2d
  1770. love_3p_ddsparse
  1771. love_3p_enet
  1772. love_3p_glad
  1773. love_3p_glslang
  1774. love_3p_lodepng
  1775. love_3p_luasocket
  1776. love_3p_lua53
  1777. love_3p_luahttps
  1778. love_3p_lz4
  1779. love_3p_noise1234
  1780. love_3p_physfs
  1781. love_3p_spirv_cross
  1782. love_3p_wuff
  1783. love_3p_xxhash
  1784. )
  1785. target_link_libraries(liblove ${LIBLOVE_DEPENDENCIES} ${LIBLOVE_LIBRARIES})
  1786. if(LOVE_EXTRA_DEPENDECIES)
  1787. add_dependencies(liblove ${LOVE_EXTRA_DEPENDECIES})
  1788. endif()
  1789. #
  1790. # Group projects in Visual Studio
  1791. #
  1792. love_group_projects(NAME "liblove" NESTED TARGETS ${LIBLOVE_DEPENDENCIES})
  1793. love_group_projects(NAME "liblove/libraries" NESTED TARGETS ${LIBLOVE_LIBRARIES})
  1794. love_group_projects(NAME "liblove" TARGETS liblove ${LOVE_EXTRA_DEPENDECIES})
  1795. love_group_projects(NAME "lovedep" TARGETS lovedep::SDL2 lovedep::Freetype lovedep::Harfbuzz lovedep::OpenAL lovedep::Modplug lovedep::Theora lovedep::Vorbis lovedep::Ogg lovedep::Zlib lovedep::Lua)
  1796. love_group_projects(NAME "lovedep" TARGETS lua51 alcommon al-excommon harfbuzz-subset zlib)
  1797. if(MSVC)
  1798. set_target_properties(liblove PROPERTIES RELEASE_OUTPUT_NAME "love" PDB_NAME "liblove" IMPORT_PREFIX "lib")
  1799. set_target_properties(liblove PROPERTIES DEBUG_OUTPUT_NAME "love" PDB_NAME "liblove" IMPORT_PREFIX "lib")
  1800. endif()
  1801. if(MSVC OR MINGW)
  1802. target_link_libraries(liblove
  1803. ws2_32${WIN32_LIB_EXT}
  1804. winmm${WIN32_LIB_EXT}
  1805. dwmapi${WIN32_LIB_EXT}
  1806. )
  1807. target_sources(liblove PUBLIC
  1808. extra/windows/love.rc
  1809. extra/windows/love.ico
  1810. )
  1811. endif()
  1812. #
  1813. # love (executable)
  1814. #
  1815. if(ANDROID)
  1816. add_library(love SHARED) # On Android, the LOVE main entrypoint needs to be compiled as shared library
  1817. target_link_libraries(liblove android)
  1818. else()
  1819. add_executable(love WIN32)
  1820. endif()
  1821. target_sources(love PRIVATE src/love.cpp)
  1822. target_link_libraries(love liblove)
  1823. set_target_properties(love PROPERTIES
  1824. C_VISIBILITY_PRESET hidden
  1825. CXX_VISIBILITY_PRESET hidden
  1826. VISIBILITY_INLINES_HIDDEN ON
  1827. OUTPUT_NAME ${LOVE_EXE_NAME})
  1828. if(MSVC OR MINGW)
  1829. add_executable(lovec src/love.cpp)
  1830. target_link_libraries(lovec liblove)
  1831. set_target_properties(lovec PROPERTIES
  1832. OUTPUT_NAME ${LOVE_CONSOLE_EXE_NAME})
  1833. endif()
  1834. function(post_step_move_dll ARG_POST_TARGET ARG_TARGET_OR_FILE)
  1835. if(TARGET ${ARG_TARGET_OR_FILE})
  1836. add_custom_command(TARGET ${ARG_POST_TARGET} POST_BUILD
  1837. COMMAND ${CMAKE_COMMAND} -E copy
  1838. $<TARGET_FILE:${ARG_TARGET_OR_FILE}>
  1839. ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/$<TARGET_FILE_NAME:${ARG_TARGET_OR_FILE}>)
  1840. else()
  1841. get_filename_component(TEMP_FILENAME ${ARG_TARGET_OR_FILE} NAME)
  1842. add_custom_command(TARGET ${ARG_POST_TARGET} POST_BUILD
  1843. COMMAND ${CMAKE_COMMAND} -E copy
  1844. ${ARG_TARGET_OR_FILE}
  1845. ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/${TEMP_FILENAME})
  1846. endif()
  1847. endfunction()
  1848. # Add post build steps to move the DLLs next to the binary. Otherwise
  1849. # running/debugging the binary will not work from inside VS.
  1850. if(LOVE_MOVE_DLLS)
  1851. foreach(DLL ${LOVE_MOVE_DLLS})
  1852. post_step_move_dll(love ${DLL})
  1853. endforeach()
  1854. endif()
  1855. if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
  1856. ###################################
  1857. # CPack
  1858. ###################################
  1859. install(TARGETS love lovec liblove RUNTIME DESTINATION .)
  1860. # Our install script (and NSIS) doesn't fully support Windows ARM64 yet.
  1861. if(MEGA_ARM64)
  1862. set(CPACK_GENERATOR ZIP)
  1863. set(CPACK_SYSTEM_NAME woa64)
  1864. else()
  1865. set(CPACK_GENERATOR ZIP NSIS)
  1866. endif()
  1867. # Extra DLLs.
  1868. if(LOVE_EXTRA_DLLS)
  1869. foreach(DLL ${LOVE_EXTRA_DLLS})
  1870. get_filename_component(DLL_NAME ${DLL} NAME)
  1871. message(STATUS "Extra DLL: ${DLL_NAME}")
  1872. endforeach()
  1873. install(FILES ${LOVE_EXTRA_DLLS} DESTINATION .)
  1874. endif()
  1875. # Dynamic runtime libs.
  1876. if(LOVE_MSVC_DLLS)
  1877. foreach(DLL ${LOVE_MSVC_DLLS})
  1878. get_filename_component(DLL_NAME ${DLL} NAME)
  1879. message(STATUS "Runtime DLL: ${DLL_NAME}")
  1880. endforeach()
  1881. install(FILES ${LOVE_MSVC_DLLS} DESTINATION .)
  1882. endif()
  1883. # Copy a text file from CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_BINARY_DIR.
  1884. # On Windows, this function will convert line endings to CR,LF.
  1885. function(copy_text_file ARG_FILE_IN ARG_FILE_OUT)
  1886. file(READ ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_FILE_IN} TMP_TXT_CONTENTS)
  1887. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${ARG_FILE_OUT} ${TMP_TXT_CONTENTS})
  1888. endfunction()
  1889. # Text files.
  1890. copy_text_file(readme.md readme.txt)
  1891. copy_text_file(license.txt license.txt)
  1892. copy_text_file(changes.txt changes.txt)
  1893. install(FILES
  1894. ${CMAKE_CURRENT_BINARY_DIR}/changes.txt
  1895. ${CMAKE_CURRENT_BINARY_DIR}/license.txt
  1896. ${CMAKE_CURRENT_BINARY_DIR}/readme.txt
  1897. DESTINATION .)
  1898. # Icons
  1899. install(FILES
  1900. ${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/love.ico
  1901. ${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/game.ico
  1902. DESTINATION .)
  1903. set(CPACK_PACKAGE_NAME "love")
  1904. set(CPACK_PACKAGE_VENDOR "love2d.org")
  1905. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LOVE -- It's awesome")
  1906. set(CPACK_PACKAGE_VERSION "${LOVE_VERSION_STR}")
  1907. set(CPACK_PACKAGE_VERSION_MAJOR "${LOVE_VERSION_MAJOR}")
  1908. set(CPACK_PACKAGE_VERSION_MINOR "${LOVE_VERSION_MINOR}")
  1909. set(CPACK_PACKAGE_VERSION_PATCH "${LOVE_VERSION_REV}")
  1910. set(CPACK_PACKAGE_INSTALL_DIRECTORY "LOVE")
  1911. set(CPACK_PACKAGE_EXECUTABLES "${LOVE_EXE_NAME};LOVE")
  1912. set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/readme.md")
  1913. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt")
  1914. set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
  1915. set(CPACK_NSIS_PACKAGE_NAME "LOVE")
  1916. set(CPACK_NSIS_DISPLAY_NAME "LOVE ${LOVE_VERSION_STR}")
  1917. set(CPACK_NSIS_MODIFY_PATH ON)
  1918. if(LOVE_X64)
  1919. set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
  1920. else()
  1921. set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
  1922. endif()
  1923. set(CPACK_NSIS_MENU_LINKS "http://love2d.org/wiki" "Documentation")
  1924. # Some bug somewhere in NSIS requires "\\\\" somewhere in the path,
  1925. # according to The Internet. (And sure enough, it does not work
  1926. # without it).
  1927. set(NSIS_LEFT_BMP "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\\\left.bmp")
  1928. set(NSIS_TOP_BMP "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\\\top.bmp")
  1929. set(NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\\\love.ico")
  1930. set(NSIS_MUI_UNICON "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\\\love.ico")
  1931. set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "
  1932. !define MUI_WELCOMEPAGE_TITLE \\\"LOVE ${LOVE_VERSION_STR} Setup\\\"
  1933. !define MUI_WELCOMEFINISHPAGE_BITMAP \\\"${NSIS_LEFT_BMP}\\\"
  1934. !define MUI_HEADERIMAGE_BITMAP \\\"${NSIS_TOP_BMP}\\\"
  1935. !define MUI_ICON \\\"${NSIS_MUI_ICON}\\\"
  1936. !define MUI_UNICON \\\"${NSIS_MUI_UNICON}\\\"
  1937. ")
  1938. set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
  1939. WriteRegStr HKCR \\\".love\\\" \\\"\\\" \\\"LOVE\\\"
  1940. WriteRegStr HKCR \\\"LOVE\\\" \\\"\\\" \\\"LOVE Game File\\\"
  1941. WriteRegStr HKCR \\\"LOVE\\\\DefaultIcon\\\" \\\"\\\" \\\"$INSTDIR\\\\game.ico\\\"
  1942. WriteRegStr HKCR \\\"LOVE\\\\shell\\\" \\\"\\\" \\\"open\\\"
  1943. WriteRegStr HKCR \\\"LOVE\\\\shell\\\\open\\\" \\\"\\\" \\\"Open in LOVE\\\"
  1944. WriteRegStr HKCR \\\"LOVE\\\\shell\\\\open\\\\command\\\" \\\"\\\" \\\"$INSTDIR\\\\love.exe $\\\\\\\"%1$\\\\\\\"\\\"
  1945. System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
  1946. ")
  1947. set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
  1948. DeleteRegKey HKCR \\\"LOVE\\\"
  1949. DeleteRegKey HKCR \\\".love\\\"
  1950. System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
  1951. ")
  1952. include(CPack)
  1953. elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
  1954. include(GNUInstallDirs)
  1955. string(TIMESTAMP LOVE_CONFIGURE_TIMESTAMP "%a, %d %b %Y %H:%M:%S +0000" UTC)
  1956. file(COPY platform/unix/debian/ DESTINATION debian PATTERN "*.in" EXCLUDE)
  1957. configure_file(platform/unix/debian/control.in debian/control @ONLY)
  1958. configure_file(platform/unix/debian/changelog.in debian/changelog @ONLY)
  1959. configure_file(platform/unix/debian/rules.in debian/rules @ONLY)
  1960. configure_file(platform/unix/love.desktop.in love.desktop @ONLY)
  1961. install(TARGETS love liblove)
  1962. install(FILES platform/unix/love.6
  1963. DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
  1964. RENAME love.1)
  1965. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/love.desktop
  1966. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
  1967. install(FILES platform/unix/love.xml
  1968. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages)
  1969. install(FILES platform/unix/love.svg
  1970. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
  1971. install(FILES platform/unix/application-x-love-game.svg
  1972. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes)
  1973. endif()