mirror of
https://github.com/edubart/otclient.git
synced 2025-05-07 12:59:21 +02:00
Fix & enable by default static linking on macOS (#1133)
This commit is contained in:
parent
ba706fc5c3
commit
69e44a3722
2
.github/workflows/build-vcpkg.yml
vendored
2
.github/workflows/build-vcpkg.yml
vendored
@ -55,7 +55,7 @@ jobs:
|
|||||||
triplet: x64-osx
|
triplet: x64-osx
|
||||||
packages: >
|
packages: >
|
||||||
boost-iostreams boost-asio boost-system boost-variant boost-lockfree glew
|
boost-iostreams boost-asio boost-system boost-variant boost-lockfree glew
|
||||||
boost-filesystem boost-uuid openal-soft libogg libvorbis zlib opengl
|
boost-filesystem boost-uuid libogg libvorbis zlib opengl
|
||||||
exclude:
|
exclude:
|
||||||
- name: windows-msvc
|
- name: windows-msvc
|
||||||
luajit: off
|
luajit: off
|
||||||
|
@ -43,6 +43,10 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON)
|
|||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} ${framework_LIBRARIES})
|
target_link_libraries(${PROJECT_NAME} ${framework_LIBRARIES})
|
||||||
|
|
||||||
|
if(APPLE AND USE_STATIC_LIBS)
|
||||||
|
target_link_libraries(${PROJECT_NAME} "-framework Foundation" "-framework IOKit")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_PCH)
|
if(USE_PCH)
|
||||||
include(cotire)
|
include(cotire)
|
||||||
cotire(${PROJECT_NAME})
|
cotire(${PROJECT_NAME})
|
||||||
|
@ -78,7 +78,7 @@ void Container::onAddItem(const ItemPtr& item, int slot)
|
|||||||
|
|
||||||
ItemPtr Container::findItemById(uint itemId, int subType)
|
ItemPtr Container::findItemById(uint itemId, int subType)
|
||||||
{
|
{
|
||||||
for(const ItemPtr item : m_items)
|
for(const ItemPtr& item : m_items)
|
||||||
if(item->getId() == itemId && (subType == -1 || item->getSubType() == subType))
|
if(item->getId() == itemId && (subType == -1 || item->getSubType() == subType))
|
||||||
return item;
|
return item;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -133,14 +133,13 @@ set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/luafunctions.cpp
|
|||||||
|
|
||||||
# some build options
|
# some build options
|
||||||
option(LUAJIT "Use lua jit" OFF)
|
option(LUAJIT "Use lua jit" OFF)
|
||||||
|
option(USE_STATIC_LIBS "Don't use shared libraries (dlls)" ON)
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
option(CRASH_HANDLER "Generate crash reports" ON)
|
option(CRASH_HANDLER "Generate crash reports" ON)
|
||||||
option(USE_STATIC_LIBS "Don't use shared libraries (dlls)" ON)
|
|
||||||
option(USE_LIBCPP "Use the new libc++ library instead of stdc++" OFF)
|
option(USE_LIBCPP "Use the new libc++ library instead of stdc++" OFF)
|
||||||
option(USE_LTO "Use link time optimizations" OFF)
|
option(USE_LTO "Use link time optimizations" OFF)
|
||||||
else()
|
else()
|
||||||
set(CRASH_HANDLER OFF)
|
set(CRASH_HANDLER OFF)
|
||||||
set(USE_STATIC_LIBS OFF)
|
|
||||||
set(USE_LIBCPP ON)
|
set(USE_LIBCPP ON)
|
||||||
endif()
|
endif()
|
||||||
set(BUILD_COMMIT "devel" CACHE STRING "Git commit string (intended for releases)")
|
set(BUILD_COMMIT "devel" CACHE STRING "Git commit string (intended for releases)")
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
FIND_PATH(LUA_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES lua51 lua5-1 lua5.1 lua)
|
FIND_PATH(LUA_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES lua51 lua5-1 lua5.1 lua)
|
||||||
FIND_LIBRARY(LUA_LIBRARY NAMES)
|
FIND_LIBRARY(LUA_LIBRARY NAMES)
|
||||||
SET(_LUA_STATIC_LIBS lua51.a lua5.1.a lua-5.1.a lua.a)
|
SET(_LUA_STATIC_LIBS liblua51.a liblua5.1.a liblua-5.1.a liblua.a)
|
||||||
SET(_LUA_SHARED_LIBS lua51 lua5.1 lua-5.1 lua)
|
SET(_LUA_SHARED_LIBS lua51 lua5.1 lua-5.1 lua)
|
||||||
IF(USE_STATIC_LIBS)
|
IF(USE_STATIC_LIBS)
|
||||||
FIND_LIBRARY(LUA_LIBRARY NAMES ${_LUA_STATIC_LIBS} ${_LUA_SHARED_LIBS})
|
FIND_LIBRARY(LUA_LIBRARY NAMES ${_LUA_STATIC_LIBS} ${_LUA_SHARED_LIBS})
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
# LUAJIT_LIBRARY - the lua library
|
# LUAJIT_LIBRARY - the lua library
|
||||||
|
|
||||||
FIND_PATH(LUAJIT_INCLUDE_DIR NAMES luajit.h PATH_SUFFIXES luajit luajit-2.0 luajit-2.1)
|
FIND_PATH(LUAJIT_INCLUDE_DIR NAMES luajit.h PATH_SUFFIXES luajit luajit-2.0 luajit-2.1)
|
||||||
SET(_LUAJIT_STATIC_LIBS luajit-5.1.a lua51.a)
|
SET(_LUAJIT_STATIC_LIBS libluajit-5.1.a libluajit.a liblua51.a)
|
||||||
SET(_LUAJIT_SHARED_LIBS luajit-5.1 lua51)
|
SET(_LUAJIT_SHARED_LIBS luajit-5.1 luajit lua51)
|
||||||
IF(USE_STATIC_LIBS)
|
IF(USE_STATIC_LIBS)
|
||||||
FIND_LIBRARY(LUAJIT_LIBRARY NAMES ${_LUAJIT_STATIC_LIBS} ${_LUAJIT_SHARED_LIBS})
|
FIND_LIBRARY(LUAJIT_LIBRARY NAMES ${_LUAJIT_STATIC_LIBS} ${_LUAJIT_SHARED_LIBS})
|
||||||
ELSE()
|
ELSE()
|
||||||
|
@ -54,7 +54,7 @@ ConfigPtr ConfigManager::getSettings()
|
|||||||
|
|
||||||
ConfigPtr ConfigManager::get(const std::string& file)
|
ConfigPtr ConfigManager::get(const std::string& file)
|
||||||
{
|
{
|
||||||
for(const ConfigPtr config : m_configs) {
|
for(const ConfigPtr& config : m_configs) {
|
||||||
if(config->getFileName() == file) {
|
if(config->getFileName() == file) {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,13 @@
|
|||||||
|
|
||||||
#define AL_LIBTYPE_STATIC
|
#define AL_LIBTYPE_STATIC
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
#include <OpenAL/al.h>
|
||||||
|
#include <OpenAL/alc.h>
|
||||||
|
#else
|
||||||
#include <AL/al.h>
|
#include <AL/al.h>
|
||||||
#include <AL/alc.h>
|
#include <AL/alc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
class SoundManager;
|
class SoundManager;
|
||||||
class SoundSource;
|
class SoundSource;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user