build: third-party: enable CXX language earlier (#10862)

This is required for `CMAKE_CXX_COMPILER` to be set already, not only
after including third-party/cmake/BuildGperf.cmake.

Closes https://github.com/neovim/neovim/pull/10860.
Ref: 31f879983f
This commit is contained in:
Daniel Hahler 2019-08-27 20:55:11 +02:00 committed by GitHub
parent 4cedc8444e
commit a851090dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -97,11 +97,19 @@ else()
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER}")
endif()
set(DEPS_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
if(USE_BUNDLED_GPERF)
enable_language(CXX)
endif()
if(CMAKE_CXX_COMPILER)
set(DEPS_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
endif()
if(CMAKE_OSX_SYSROOT)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
set(DEPS_CXX_COMPILER "${DEPS_CXX_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
if(DEPS_CXX_COMPILER)
set(DEPS_CXX_COMPILER "${DEPS_CXX_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
endif()
endif()
# Cross compiling: use these for dependencies built for the

View File

@ -2,7 +2,6 @@
# cross compiling we still want to build for the HOST system, whenever
# writing a recipe that is meant for cross-compile, use the HOSTDEPS_* variables
# instead of DEPS_* - check the main CMakeLists.txt for a list.
enable_language(CXX)
# BuildGperf(CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...)
# Reusable function to build Gperf, wraps ExternalProject_Add.