static build fixes

This commit is contained in:
Crypto City 2020-07-02 17:30:19 +00:00
parent c6bfc7d7ec
commit 478d92c59d
5 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,8 @@ set (TARGET_NAME FreeType)
add_definitions (-DFT2_BUILD_LIBRARY)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -DPIC")
# Rename z_verbose and z_error symbols to prevent Clang duplicate symbol linker error (clash with Assimp) on debug build
if (XCODE OR CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions (-Dz_verbose=ft2_z_verbose -Dz_error=ft2_z_error)

View File

@ -26,6 +26,8 @@ set (TARGET_NAME GLEW)
# Define preprocessor macros
add_definitions (-DGLEW_STATIC -DGLEW_NO_GLU)
add_definitions ("-fPIC -DPIC")
# Define source files
define_source_files (GLOB_CPP_PATTERNS *.c)

View File

@ -26,6 +26,8 @@ set (TARGET_NAME LZ4)
# Define source files
define_source_files (GLOB_CPP_PATTERNS *.c)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -DPIC")
# Setup target
setup_library ()

View File

@ -485,6 +485,9 @@ if(USE_GCC OR USE_CLANG)
# Urho3D - Wayland quick fix
list(APPEND EXTRA_CFLAGS "-fcommon")
# always use PIC
list(APPEND EXTRA_CFLAGS "-fPIC")
endif()
if(ASSEMBLY)

View File

@ -580,6 +580,7 @@ else ()
set (CMAKE_CXX_VISIBILITY_PRESET hidden)
set (CMAKE_VISIBILITY_INLINES_HIDDEN true)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
if (NOT ANDROID) # Most of the flags are already setup in Android toolchain file
if (ARM AND CMAKE_SYSTEM_NAME STREQUAL Linux)
# Common compiler flags for aarch64-linux-gnu and arm-linux-gnueabihf, we do not support ARM on Windows for now