### Example LOVE 2D Test Method Source: https://github.com/love2d/love/blob/main/testing/readme.md Demonstrates how to write a test for a LOVE 2D module, specifically `love.filesystem.read`. It shows setup, assertion usage, and how to test different parameters. Assertions are made using the provided `test` object. ```lua -- love.filesystem.read test method -- all methods should be put under love.test.MODULE.METHOD, matching the API love.test.filesystem.read = function(test) -- setup any data needed then run any asserts using the passed test object local content, size = love.filesystem.read('resources/test.txt') test:assertNotNil(content) test:assertEquals('helloworld', content, 'check content match') test:assertEquals(10, size, 'check size match') content, size = love.filesystem.read('resources/test.txt', 5) test:assertNotNil(content) test:assertEquals('hello', content, 'check content match') test:assertEquals(5, size, 'check size match') -- no need to return anything or cleanup, GCC is called after each method end ``` -------------------------------- ### Installing Icons Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Installs the `love.ico` and `game.ico` files from the `extra/nsis` directory to the destination directory. These icons are used by the installer and for file associations. ```cmake install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/love.ico ${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/game.ico DESTINATION .) ``` -------------------------------- ### Install Man Page and Desktop Integration Files Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Installs the man page, desktop entry, and SVG icons for better system integration. ```cmake install(FILES platform/unix/love.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME love.1) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/love.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) install(FILES platform/unix/love.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages) install(FILES platform/unix/love.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps) install(FILES platform/unix/application-x-love-game.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes) ``` -------------------------------- ### Install LOVE Executable and Libraries Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Installs the main LOVE executable and its associated library. ```cmake install(TARGETS love liblove) ``` -------------------------------- ### Installing Text Files Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Installs the `changes.txt`, `license.txt`, and `readme.txt` files to the destination directory. These files are first copied from the source to the binary directory using the `copy_text_file` function. ```cmake install(FILES ${CMAKE_CURRENT_BINARY_DIR}/changes.txt ${CMAKE_CURRENT_BINARY_DIR}/license.txt ${CMAKE_CURRENT_BINARY_DIR}/readme.txt DESTINATION .) ``` -------------------------------- ### Installing Extra DLLs Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Installs additional DLL files specified in LOVE_EXTRA_DLLS to the destination directory. It also logs the names of the DLLs being installed. ```cmake if(LOVE_EXTRA_DLLS) file(TO_CMAKE_PATH "${LOVE_EXTRA_DLLS}" LOVE_EXTRA_DLLS) foreach(DLL ${LOVE_EXTRA_DLLS}) get_filename_component(DLL_NAME ${DLL} NAME) message(STATUS "Extra DLL: ${DLL_NAME}") endforeach() install(FILES ${LOVE_EXTRA_DLLS} DESTINATION .) endif() ``` -------------------------------- ### Build and Install LÖVE with CMake Source: https://github.com/love2d/love/blob/main/readme.md Build the LÖVE project using all available cores and install it to the specified prefix. This command is used after generating the build files with CMake. ```bash cmake --build build --target install -j$(nproc) # this will build with all cores and put the files in `prefix/`. ``` -------------------------------- ### Windows Installation Rules Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Defines installation rules for the LOVE executable, related libraries, and external programs on Windows systems. It specifies the destination directory for runtime components. ```cmake install(TARGETS love lovec liblove RUNTIME DESTINATION .) install(PROGRAMS $ DESTINATION .) ``` -------------------------------- ### Linux Installation Directories Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Includes the GNUInstallDirs module to define standard installation directory variables for Linux systems, such as prefix, bindir, and libdir. ```cmake include(GNUInstallDirs) ``` -------------------------------- ### NSIS Installer UI Bitmaps and Icons Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Defines paths to NSIS installer bitmaps and icons. These are used to customize the appearance of the installer, including the welcome page, header image, and application icon. ```cmake set(NSIS_LEFT_BMP "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\left.bmp") set(NSIS_TOP_BMP "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\top.bmp") set(NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\love.ico") set(NSIS_MUI_UNICON "${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis\\love.ico") set(CPACK_NSIS_INSTALLER_MUI_CODE " !define MUI_WELCOMEPAGE_TITLE \"LOVE ${LOVE_VERSION_STR} Setup\" !define MUI_WELCOMEFINISHPAGE_BITMAP \"${NSIS_LEFT_BMP}\" !define MUI_HEADERIMAGE_BITMAP \"${NSIS_TOP_BMP}\" !define MUI_ICON \"${NSIS_MUI_ICON}\" !define MUI_UNICON \"${NSIS_MUI_UNICON}\" ") ``` -------------------------------- ### CMake Install Prefix Alternative Source: https://github.com/love2d/love/blob/main/readme.md Alternative CMake configuration for versions 3.15 and earlier that do not support the `--install-prefix` flag. Use `-DCMAKE_INSTALL_PREFIX=` instead. ```bash cmake -B build -S. -DCMAKE_INSTALL_PREFIX=$PWD/prefix ``` -------------------------------- ### Installing MSVC Runtime DLLs Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Installs Microsoft Visual C++ runtime DLLs specified in LOVE_MSVC_DLLS to the destination directory. It logs the names of these runtime DLLs. ```cmake if(LOVE_MSVC_DLLS) file(TO_CMAKE_PATH "${LOVE_MSVC_DLLS}" LOVE_MSVC_DLLS) foreach(DLL ${LOVE_MSVC_DLLS}) get_filename_component(DLL_NAME ${DLL} NAME) message(STATUS "Runtime DLL: ${DLL_NAME}") endforeach() install(FILES ${LOVE_MSVC_DLLS} DESTINATION .) endif() ``` -------------------------------- ### NSIS Extra Install Commands Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Specifies additional commands to be executed during the NSIS installation process. These commands register file associations for `.love` files, set default icons, and configure the 'open' command for the file type. ```cmake set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " WriteRegStr HKCR \".love\" \"\" \"LOVE\" WriteRegStr HKCR \"LOVE\" \"\" \"LOVE Game File\" WriteRegStr HKCR \"LOVE\\DefaultIcon\" \"\" \"$INSTDIR\\game.ico\" WriteRegStr HKCR \"LOVE\\shell\" \"\" \"open\" WriteRegStr HKCR \"LOVE\\shell\\open\" \"\" \"Open in LOVE\" WriteRegStr HKCR \"LOVE\\shell\\open\\command\" \"\" \"$INSTDIR\\love.exe $\\\"%1$\\\"\" System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ") ``` -------------------------------- ### LOVE Joystick Module CMake Configuration Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Defines static libraries for the core joystick functionality and SDL-specific implementation, then creates an interface library to link them together. This setup is used for building the joystick module in LOVE. ```cmake add_library(love_joystick_root STATIC src/modules/joystick/Joystick.cpp src/modules/joystick/Joystick.h src/modules/joystick/JoystickModule.h src/modules/joystick/wrap_Joystick.cpp src/modules/joystick/wrap_Joystick.h src/modules/joystick/wrap_JoystickModule.cpp src/modules/joystick/wrap_JoystickModule.h ) target_link_libraries(love_joystick_root PUBLIC lovedep::Lua ) add_library(love_joystick_sdl STATIC src/modules/joystick/sdl/Joystick.cpp src/modules/joystick/sdl/Joystick.h src/modules/joystick/sdl/JoystickModule.cpp src/modules/joystick/sdl/JoystickModule.h ) target_link_libraries(love_joystick_sdl PUBLIC lovedep::SDL ) add_library(love_joystick INTERFACE) target_link_libraries(love_joystick INTERFACE love_joystick_root love_joystick_sdl ) ``` -------------------------------- ### Generate CMake Build Files Source: https://github.com/love2d/love/blob/main/readme.md Generate Makefiles for building LÖVE on Unix-like systems using CMake. This command creates a 'build' directory and sets the installation prefix. ```bash cmake -B build -S. --install-prefix $PWD/prefix # this will create the directory `build/`. ``` -------------------------------- ### LOVE Keyboard Module CMake Configuration Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Configures static libraries for the core keyboard functionality and its SDL implementation, then combines them into an interface library. This is the CMake setup for the keyboard module. ```cmake add_library(love_keyboard_root STATIC src/modules/keyboard/Keyboard.cpp src/modules/keyboard/Keyboard.h src/modules/keyboard/wrap_Keyboard.cpp src/modules/keyboard/wrap_Keyboard.h ) target_link_libraries(love_keyboard_root PUBLIC lovedep::Lua lovedep::SDL ) add_library(love_keyboard_sdl STATIC src/modules/keyboard/sdl/Keyboard.cpp src/modules/keyboard/sdl/Keyboard.h ) target_link_libraries(love_keyboard_sdl PUBLIC lovedep::SDL ) add_library(love_keyboard INTERFACE) target_link_libraries(love_keyboard INTERFACE love_keyboard_root love_keyboard_sdl ) ``` -------------------------------- ### NSIS Installer Configuration Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Configures NSIS-specific CPack variables, including the executables directory, package name, display name, and path modification settings. It also sets the installation root directory based on whether the build is for 64-bit. ```cmake set(CPACK_NSIS_EXECUTABLES_DIRECTORY .) set(CPACK_NSIS_PACKAGE_NAME "LOVE") set(CPACK_NSIS_DISPLAY_NAME "LOVE ${LOVE_VERSION_STR}") set(CPACK_NSIS_MODIFY_PATH ON) if(LOVE_X64) set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") else() set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") endif() set(CPACK_NSIS_MENU_LINKS "http://love2d.org/wiki" "Documentation") ``` -------------------------------- ### CPack Package Information Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Sets essential CPack variables for package creation, including name, vendor, summary, version details, installation directory, and executable names. It also specifies the README and LICENSE files for the package. ```cmake set(CPACK_PACKAGE_NAME "love") set(CPACK_PACKAGE_VENDOR "love2d.org") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LOVE -- It's awesome") set(CPACK_PACKAGE_VERSION "${LOVE_VERSION_STR}") set(CPACK_PACKAGE_VERSION_MAJOR "${LOVE_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${LOVE_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${LOVE_VERSION_REV}") set(CPACK_PACKAGE_INSTALL_DIRECTORY "LOVE") set(CPACK_PACKAGE_EXECUTABLES "${LOVE_EXE_NAME};LOVE") set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/readme.md") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt") ``` -------------------------------- ### Define love.system Interface Library Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Creates an interface library for 'love.system' that aggregates the root and SDL-specific static libraries, simplifying its usage in other targets. ```cmake add_library(love_system INTERFACE) target_link_libraries(love_system INTERFACE love_system_root love_system_sdl ) ``` -------------------------------- ### Define love.system Root Library Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Configures the static root library for the 'love.system' module, listing its source files and linking it with Lua and SDL dependencies. ```cmake add_library(love_system_root STATIC src/modules/system/System.cpp src/modules/system/System.h src/modules/system/wrap_System.cpp src/modules/system/wrap_System.h ) target_link_libraries(love_system_root PUBLIC lovedep::Lua lovedep::SDL ) ``` -------------------------------- ### Run LÖVE Test Suite Source: https://github.com/love2d/love/blob/main/readme.md Execute the LÖVE test suite locally by navigating to the testing directory and running it as a standard LÖVE project. Refer to the testing folder's readme for more details. ```bash love testing ``` -------------------------------- ### Running LOVE 2D Tests with Runner Flag Source: https://github.com/love2d/love/blob/main/testing/readme.md Demonstrates how to execute LOVE 2D tests on a runner environment by including the `--isRunner` flag. This is typically used in CI/CD pipelines to account for potential differences in VM or emulation environments. ```bash & 'c:\Program Files\LOVE\love.exe' PATH_TO_TESTING_FOLDER/main.lua --console --all --isRunner ``` -------------------------------- ### Configure Desktop Entry File Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Processes the desktop entry template file for integration with desktop environments. ```cmake configure_file(platform/unix/love.desktop.in love.desktop @ONLY) ``` -------------------------------- ### Define love.system SDL-Specific Library Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Configures the static library for the SDL-specific implementation of the 'love.system' module, linking it with the SDL dependency. ```cmake add_library(love_system_sdl STATIC src/modules/system/sdl/System.cpp src/modules/system/sdl/System.h ) target_link_libraries(love_system_sdl PUBLIC lovedep::SDL ) ``` -------------------------------- ### Window and Math Utilities Source: https://github.com/love2d/love/blob/main/changes.txt New functions for window management and data compression/decompression. ```APIDOC ## love.window.maximize ### Description Maximizes the application window. ### Method `love.window.maximize()` ## love.window.close ### Description Closes the application window. ### Method `love.window.close()` ## love.window.requestAttention ### Description Requests user attention for the window. ### Method `love.window.requestAttention(lowPriority)` ## love.window.setDisplaySleepEnabled ### Description Enables or disables display sleep. ### Method `love.window.setDisplaySleepEnabled(enable)` ## love.window.isDisplaySleepEnabled ### Description Checks if display sleep is enabled. ### Method `love.window.isDisplaySleepEnabled()` ## love.math.compress ### Description Compresses data using a default algorithm. ### Method `love.math.compress(data)` ## love.math.decompress ### Description Decompresses data. ### Method `love.math.decompress(data)` ``` -------------------------------- ### love.window Functions Source: https://github.com/love2d/love/blob/main/testing/examples/lovetest_runAllTests.html Functions for window management, including size, position, title, and fullscreen settings. ```APIDOC ## love.window.focus ### Description Sets or gets the window focus. ## love.window.fromPixels ### Description Converts pixel coordinates to logical coordinates. ## love.window.getDPIScale ### Description Gets the DPI scale factor of the window. ## love.window.getDesktopDimensions ### Description Gets the dimensions of the desktop. ## love.window.getDisplayCount ### Description Gets the number of available displays. ## love.window.getDisplayName ### Description Gets the name of the current display. ## love.window.getDisplayOrientation ### Description Gets the orientation of the current display. ## love.window.getFullscreen ### Description Gets the fullscreen state of the window. ## love.window.getFullscreenModes ### Description Gets a list of available fullscreen modes. ## love.window.getIcon ### Description Gets the window icon. ## love.window.getMode ### Description Gets the current window mode. ## love.window.getPosition ### Description Gets the position of the window on the screen. ## love.window.getSafeArea ### Description Gets the safe area insets of the window. ## love.window.getTitle ### Description Gets the title of the window. ## love.window.getVSync ### Description Gets the VSync state of the window. ## love.window.hasFocus ### Description Checks if the window has focus. ## love.window.hasMouseFocus ### Description Checks if the window has mouse focus. ## love.window.isDisplaySleepEnabled ### Description Checks if display sleep is enabled. ## love.window.isMaximized ### Description Checks if the window is maximized. ## love.window.isMinimized ### Description Checks if the window is minimized. ## love.window.isOpen ### Description Checks if the window is open. ## love.window.isVisible ### Description Checks if the window is visible. ## love.window.maximize ### Description Maximizes the window. ## love.window.minimize ### Description Minimizes the window. ## love.window.requestAttention ### Description Requests attention for the window. (Skipped in testing) ## love.window.restore ### Description Restores the window from a minimized or maximized state. ## love.window.setDisplaySleepEnabled ### Description Enables or disables display sleep. ## love.window.setFullscreen ### Description Sets the fullscreen state of the window. ## love.window.setIcon ### Description Sets the window icon. ## love.window.setMode ### Description Sets the window mode. ## love.window.setPosition ### Description Sets the position of the window on the screen. ## love.window.setTitle ### Description Sets the title of the window. ## love.window.setVSync ### Description Sets the VSync state of the window. ## love.window.showMessageBox ### Description Shows a message box. (Skipped in testing) ## love.window.toPixels ### Description Converts logical coordinates to pixel coordinates. ## love.window.updateMode ### Description Updates the window mode. ``` -------------------------------- ### Define love.thread Interface Library Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Creates an interface library for 'love.thread' that aggregates the root and SDL-specific static libraries, simplifying its usage in other targets. ```cmake add_library(love_thread INTERFACE) target_link_libraries(love_thread INTERFACE love_thread_root love_thread_sdl ) ``` -------------------------------- ### Define love.thread Root Library Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Configures the static root library for the 'love.thread' module, listing its source files and linking it with the Lua dependency. ```cmake add_library(love_thread_root STATIC src/modules/thread/Channel.cpp src/modules/thread/Channel.h src/modules/thread/LuaThread.cpp src/modules/thread/LuaThread.h src/modules/thread/Thread.h src/modules/thread/ThreadModule.cpp src/modules/thread/ThreadModule.h src/modules/thread/threads.cpp src/modules/thread/threads.h src/modules/thread/wrap_Channel.cpp src/modules/thread/wrap_Channel.h src/modules/thread/wrap_LuaThread.cpp src/modules/thread/wrap_LuaThread.h src/modules/thread/wrap_ThreadModule.cpp src/modules/thread/wrap_ThreadModule.h ) target_link_libraries(love_thread_root PUBLIC lovedep::Lua ) ``` -------------------------------- ### MinGW Platform Warning Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Issues a warning for MinGW, stating it's not officially supported. Advises users to use megasource with Visual Studio and provides a link for more information. ```cmake if(MINGW) message(WARNING "MinGW is not an officially supported build system for love.") message(WARNING "Use megasource with Visual Studio instead.") message(WARNING "Please see https://github.com/love2d/megasource") endif() ``` -------------------------------- ### Add Console Executable Target 'lovec' on Windows Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Creates a console version of the LÖVE executable named 'lovec' for Windows and MinGW builds. Links against 'liblove'. ```cmake if(MSVC OR MINGW) add_executable(lovec src/love.cpp) target_link_libraries(lovec liblove) set_target_properties(lovec PROPERTIES OUTPUT_NAME ${LOVE_CONSOLE_EXE_NAME}) endif() ``` -------------------------------- ### Configure Debian Package Files Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Uses CMake's configure_file command to process input files for Debian packaging, substituting variables. ```cmake file(COPY platform/unix/debian/ DESTINATION debian PATTERN "*.in" EXCLUDE) configure_file(platform/unix/debian/control.in debian/control @ONLY) configure_file(platform/unix/debian/changelog.in debian/changelog @ONLY) configure_file(platform/unix/debian/rules.in debian/rules @ONLY) ``` -------------------------------- ### Mouse and Keyboard Input Enhancements Source: https://github.com/love2d/love/blob/main/changes.txt Updates to mouse and keyboard input handling, including new methods and argument changes. ```APIDOC ## love.mouse.hasCursor ### Description Checks if the mouse cursor is currently available or has been hidden. ### Method `love.mouse.hasCursor()` ## love.mousepressed ### Description Called when a mouse button is pressed. An additional boolean argument indicates if the event originated from a touch press. ### Method `love.mousepressed(x, y, button, istouch)` ## love.mousereleased ### Description Called when a mouse button is released. An additional boolean argument indicates if the event originated from a touch release. ### Method `love.mousereleased(x, y, button, istouch)` ## love.keyboard.setTextInput ### Description Enables or disables text input. Optional arguments specify the area where text will appear, helping on-screen keyboards avoid it. ### Method `love.keyboard.setTextInput(enable [, x, y, width, height])` ## Changes to Mouse Button Handling ### Description `love.mousepressed`, `love.mousereleased`, and `love.mouse.isDown` now use numerical button identifiers instead of named constants. ### Method `love.mouse.isDown(button_number)` ## Changes to Key Input ### Description `love.keypressed` now includes scancode and repeat information. `love.keyreleased` now includes scancode. ### Method `love.keypressed(key, scancode, isrepeat)` `love.keyreleased(key, scancode)` ``` -------------------------------- ### love.system Functions Source: https://github.com/love2d/love/blob/main/testing/examples/lovetest_runAllTests.html Functions for interacting with the system, such as clipboard, power, and OS information. ```APIDOC ## love.system.getClipboardText ### Description Gets the current text from the system clipboard. ## love.system.getOS ### Description Gets the name of the operating system. ## love.system.getPowerInfo ### Description Gets information about the system's power status. ## love.system.getPreferredLocales ### Description Gets the user's preferred locales. ## love.system.getProcessorCount ### Description Gets the number of processors on the system. ## love.system.hasBackgroundMusic ### Description Checks if the system has background music capabilities. ## love.system.openURL ### Description Opens a URL in the default web browser. (Skipped in testing) ## love.system.setClipboardText ### Description Sets the text in the system clipboard. ## love.system.vibrate ### Description Vibrates the device. (Skipped in testing) ``` -------------------------------- ### love.sound Functions Source: https://github.com/love2d/love/blob/main/testing/examples/lovetest_runAllTests.html Functions for audio playback and manipulation. ```APIDOC ## love.sound.Decoder ### Description Represents an audio decoder. ## love.sound.SoundData ### Description Represents raw audio data. ## love.sound.newDecoder ### Description Creates a new audio decoder. ## love.sound.newSoundData ### Description Creates new raw audio data. ``` -------------------------------- ### Skipping a Test in LOVE 2D Source: https://github.com/love2d/love/blob/main/testing/readme.md Illustrates how to skip a test case within the LOVE 2D testing framework. This is useful when a test is not yet covered or cannot be reliably executed, preventing it from affecting the overall pass/fail totals. ```lua test:skipTest(reason) ``` -------------------------------- ### Find and Link Theora Library Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Configures CMake to find the Theora library and set up include directories and link libraries for the project. ```cmake find_package(Theora REQUIRED) target_include_directories(lovedep::Theora INTERFACE ${THEORA_INCLUDE_DIR}) target_link_libraries(lovedep::Theora INTERFACE ${THEORA_LIBRARY} ${THEORADEC_LIBRARY}) ``` -------------------------------- ### Define love.thread SDL-Specific Library Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Configures the static library for the SDL-specific implementation of the 'love.thread' module, linking it with the SDL dependency. ```cmake add_library(love_thread_sdl STATIC src/modules/thread/sdl/Thread.cpp src/modules/thread/sdl/Thread.h src/modules/thread/sdl/threads.cpp src/modules/thread/sdl/threads.h ) target_link_libraries(love_thread_sdl PUBLIC lovedep::SDL ) ``` -------------------------------- ### Determining Target Platform (x64/x86) Source: https://github.com/love2d/love/blob/main/CMakeLists.txt Sets flags and a variable to indicate the target architecture (x64 or x86) based on the size of a void pointer. ```cmake if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(LOVE_X64 TRUE) set(LOVE_TARGET_PLATFORM x64) else() set(LOVE_X86 TRUE) set(LOVE_TARGET_PLATFORM x86) endif() ```