-- premake5's built-in `clean` action is unported ("has not yet been ported"), -- so provide our own: wipe the build output and the generated project files. newaction { trigger = "clean", description = "Remove build output (bin, bin-int) and generated project files", execute = function() os.rmdir("bin") os.rmdir("bin-int") os.remove("Makefile") for _, f in ipairs(os.matchfiles("*.make")) do os.remove(f) end print("Cleaned: bin/, bin-int/, Makefile, *.make") end } workspace "icsohs" architecture "x64" startproject "icsohs" multiprocessorcompile "On" configurations { "debug", "release", "dist", } filter "system:windows" defines "ICSOHS_WINDOWS" filter "system:linux" defines "ICSOHS_LINUX" filter "system:macosx" defines "ICSOHS_MACOS" architecture "ARM64" outputdir = "%{cfg.buildcfg}-%{cfg.system}/%{prj.name}" includedir = {} includedir["glfw"] = "ext/glfw/include" group "dependencies" project "GLFW" kind "StaticLib" language "C" staticruntime "on" warnings "off" targetdir ("bin/" .. outputdir) objdir ("bin-int/" .. outputdir) files { "ext/glfw/src/context.c", "ext/glfw/src/init.c", "ext/glfw/src/input.c", "ext/glfw/src/monitor.c", "ext/glfw/src/platform.c", "ext/glfw/src/vulkan.c", "ext/glfw/src/window.c", "ext/glfw/src/internal.h", "ext/glfw/src/platform.h", "ext/glfw/src/mappings.h", "ext/glfw/src/null_init.c", "ext/glfw/src/null_joystick.c", "ext/glfw/src/null_joystick.h", "ext/glfw/src/null_monitor.c", "ext/glfw/src/null_platform.h", "ext/glfw/src/null_window.c", } filter "system:linux" pic "On" systemversion "latest" files { "ext/glfw/src/x11_init.c", "ext/glfw/src/x11_monitor.c", "ext/glfw/src/x11_platform.h", "ext/glfw/src/x11_window.c", "ext/glfw/src/xkb_unicode.c", "ext/glfw/src/xkb_unicode.h", "ext/glfw/src/wl_init.c", "ext/glfw/src/wl_monitor.c", "ext/glfw/src/wl_platform.h", "ext/glfw/src/wl_window.c", "ext/glfw/src/posix_module.c", "ext/glfw/src/posix_time.c", "ext/glfw/src/posix_time.h", "ext/glfw/src/posix_thread.c", "ext/glfw/src/posix_thread.h", "ext/glfw/src/glx_context.c", "ext/glfw/src/egl_context.c", "ext/glfw/src/osmesa_context.c", "ext/glfw/src/linux_joystick.c", "ext/glfw/src/linux_joystick.h" } defines { "_GLFW_X11" } filter "system:macosx" pic "On" files { "ext/glfw/src/cocoa_init.m", "ext/glfw/src/cocoa_joystick.h", "ext/glfw/src/cocoa_joystick.m", "ext/glfw/src/cocoa_monitor.m", "ext/glfw/src/cocoa_platform.h", "ext/glfw/src/macos_time.c", "ext/glfw/src/macos_time.h", "ext/glfw/src/cocoa_window.m", "ext/glfw/src/nsgl_context.m", "ext/glfw/src/egl_context.c", "ext/glfw/src/osmesa_context.c", "ext/glfw/src/posix_module.c", "ext/glfw/src/posix_thread.c", "ext/glfw/src/posix_thread.h" } defines { "_GLFW_COCOA" } filter "system:windows" systemversion "latest" files { "ext/glfw/src/win32_init.c", "ext/glfw/src/win32_joystick.c", "ext/glfw/src/win32_joystick.h", "ext/glfw/src/win32_module.c", "ext/glfw/src/win32_monitor.c", "ext/glfw/src/win32_platform.h", "ext/glfw/src/win32_thread.c", "ext/glfw/src/win32_thread.h", "ext/glfw/src/win32_time.c", "ext/glfw/src/win32_time.h", "ext/glfw/src/win32_window.c", "ext/glfw/src/wgl_context.c", "ext/glfw/src/egl_context.c", "ext/glfw/src/osmesa_context.c" } defines { "_GLFW_WIN32", "_CRT_SECURE_NO_WARNINGS", } filter "configurations:debug" runtime "Debug" symbols "on" filter "configurations:release" runtime "Release" optimize "speed" filter "configurations:dist" runtime "Release" optimize "speed" symbols "off" group "" project "icsohs" kind "ConsoleApp" language "C" staticruntime "on" externalwarnings "Off" targetdir ("bin/" .. outputdir) objdir ("bin-int/" .. outputdir) includedirs "src" defines "_CRT_SECURE_NO_WARNINGS" files { "src/**.h", "src/**.c", } links { "GLFW" } externalincludedirs { "%{includedir.glfw}" } filter "system:windows" systemversion "latest" filter "system:macosx" defines { "_GLFW_COCOA", "GL_SILENCE_DEPRECATION" } links { "Cocoa.framework", "IOKit.framework", "CoreFoundation.framework", "CoreVideo.framework", "OpenGL.framework", "QuartzCore.framework", } filter "configurations:debug" defines "ICSOHS_DEBUG" runtime "Debug" symbols "On" filter "configurations:release" defines "ICSOHS_RELEASE" runtime "Release" optimize "On" filter "configurations:dist" defines "ICSOHS_DIST" runtime "Release" optimize "On"