mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-08 20:19:04 +03:00
statically link glwf on windows and ubuntu
This commit is contained in:
4
.github/workflows/Test packages.yml
vendored
4
.github/workflows/Test packages.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -DCMAKE_BUILD_TYPE=Release
|
cmake -B build -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_GLFW=OFF
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build --config Release
|
run: cmake --build build --config Release
|
||||||
@@ -77,7 +77,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -DCMAKE_BUILD_TYPE=Release
|
cmake -B build -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_GLFW=ON
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build --config Release
|
run: cmake --build build --config Release
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ build() {
|
|||||||
cd "$pkgname-$pkgver"
|
cd "$pkgname-$pkgver"
|
||||||
cmake -B build -S . \
|
cmake -B build -S . \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DUSE_SYSTEM_GLFW=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr
|
-DCMAKE_INSTALL_PREFIX=/usr
|
||||||
cmake --build build
|
cmake --build build
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ build() {
|
|||||||
cd "$srcdir/$pkgname"
|
cd "$srcdir/$pkgname"
|
||||||
cmake -B build -S . \
|
cmake -B build -S . \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DUSE_SYSTEM_GLFW=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr
|
-DCMAKE_INSTALL_PREFIX=/usr
|
||||||
cmake --build build
|
cmake --build build
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ build() {
|
|||||||
cd "$pkgname-$pkgver"
|
cd "$pkgname-$pkgver"
|
||||||
cmake -B build -S . \
|
cmake -B build -S . \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DUSE_SYSTEM_GLFW=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr
|
-DCMAKE_INSTALL_PREFIX=/usr
|
||||||
cmake --build build
|
cmake --build build
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ include(GNUInstallDirs)
|
|||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
option(USE_SYSTEM_GLFW "Use system-installed GLFW instead of fetching it statically" OFF)
|
||||||
|
message(STATUS "USE_SYSTEM_GLFW: ${USE_SYSTEM_GLFW}")
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Platform-specific install dirs
|
# Platform-specific install dirs
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
@@ -52,16 +55,6 @@ if(WIN32)
|
|||||||
URL https://download.savannah.gnu.org/releases/freetype/freetype-2.14.1.tar.gz
|
URL https://download.savannah.gnu.org/releases/freetype/freetype-2.14.1.tar.gz
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(freetype)
|
FetchContent_MakeAvailable(freetype)
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
glfw
|
|
||||||
GIT_REPOSITORY https://github.com/glfw/glfw.git
|
|
||||||
GIT_TAG 3.4
|
|
||||||
)
|
|
||||||
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
|
||||||
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
|
||||||
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
|
||||||
FetchContent_MakeAvailable(glfw)
|
|
||||||
else()
|
else()
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
@@ -74,12 +67,33 @@ else()
|
|||||||
find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon)
|
find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon)
|
||||||
|
|
||||||
pkg_check_modules(HARFBUZZ harfbuzz)
|
pkg_check_modules(HARFBUZZ harfbuzz)
|
||||||
pkg_check_modules(GLFW REQUIRED glfw3)
|
|
||||||
pkg_check_modules(WAYLAND_CLIENT wayland-client)
|
pkg_check_modules(WAYLAND_CLIENT wayland-client)
|
||||||
pkg_check_modules(WAYLAND_EGL wayland-egl)
|
pkg_check_modules(WAYLAND_EGL wayland-egl)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(USE_SYSTEM_GLFW)
|
||||||
|
pkg_check_modules(GLFW REQUIRED glfw3)
|
||||||
|
else()
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(
|
||||||
|
glfw
|
||||||
|
GIT_REPOSITORY https://github.com/glfw/glfw.git
|
||||||
|
GIT_TAG 3.4
|
||||||
|
)
|
||||||
|
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
FetchContent_MakeAvailable(glfw)
|
||||||
|
set(GLFW_FOUND TRUE)
|
||||||
|
set(GLFW_INCLUDE_DIRS ${glfw_SOURCE_DIR}/include)
|
||||||
|
set(GLFW_LIBRARIES glfw)
|
||||||
|
endif()
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Extra libraries for Freetype
|
# Extra libraries for Freetype
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user