Skip to content

Commit

Permalink
Merge branch 'fix_shared_library_build' into 'master'
Browse files Browse the repository at this point in the history
Build fixes related to shared libraries and position independent code

See merge request OpenMW/openmw!3878
  • Loading branch information
psi29a committed Feb 20, 2024
2 parents 4de326a + efbc37d commit 8c8fffc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Ubuntu_GCC_Debug:
CCACHE_SIZE: 3G
CMAKE_BUILD_TYPE: Debug
CMAKE_CXX_FLAGS_DEBUG: -O0
BUILD_SHARED_LIBS: 1
# When CCache doesn't exist (e.g. first build on a fork), build takes more than 1h, which is the default for forks.
timeout: 2h

Expand Down
2 changes: 1 addition & 1 deletion CI/before_script.linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ declare -a CMAKE_CONF_OPTS=(
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_INSTALL_PREFIX=install
-DBUILD_SHARED_LIBS=OFF
-DBUILD_SHARED_LIBS="${BUILD_SHARED_LIBS:-OFF}"
-DUSE_SYSTEM_TINYXML=ON
-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=ON
-DOPENMW_CXX_FLAGS="-Werror -Werror=implicit-fallthrough" # flags specific to OpenMW project
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ else()
set (OPENCS_OPENMW_CFG "")
endif(APPLE)

add_library(openmw-cs-lib
add_library(openmw-cs-lib STATIC
${OPENCS_SRC}
${OPENCS_UI_HDR}
${OPENCS_MOC_SRC}
Expand Down
8 changes: 3 additions & 5 deletions components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,9 @@ if (USE_QT)
QT_WRAP_UI(ESM_UI_HDR ${ESM_UI})
endif()

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE)
add_definitions(-fPIC)
endif()
endif ()
if (ANDROID)
set_property(TARGET components PROPERTY POSTION_INDEPENDENT_CODE ON)
endif()

include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})

Expand Down

0 comments on commit 8c8fffc

Please sign in to comment.