medfall

A super great game engine
Log | Files | Refs

glfw.lua (2523B)


      1 lib( "glfw", {
      2 	"libs/glfw/src/context", "libs/glfw/src/init", "libs/glfw/src/input",
      3 	"libs/glfw/src/monitor", "libs/glfw/src/vulkan", "libs/glfw/src/window",
      4 } )
      5 
      6 if OS == "windows" then
      7 	lib( "glfw", {
      8 		"libs/glfw/src/win32_init", "libs/glfw/src/win32_monitor", "libs/glfw/src/win32_window",
      9 		"libs/glfw/src/win32_joystick", "libs/glfw/src/win32_time", "libs/glfw/src/win32_thread",
     10 		"libs/glfw/src/wgl_context", "libs/glfw/src/egl_context", "libs/glfw/src/osmesa_context",
     11 	} )
     12 
     13 	obj_cxxflags( "libs/glfw/src/%", "/c /TC /D_GLFW_WIN32" ) -- compile as c
     14 	obj_cxxflags( "libs/glfw/src/%", "/wd4152 /wd4204 /wd4244 /wd4456" )
     15 elseif OS == "linux" then
     16 	lib( "glfw", {
     17 		"libs/glfw/src/x11_init", "libs/glfw/src/x11_monitor", "libs/glfw/src/x11_window",
     18 		"libs/glfw/src/xkb_unicode", "libs/glfw/src/linux_joystick", "libs/glfw/src/posix_time",
     19 		"libs/glfw/src/posix_thread", "libs/glfw/src/glx_context", "libs/glfw/src/egl_context",
     20 		"libs/glfw/src/osmesa_context",
     21 	} )
     22 
     23 	obj_replace_cxxflags( "libs/glfw/src/%", "-c -x c -O2 -D_GLFW_X11" )
     24 elseif OS == "macos" then
     25 	lib( "glfw", {
     26 		"libs/glfw/src/cocoa_init", "libs/glfw/src/cocoa_monitor", "libs/glfw/src/cocoa_window",
     27 		"libs/glfw/src/cocoa_joystick", "libs/glfw/src/cocoa_time", "libs/glfw/src/posix_thread",
     28 		"libs/glfw/src/egl_context", "libs/glfw/src/nsgl_context", "libs/glfw/src/osmesa_context",
     29 	} )
     30 
     31 	obj_replace_cxxflags( "libs/glfw/src/%", "-c -x c -O2 -D_GLFW_COCOA -mmacosx-version-min=10.9" )
     32 
     33 	-- build .m files properly
     34 	obj( "libs/glfw/src/cocoa_init", "libs/glfw/src/cocoa_init.m" )
     35 	obj( "libs/glfw/src/cocoa_monitor", "libs/glfw/src/cocoa_monitor.m" )
     36 	obj( "libs/glfw/src/cocoa_window", "libs/glfw/src/cocoa_window.m" )
     37 	obj( "libs/glfw/src/cocoa_joystick", "libs/glfw/src/cocoa_joystick.m" )
     38 	obj( "libs/glfw/src/nsgl_context", "libs/glfw/src/nsgl_context.m" )
     39 
     40 	obj_replace_cxxflags( "libs/glfw/src/cocoa_init", "-c -O2 -D_GLFW_COCOA -mmacosx-version-min=10.9" )
     41 	obj_replace_cxxflags( "libs/glfw/src/cocoa_monitor", "-c -O2 -D_GLFW_COCOA -Wno-deprecated-declarations -mmacosx-version-min=10.9" )
     42 	obj_replace_cxxflags( "libs/glfw/src/cocoa_window", "-c -O2 -D_GLFW_COCOA -Wno-deprecated-declarations -mmacosx-version-min=10.9" )
     43 	obj_replace_cxxflags( "libs/glfw/src/cocoa_joystick", "-c -O2 -D_GLFW_COCOA -mmacosx-version-min=10.9" )
     44 	obj_replace_cxxflags( "libs/glfw/src/nsgl_context", "-c -O2 -D_GLFW_COCOA -Wno-deprecated-declarations -mmacosx-version-min=10.9" )
     45 else
     46 	error( "don't know how to build GLFW on this platform" )
     47 end