set_project("Frostbite2D") set_version("1.0.0") set_license("MIT") -- 语言和编码设置 set_languages("c++17") set_encodings("utf-8") add_rules("mode.debug", "mode.release") local host_plat = os.host() local target_plat = get_config("plat") or host_plat local supported_plats = {mingw = true, windows = true, linux = true, macosx = true, switch = true} -- 自动选择平台 if not supported_plats[target_plat] then raise("Unsupported platform: " .. target_plat .. ". Supported platforms: mingw, windows, linux, macosx, switch") end -- 引入对应平台的配置文件 local platform_config_file = "platform/" .. target_plat .. ".lua" if os.isfile(platform_config_file) then includes(platform_config_file) else print("Platform config file not found: " .. platform_config_file) end