Merge #19685: depends: CMake invocation cleanup
b893688357depends: Specify LDFLAGS to cmake as well (Carl Dong)b3f541f618depends: Prepend CPPFLAGS to C{,XX}FLAGS for CMake (Carl Dong)8e121e5509depends: Cleanup CMake invocation (Carl Dong)8c7cd0c6d9depends: More robust cmake invocation (Carl Dong)3ecf0eca63depends: Use $($(package)_cmake) instead of cmake (Carl Dong) Pull request description: - Use `$($(package)_cmake)` instead of invoking `cmake` directly - Use well-known env vars instead of overriding CMake variables ACKs for top commit: ryanofsky: Code review ACKb893688357. Only changes since last review are new commits adding whitespace, cppflags and ldflags to cmake invocation Tree-SHA512: cfcd8cc9dcd0b336cf48b82fca9fe4bbc7930ed397cb7a68a07066680eb4c1906a6a9b5bd2589b4b4999e8f16232fa30ee9b376b60f4456d0fff931fbf9cc19a
This commit is contained in:
3 files changed
+11
-6
No files matched your search
+9
-4
@@ -157,12 +157,17 @@ ifneq ($($(1)_ldflags),)
|
|||||||
$(1)_autoconf += LDFLAGS="$$($(1)_ldflags)"
|
$(1)_autoconf += LDFLAGS="$$($(1)_ldflags)"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(1)_cmake=cmake -DCMAKE_INSTALL_PREFIX=$($($(1)_type)_prefix)
|
$(1)_cmake=env CC="$$($(1)_cc)" \
|
||||||
|
CFLAGS="$$($(1)_cppflags) $$($(1)_cflags)" \
|
||||||
|
CXX="$$($(1)_cxx)" \
|
||||||
|
CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \
|
||||||
|
LDFLAGS="$$($(1)_ldflags)" \
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)"
|
||||||
ifneq ($($(1)_type),build)
|
ifneq ($($(1)_type),build)
|
||||||
ifneq ($(host),$(build))
|
ifneq ($(host),$(build))
|
||||||
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) -DCMAKE_SYSROOT=$(host_prefix)
|
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system)
|
||||||
$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) -DCMAKE_C_COMPILER=$(firstword $($($(1)_type)_CC)) -DCMAKE_C_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CC))"
|
$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host)
|
||||||
$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) -DCMAKE_CXX_COMPILER=$(firstword $($($(1)_type)_CXX)) -DCMAKE_CXX_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CXX))"
|
$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endef
|
endef
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ endef
|
|||||||
# Starting with 10.1, GCC defaults to -fno-common, resulting in linking errors.
|
# Starting with 10.1, GCC defaults to -fno-common, resulting in linking errors.
|
||||||
# Pass -fcommon to retain the legacy behaviour.
|
# Pass -fcommon to retain the legacy behaviour.
|
||||||
define $(package)_config_cmds
|
define $(package)_config_cmds
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) -DCMAKE_C_FLAGS="-fcommon"
|
$($(package)_cmake) -DCMAKE_C_FLAGS="$$($(1)_cflags) -fcommon"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ define $(package)_preprocess_cmds
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_config_cmds
|
define $(package)_config_cmds
|
||||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix) -DCMAKE_C_FLAGS="-Wl,--build-id=none" ..
|
$($(package)_cmake) -DCMAKE_C_FLAGS="$$($(1)_cflags) -Wl,--build-id=none" ..
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
|
|||||||
Reference in new issue
Block a user