🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Build ANGLE with Raylib using Premake

Started by
0 comments, last by nicolas3 3 weeks, 2 days ago

Hey, I've been trying to set up Premake to build ANGLE with Raylib. I came across this repository (https://github.com/ypujante/imgui-raylib-cmake/tree/master) and tried to replicate its setup using Premake. However, I'm facing issues getting ANGLE to work correctly. Here is my Premake code:

chrome_path = "/Applications/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/123.0.6312.107/Libraries/"
function check_chrome()
    if(os.isdir(chrome_path)) then
        print("Google Chrome directory found")
        return true
    else
        print("Can't find Google Chrome directory, make sure Chrome is installed")
        return false
    end
end
function get_angle()
    if check_chrome() then
        print("Initializing ANGLE ...")

        local angle_dir = "chrome-angle"

        if not os.isdir(angle_dir) then
            os.mkdir(angle_dir)
        else
            print("Directory " .. angle_dir .. " already exists, skipping creation")
        end

        -- Copy ANGLE dylibs from Google Chrome
        os.copyfile(chrome_path .. "libEGL.dylib", angle_dir)
        os.copyfile(chrome_path .. "libGLESv2.dylib", angle_dir)

        -- Change the rpath using install_name_tool (invalidates signature)
        os.execute('install_name_tool -id "@rpath/libEGL.dylib" "' .. angle_dir .. '/libEGL.dylib"')
        os.execute('install_name_tool -id "@rpath/libGLESv2.dylib" "' .. angle_dir .. '/libGLESv2.dylib"')

        -- Remove the signature
        os.execute('codesign -s "-" -fv "' .. angle_dir .. '/libEGL.dylib"')
        os.execute('codesign -s "-" -fv "' .. angle_dir .. '/libGLESv2.dylib"')
    end
end
function link_angle() 
    libdirs {"../chrome-angle"}
    
    links { "libEGL.dylib", "libGLESv2.dylib" }

    linkoptions { "-Wl,-rpath,../chrome-angle" }
end

Advertisement