|
@@ -79,16 +79,22 @@ elseif (XCODE)
|
|
|
endif ()
|
|
endif ()
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
|
|
|
-# Extra linker flags for linking against indirect dependencies (linking shared lib with dependencies) when in cross-compiling mode
|
|
|
|
|
|
|
+include (CheckHost)
|
|
|
|
|
+include (CheckCompilerToolchain)
|
|
|
|
|
+
|
|
|
|
|
+# Extra linker flags for linking against indirect dependencies (linking shared lib with dependencies)
|
|
|
|
|
+if (RPI)
|
|
|
|
|
+ # Extra linker flags for Raspbian because it installs VideoCore libraries in the "/opt/vc/lib" directory (no harm in doing so for other distros)
|
|
|
|
|
+ set (INDIRECT_DEPS_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} -Wl,-rpath-link,\"${RPI_SYSROOT}/opt/vc/lib\"") # RPI_SYSROOT is empty when not cross-compiling
|
|
|
|
|
+endif ()
|
|
|
if (ARM AND CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_CROSSCOMPILING)
|
|
if (ARM AND CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_CROSSCOMPILING)
|
|
|
# Cannot do this in the toolchain file because CMAKE_LIBRARY_ARCHITECTURE is not yet defined when CMake is processing toolchain file
|
|
# Cannot do this in the toolchain file because CMAKE_LIBRARY_ARCHITECTURE is not yet defined when CMake is processing toolchain file
|
|
|
- set (ROOTED_EXE_LINKER_FLAGS "-Wl,-rpath-link,\"${ARM_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}\":\"${ARM_SYSROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE}\"")
|
|
|
|
|
- set (CMAKE_REQUIRED_FLAGS ${ROOTED_EXE_LINKER_FLAGS})
|
|
|
|
|
|
|
+ set (INDIRECT_DEPS_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} -Wl,-rpath-link,\"${ARM_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}\":\"${ARM_SYSROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE}\"")
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
+set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${INDIRECT_DEPS_EXE_LINKER_FLAGS}")
|
|
|
|
|
+set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${INDIRECT_DEPS_EXE_LINKER_FLAGS}")
|
|
|
|
|
|
|
|
# Define all supported build options
|
|
# Define all supported build options
|
|
|
-include (CheckHost)
|
|
|
|
|
-include (CheckCompilerToolchain)
|
|
|
|
|
include (CMakeDependentOption)
|
|
include (CMakeDependentOption)
|
|
|
option (URHO3D_C++11 "Enable C++11 standard")
|
|
option (URHO3D_C++11 "Enable C++11 standard")
|
|
|
cmake_dependent_option (IOS "Setup build for iOS platform" FALSE "XCODE" FALSE)
|
|
cmake_dependent_option (IOS "Setup build for iOS platform" FALSE "XCODE" FALSE)
|
|
@@ -111,6 +117,7 @@ if (RPI)
|
|
|
# TODO: this logic is earmarked to be moved into SDL's CMakeLists.txt when refactoring the library dependency handling
|
|
# TODO: this logic is earmarked to be moved into SDL's CMakeLists.txt when refactoring the library dependency handling
|
|
|
find_package (VideoCore REQUIRED)
|
|
find_package (VideoCore REQUIRED)
|
|
|
include_directories (${VIDEOCORE_INCLUDE_DIRS})
|
|
include_directories (${VIDEOCORE_INCLUDE_DIRS})
|
|
|
|
|
+ link_directories (${VIDEOCORE_LIBRARY_DIRS})
|
|
|
endif ()
|
|
endif ()
|
|
|
if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
|
|
if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
|
|
|
set (URHO3D_LIB_TYPE STATIC CACHE STRING "Specify Urho3D library type, possible values are STATIC (default) and SHARED")
|
|
set (URHO3D_LIB_TYPE STATIC CACHE STRING "Specify Urho3D library type, possible values are STATIC (default) and SHARED")
|
|
@@ -722,7 +729,6 @@ else ()
|
|
|
# Not Android and not Emscripten and not MinGW derivative
|
|
# Not Android and not Emscripten and not MinGW derivative
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") # This will emit '-DREENTRANT' to compiler and '-lpthread' to linker on Linux and Mac OSX platform
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") # This will emit '-DREENTRANT' to compiler and '-lpthread' to linker on Linux and Mac OSX platform
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") # However, it may emit other equivalent compiler define and/or linker flag on other *nix platforms
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") # However, it may emit other equivalent compiler define and/or linker flag on other *nix platforms
|
|
|
- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ROOTED_EXE_LINKER_FLAGS}")
|
|
|
|
|
endif ()
|
|
endif ()
|
|
|
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -D_DEBUG")
|
|
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -D_DEBUG")
|
|
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -D_DEBUG")
|
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -D_DEBUG")
|
|
@@ -857,7 +863,7 @@ macro (enable_pch HEADER_PATHNAME)
|
|
|
# No op when PCH support is not enabled
|
|
# No op when PCH support is not enabled
|
|
|
if (URHO3D_PCH)
|
|
if (URHO3D_PCH)
|
|
|
# Get the optional LANG parameter to indicate whether the header should be treated as C or C++ header, default to C++
|
|
# Get the optional LANG parameter to indicate whether the header should be treated as C or C++ header, default to C++
|
|
|
- if ("${ARGN}" STREQUAL C) # Stringigy as the LANG paramater could be empty
|
|
|
|
|
|
|
+ if ("${ARGN}" STREQUAL C) # Stringify as the LANG paramater could be empty
|
|
|
set (EXT c)
|
|
set (EXT c)
|
|
|
set (LANG C)
|
|
set (LANG C)
|
|
|
set (LANG_H c-header)
|
|
set (LANG_H c-header)
|
|
@@ -1157,7 +1163,7 @@ macro (setup_executable)
|
|
|
endif ()
|
|
endif ()
|
|
|
endif ()
|
|
endif ()
|
|
|
if (ARG_NODEPS)
|
|
if (ARG_NODEPS)
|
|
|
- set (CMAKE_EXE_LINKER_FLAGS "${ROOTED_EXE_LINKER_FLAGS} ${LUAJIT_EXE_LINKER_FLAGS}") # Don't need other extra linker flags that are meant for main executable only
|
|
|
|
|
|
|
+ set (CMAKE_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} ${LUAJIT_EXE_LINKER_FLAGS}") # Don't need other extra linker flags that are meant for main executable only
|
|
|
else ()
|
|
else ()
|
|
|
define_dependency_libs (Urho3D)
|
|
define_dependency_libs (Urho3D)
|
|
|
endif ()
|
|
endif ()
|
|
@@ -1573,9 +1579,7 @@ macro (define_dependency_libs TARGET)
|
|
|
elseif (WIN32)
|
|
elseif (WIN32)
|
|
|
list (APPEND LIBS opengl32)
|
|
list (APPEND LIBS opengl32)
|
|
|
elseif (ANDROID OR ARM)
|
|
elseif (ANDROID OR ARM)
|
|
|
- if (NOT RPI)
|
|
|
|
|
- list (APPEND LIBS GLESv1_CM GLESv2)
|
|
|
|
|
- endif ()
|
|
|
|
|
|
|
+ list (APPEND LIBS GLESv1_CM GLESv2)
|
|
|
else ()
|
|
else ()
|
|
|
list (APPEND LIBS GL)
|
|
list (APPEND LIBS GL)
|
|
|
endif ()
|
|
endif ()
|