aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-08-27 20:55:11 +0200
committerGitHub <noreply@github.com>2019-08-27 20:55:11 +0200
commita851090dec8600b38d54cd65264e4146ad02b1e0 (patch)
treec749f12ab30b1e97631f3cffde07329c1f054cc3
parent4cedc8444e20b5b9a558c66a96851c39abedef70 (diff)
downloadrneovim-a851090dec8600b38d54cd65264e4146ad02b1e0.tar.gz
rneovim-a851090dec8600b38d54cd65264e4146ad02b1e0.tar.bz2
rneovim-a851090dec8600b38d54cd65264e4146ad02b1e0.zip
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
-rw-r--r--third-party/CMakeLists.txt12
-rw-r--r--third-party/cmake/BuildGperf.cmake1
2 files changed, 10 insertions, 3 deletions
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index 3bfa3fdf39..849b66742e 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -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
diff --git a/third-party/cmake/BuildGperf.cmake b/third-party/cmake/BuildGperf.cmake
index e922f71ed5..71c3cc1eef 100644
--- a/third-party/cmake/BuildGperf.cmake
+++ b/third-party/cmake/BuildGperf.cmake
@@ -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.