Skip to content

Commit

Permalink
FIX: GCC14 compatible build (#1023)
Browse files Browse the repository at this point in the history
* FIX: GCC14 compatible build

* gitignore: added linux release files

* CMAKE: find glfw3 library name

* CMAKE: fix win32 not using find_package

* CMAKE: fix apple build

* CMAKE: add libglfw3-dev to linux build

* FIX: enable HiDPI scaling on linux

* GCC14: Fix linux use of lib64 libraries

* GCC14: use lib64 folder if it exists

* github actions: Ubuntu lib/lib64 test
  • Loading branch information
perroboc authored Sep 5, 2024
1 parent 0c86cdf commit 85a2598
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install -y libpulse-dev libglvnd-dev libx11-dev libopenal-dev libvulkan-dev \
sudo apt-get install -y libpulse-dev libglvnd-dev libx11-dev libopenal-dev libvulkan-dev \
libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libgtk-3-dev ninja-build dotnet-sdk-3.1 \
xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev zenity
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Dev/release/runtimes/
Dev/release/resources/fonts/
Dev/release/resources/icons/
Dev/release/tools/
Dev/release/ref/
Dev/release/createdump
Dev/release/Effekseer*

Dev/Cpp/include/
Dev/Cpp/lib/
Expand All @@ -57,3 +60,5 @@ mono_crash.*.json
mono_crash.*.blob
Script/__pycache__/aceutils.cpython-37.pyc
Tool/fbxsdk

EffekseerTool/
50 changes: 33 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,13 @@ if(BUILD_VIEWER)
)
list(APPEND EFK_THIRDPARTY_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/libpng/include)
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/libpng/lib)
if(EXISTS "${ExternalProject_libpng_INSTALL_DIR}/lib64")
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/libpng/lib64)
endif()

if(MSVC)
set(LIBPNG_LIB_DEBUG "libpng16_staticd")

set(LIBPNG_LIB_RELEASE "libpng16_static")
elseif(BUILD_WITH_POSTFIX)
set(LIBPNG_LIB_DEBUG "png16d")
Expand Down Expand Up @@ -282,6 +286,10 @@ if(BUILD_VIEWER)

list(APPEND EFK_THIRDPARTY_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/libgd/include)
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/libgd/lib)
if(EXISTS "${ExternalProject_libgd_INSTALL_DIR}/lib64")
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/libgd/lib64)
endif()


# OpenSoundMixer
ExternalProject_Add(
Expand Down Expand Up @@ -311,23 +319,28 @@ endif()
if(BUILD_VIEWER OR BUILD_TEST)
# glew
if(NOT APPLE)
ExternalProject_Add(
ExternalProject_glew
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Downloads/glew
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Build/glew
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Dev/3rdPartyPatch/glew-CMakeLists.txt <SOURCE_DIR>/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew
-DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_CURRENT_SOURCE_DIR}/Dev/CFlagOverrides.cmake
-DEFK_USE_MSVC_RUNTIME_LIBRARY_DLL=${USE_MSVC_RUNTIME_LIBRARY_DLL}
-DSANITIZE_ENABLED=${SANITIZE_ENABLED}
-DBUILD_SHARED_LIBS=OFF
-DGLEW_BUILD_INFO=OFF
-DBUILD_UTILS=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true
)
list(APPEND EFK_THIRDPARTY_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew/include)
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew/lib)
ExternalProject_Add(
ExternalProject_glew
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Downloads/glew
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Build/glew
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Dev/3rdPartyPatch/glew-CMakeLists.txt <SOURCE_DIR>/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew
-DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_CURRENT_SOURCE_DIR}/Dev/CFlagOverrides.cmake
-DEFK_USE_MSVC_RUNTIME_LIBRARY_DLL=${USE_MSVC_RUNTIME_LIBRARY_DLL}
-DSANITIZE_ENABLED=${SANITIZE_ENABLED}
-DBUILD_SHARED_LIBS=OFF
-DGLEW_BUILD_INFO=OFF
-DBUILD_UTILS=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true
)

list(APPEND EFK_THIRDPARTY_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew/include)
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew/lib)
if(EXISTS "${ExternalProject_glew_INSTALL_DIR}/lib64")
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glew/lib64)
endif()

endif()
endif()

Expand Down Expand Up @@ -360,6 +373,9 @@ if(BUILD_VIEWER OR BUILD_EXAMPLES OR BUILD_TEST)

list(APPEND EFK_THIRDPARTY_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glfw/include)
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glfw/lib)
if(EXISTS "${ExternalProject_glfw_INSTALL_DIR}/lib64")
list(APPEND EFK_THIRDPARTY_LIBRARY_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/Install/glfw/lib64)
endif()
endif()

list(APPEND EFK_THIRDPARTY_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/Dev/Cpp/3rdParty/flatbuffers/include)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ class span FLATBUFFERS_FINAL_CLASS {
private:
// This is a naive implementation with 'count_' member even if (Extent != dynamic_extent).
pointer const data_;
const size_type count_;
size_type count_; // https://github.com/google/flatbuffers/pull/7227
};

#if !defined(FLATBUFFERS_SPAN_MINIMAL)
Expand Down
6 changes: 6 additions & 0 deletions Dev/Cpp/EditorCommon/GUI/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ bool MainWindow::InitializeInternal(const char16_t* title, MainWindowState state
float yscale = 1.0f;
glfwGetMonitorContentScale(primary, &xscale, &yscale);
dpiScale_ = xscale;
#elif defined(__linux__)
GLFWmonitor* primary = glfwGetPrimaryMonitor();
float xscale = 1.0f;
float yscale = 1.0f;
glfwGetMonitorContentScale(primary, &xscale, &yscale);
dpiScale_ = xscale;
#endif

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "../Common/ShaderGeneratorCommon.h"

#include <iostream>
#include <algorithm>
#undef min
#undef max

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "../Common/ShaderGeneratorCommon.h"

#include <iostream>
#include <algorithm>

namespace Effekseer
{
Expand Down
2 changes: 2 additions & 0 deletions Dev/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rm --force release/*.pdb
rm --force release/Effekseer
2 changes: 1 addition & 1 deletion Tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif()

project(Tools)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)

if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
Expand Down
4 changes: 3 additions & 1 deletion docs/Development/HowToBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Requirements
- g++
- [.Net6.0 SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu)

- libx11-dev libgl1-mesa-dev libxrandr-dev libxi-dev x11proto-xf86vidmode-dev libx11-xcb-dev xorg-dev libglu1-mesa-dev libpulse-dev libgtk-3-dev libopenal-dev python3-distutils zenity
- Required packages:
- Ubuntu: `libx11-dev libgl1-mesa-dev libxrandr-dev libxi-dev x11proto-xf86vidmode-dev libx11-xcb-dev xorg-dev libglu1-mesa-dev libpulse-dev libgtk-3-dev libopenal-dev python3-distutils zenity`
- Fedora 40: `gtk3-devel pulseaudio-libs-devel openal-soft-devel mesa-libGLU-devel libX11-devel libxcb-devel libXi-devel libXrandr-devel mesa-libGL-devel python3 dotnet zenity ninja-build`

Get code and resources
----------
Expand Down
Empty file modified release_tool.sh
100644 → 100755
Empty file.

0 comments on commit 85a2598

Please sign in to comment.