Skip to content

external_deps: revamp lib build, add cmake and configure wrapper, update lib feature disablement, update lib versions #1433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ else()
endif()

# Dependencies version, this must match the number in external_deps/build.sh
set(DEPS_VERSION 10)
set(DEPS_VERSION 11)

option(USE_EXTERNAL_DEPS "Download or reuse dependencies from EXTERNAL_DEPS_DIR (mandatory for building and running NaCl .nexe binaries)." ON)

Expand Down Expand Up @@ -482,7 +482,7 @@ if (DEPS_DIR)
# Add to paths
set(CMAKE_FIND_ROOT_PATH ${DEPS_DIR} ${CMAKE_FIND_ROOT_PATH})
set(CMAKE_INCLUDE_PATH ${DEPS_DIR} ${DEPS_DIR}/include ${CMAKE_INCLUDE_PATH})
set(CMAKE_FRAMEWORK_PATH ${DEPS_DIR} ${CMAKE_FRAMEWORK_PATH})
set(CMAKE_FRAMEWORK_PATH ${DEPS_DIR}/lib ${CMAKE_FRAMEWORK_PATH})
set(CMAKE_PREFIX_PATH ${DEPS_DIR} ${CMAKE_PREFIX_PATH})
if (DAEMON_PARENT_SCOPE_DIR)
# Also set parent scope so the top level CMakeLists can find precompiled deps
Expand Down Expand Up @@ -1055,11 +1055,16 @@ if (DEPS_DIR AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMM

# Mac requires some libraries from external_deps
if (APPLE)
add_custom_command(TARGET runtime_deps PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${DEPS_DIR}/SDL2.framework
${FULL_OUTPUT_DIR}/SDL2.framework
)
file(GLOB RUNTIME_FRAMEWORKS ${DEPS_DIR}/lib/*.framework)
foreach(RUNTIME_FRAMEWORK ${RUNTIME_FRAMEWORKS})
get_filename_component(RUNTIME_FRAMEWORK_NAME ${RUNTIME_FRAMEWORK} NAME)
add_custom_command(TARGET runtime_deps PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${RUNTIME_FRAMEWORK}
${FULL_OUTPUT_DIR}/${RUNTIME_FRAMEWORK_NAME}
)
endforeach()

file(GLOB RUNTIME_LIBS ${DEPS_DIR}/lib/*.dylib)
foreach(RUNTIME_LIB ${RUNTIME_LIBS})
add_custom_command(TARGET runtime_deps PRE_BUILD
Expand Down
2 changes: 1 addition & 1 deletion cmake/cross-toolchain-mingw32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ )
set( CMAKE_RC_COMPILER i686-w64-mingw32-windres )

# Target prefix
set( CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 )
set( CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32;${CMAKE_PREFIX_PATH} )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely this doesn't do anything, as the toolchain file is executed before CMakeLists.txt, so CMAKE_PREFIX_PATH wouldn't be set (unless you set it on the command line.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh it's for building external_deps, not compiling the game. Could use a comment


# Find programs using host paths and headers/libraries using target paths
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
Expand Down
2 changes: 1 addition & 1 deletion cmake/cross-toolchain-mingw64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set( CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ )
set( CMAKE_RC_COMPILER x86_64-w64-mingw32-windres )

# Target prefix
set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 )
set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32;${CMAKE_PREFIX_PATH} )

# Find programs using host paths and headers/libraries using target paths
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
Expand Down
Loading
Loading