Skip to content

Commit

Permalink
Misc. dependency updates and Linux build fixes (#34)
Browse files Browse the repository at this point in the history
* Add x11 premake support
* Update glm to version 1.0.1
* Update Tracy to 0.11.0
* Update glfw to 3.4
* Temporarily disable Generate build on linux
  • Loading branch information
Foereaper authored Jul 30, 2024
1 parent fe1e27f commit ef0c8a8
Show file tree
Hide file tree
Showing 581 changed files with 51,803 additions and 22,934 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -yq clang libx11-dev
sudo apt-get update && sudo apt-get install -yq clang libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libvulkan-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100
- name: Install Vulkan SDK
Expand Down
2 changes: 1 addition & 1 deletion Dependencies/Dependencies.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local dependencies =
"base64/base64.lua",
"catch2/catch2.lua",
"dxcompiler/dxcompiler.lua",
"enkiTS/enkiTS.lua",
"enkits/enkiTS.lua",
"entt/entt.lua",
"glfw/glfw.lua",
"gli/gli.lua",
Expand Down
13 changes: 2 additions & 11 deletions Dependencies/dxcompiler/dxcompiler.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
local mod = Solution.Util.CreateDepTable("dxcompiler", {})
local libPath = iif(os.istarget("windows"), mod.Path .. "/lib/windows/dxcompiler.dll", mod.Path .. "/lib/linux/dxcompiler.so")

Solution.Util.CreateDep(mod.Name, mod.Dependencies, function()
Solution.Util.SetIncludes(mod.Path .. "/include")

Solution.Util.SetFilter("platforms:Win64", function()
local link = mod.Path .. "/lib/windows/dxcompiler.lib"
Solution.Util.SetLinks(link)
end)

Solution.Util.SetFilter("platforms:Linux", function()
local link = mod.Path .. "/lib/linux/dxcompiler.so"
Solution.Util.SetLinks(link)
end)
Solution.Util.SetLinks(libPath)
end)

local libPath = iif(os.istarget("windows"), mod.Path .. "/lib/windows/dxcompiler.dll", mod.Path .. "/lib/linux/dxcompiler.so")
BuildSettings:Add("DXCompiler Dynamic Lib Path", libPath)
4 changes: 3 additions & 1 deletion Dependencies/dxcompiler/include/WinAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
#define CoTaskMemAlloc malloc
#define CoTaskMemFree free

#ifndef ARRAYSIZE
#define ARRAYSIZE(array) (sizeof(array) / sizeof(array[0]))
#endif // ARRAYSIZE

#define _countof(a) (sizeof(a) / sizeof(*(a)))

Expand Down Expand Up @@ -186,7 +188,7 @@

#define vsnprintf_s vsnprintf
#define strcat_s strcat
#define strcpy_s(dst, n, src) strncpy(dst, src, n)
#define strncpy_s(dst, n, src) strncpy(dst, src, n)
#define _vscwprintf vwprintf
#define vswprintf_s vswprintf
#define swprintf_s swprintf
Expand Down
2 changes: 1 addition & 1 deletion Dependencies/dxcompiler/include/dxcapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include <dlfcn.h>
#if !WIN32
#undef strcpy_s
#undef strncpy_s
#undef ARRAYSIZE
#endif
#include "WinAdapter.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions Dependencies/glfw/.github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

* @elmindreda

docs/*.css @glfw/webdev
docs/*.scss @glfw/webdev
docs/*.html @glfw/webdev
docs/*.xml @glfw/webdev

100 changes: 100 additions & 0 deletions Dependencies/glfw/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Build
on:
pull_request:
push:
branches: [ ci, master, latest, 3.3-stable ]
workflow_dispatch:
permissions:
statuses: write
contents: read

jobs:
build-linux-clang:
name: Linux (Clang)
runs-on: ubuntu-latest
timeout-minutes: 4
env:
CC: clang
CFLAGS: -Werror
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libwayland-dev libxkbcommon-dev
- name: Configure Null shared library
run: cmake -B build-null-shared -D GLFW_BUILD_WAYLAND=OFF -D GLFW_BUILD_X11=OFF -D BUILD_SHARED_LIBS=ON
- name: Build Null shared library
run: cmake --build build-null-shared --parallel

- name: Configure X11 shared library
run: cmake -B build-x11-shared -D GLFW_BUILD_WAYLAND=OFF -D GLFW_BUILD_X11=ON -D BUILD_SHARED_LIBS=ON
- name: Build X11 shared library
run: cmake --build build-x11-shared --parallel

- name: Configure Wayland shared library
run: cmake -B build-wayland-shared -D GLFW_BUILD_WAYLAND=ON -D GLFW_BUILD_X11=OFF -D BUILD_SHARED_LIBS=ON
- name: Build Wayland shared library
run: cmake --build build-wayland-shared --parallel

- name: Configure Wayland+X11 static library
run: cmake -B build-full-static -D GLFW_BUILD_WAYLAND=ON -D GLFW_BUILD_X11=ON
- name: Build Wayland+X11 static library
run: cmake --build build-full-static --parallel

- name: Configure Wayland+X11 shared library
run: cmake -B build-full-shared -D GLFW_BUILD_WAYLAND=ON -D BUILD_SHARED_LIBS=ON -D GLFW_BUILD_X11=ON
- name: Build Wayland+X11 shared library
run: cmake --build build-full-shared --parallel

build-macos-clang:
name: macOS (Clang)
runs-on: macos-latest
timeout-minutes: 4
env:
CFLAGS: -Werror
MACOSX_DEPLOYMENT_TARGET: 10.8
CMAKE_OSX_ARCHITECTURES: x86_64;arm64
steps:
- uses: actions/checkout@v4

- name: Configure Null shared library
run: cmake -B build-null-shared -D GLFW_BUILD_COCOA=OFF -D BUILD_SHARED_LIBS=ON
- name: Build Null shared library
run: cmake --build build-null-shared --parallel

- name: Configure Cocoa static library
run: cmake -B build-cocoa-static
- name: Build Cocoa static library
run: cmake --build build-cocoa-static --parallel

- name: Configure Cocoa shared library
run: cmake -B build-cocoa-shared -D BUILD_SHARED_LIBS=ON
- name: Build Cocoa shared library
run: cmake --build build-cocoa-shared --parallel

build-windows-vs2022:
name: Windows (VS2022)
runs-on: windows-latest
timeout-minutes: 4
env:
CFLAGS: /WX
steps:
- uses: actions/checkout@v4

- name: Configure Win32 shared x86 library
run: cmake -B build-win32-shared-x86 -G "Visual Studio 17 2022" -A Win32 -D BUILD_SHARED_LIBS=ON
- name: Build Win32 shared x86 library
run: cmake --build build-win32-shared-x86 --parallel

- name: Configure Win32 static x64 library
run: cmake -B build-win32-static-x64 -G "Visual Studio 17 2022" -A x64
- name: Build Win32 static x64 library
run: cmake --build build-win32-static-x64 --parallel

- name: Configure Win32 shared x64 library
run: cmake -B build-win32-shared-x64 -G "Visual Studio 17 2022" -A x64 -D BUILD_SHARED_LIBS=ON
- name: Build Win32 shared x64 library
run: cmake --build build-win32-shared-x64 --parallel

19 changes: 17 additions & 2 deletions Dependencies/glfw/CMake/GenerateMappings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,23 @@ endif()

file(STRINGS "${source_path}" lines)
foreach(line ${lines})
if ("${line}" MATCHES "^[0-9a-fA-F].*$")
set(GLFW_GAMEPAD_MAPPINGS "${GLFW_GAMEPAD_MAPPINGS}\"${line}\",\n")
if (line MATCHES "^[0-9a-fA-F]")
if (line MATCHES "platform:Windows")
if (GLFW_WIN32_MAPPINGS)
string(APPEND GLFW_WIN32_MAPPINGS "\n")
endif()
string(APPEND GLFW_WIN32_MAPPINGS "\"${line}\",")
elseif (line MATCHES "platform:Mac OS X")
if (GLFW_COCOA_MAPPINGS)
string(APPEND GLFW_COCOA_MAPPINGS "\n")
endif()
string(APPEND GLFW_COCOA_MAPPINGS "\"${line}\",")
elseif (line MATCHES "platform:Linux")
if (GLFW_LINUX_MAPPINGS)
string(APPEND GLFW_LINUX_MAPPINGS "\n")
endif()
string(APPEND GLFW_LINUX_MAPPINGS "\"${line}\",")
endif()
endif()
endforeach()

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
if (NOT EXISTS "@GLFW_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@GLFW_BINARY_DIR@/install_manifest.txt\"")
endif()

file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
file(READ "@GLFW_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")

foreach (file ${files})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ libdir=@CMAKE_INSTALL_FULL_LIBDIR@

Name: GLFW
Description: A multi-platform library for OpenGL, window and input
Version: @GLFW_VERSION_FULL@
Version: @GLFW_VERSION@
URL: https://www.glfw.org/
Requires.private: @GLFW_PKG_DEPS@
Libs: -L${libdir} -l@GLFW_LIB_NAME@
Libs.private: @GLFW_PKG_LIBS@
Requires.private: @GLFW_PKG_CONFIG_REQUIRES_PRIVATE@
Libs: -L${libdir} -l@GLFW_LIB_NAME@@GLFW_LIB_NAME_SUFFIX@
Libs.private: @GLFW_PKG_CONFIG_LIBS_PRIVATE@
Cflags: -I${includedir}
3 changes: 3 additions & 0 deletions Dependencies/glfw/CMake/glfw3Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include(CMakeFindDependencyMacro)
find_dependency(Threads)
include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake")
2 changes: 1 addition & 1 deletion Dependencies/glfw/CMake/modules/FindEpollShim.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EPOLLSHIM DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES)
26 changes: 0 additions & 26 deletions Dependencies/glfw/CMake/modules/FindWaylandProtocols.cmake

This file was deleted.

34 changes: 0 additions & 34 deletions Dependencies/glfw/CMake/modules/FindXKBCommon.cmake

This file was deleted.

Loading

0 comments on commit ef0c8a8

Please sign in to comment.