Skip to content

Commit 8c7cd0c

Browse files
committed
depends: More robust cmake invocation
Specify well-known env vars instead of using a workaround to split up CC and CXX.
1 parent 3ecf0ec commit 8c7cd0c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

depends/funcs.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ ifneq ($($(1)_ldflags),)
157157
$(1)_autoconf += LDFLAGS="$$($(1)_ldflags)"
158158
endif
159159

160-
$(1)_cmake=cmake -DCMAKE_INSTALL_PREFIX=$($($(1)_type)_prefix)
160+
$(1)_cmake=env CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" CFLAGS="$$($(1)_cflags)" CXXFLAGS="$$($(1)_cxxflags)" cmake -DCMAKE_INSTALL_PREFIX:PATH=$($($(1)_type)_prefix)
161161
ifneq ($($(1)_type),build)
162162
ifneq ($(host),$(build))
163-
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) -DCMAKE_SYSROOT=$(host_prefix)
164-
$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) -DCMAKE_C_COMPILER=$(firstword $($($(1)_type)_CC)) -DCMAKE_C_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CC))"
165-
$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) -DCMAKE_CXX_COMPILER=$(firstword $($($(1)_type)_CXX)) -DCMAKE_CXX_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CXX))"
163+
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system)
164+
$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host)
165+
$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host)
166166
endif
167167
endif
168168
endef

0 commit comments

Comments
 (0)