mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 06:06:32 +00:00
cmake: move creation of toolchain file to package/pkg-cmaketargets.mk
This also requires moving a few include directives below the "all:" target in the main Makefile, otherwise the new target to create the toolchain file in pkg-cmaketargets.mk gets used as the default make target instead of "all:". Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
parent
b7285d0058
commit
486253db30
22
Makefile
22
Makefile
@ -256,9 +256,6 @@ HOSTCC := $(CCACHE) $(HOSTCC)
|
|||||||
HOSTCXX := $(CCACHE) $(HOSTCXX)
|
HOSTCXX := $(CCACHE) $(HOSTCXX)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include toolchain/Makefile.in
|
|
||||||
include package/Makefile.in
|
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# You should probably leave this stuff alone unless you know
|
# You should probably leave this stuff alone unless you know
|
||||||
@ -268,6 +265,8 @@ include package/Makefile.in
|
|||||||
|
|
||||||
all: world
|
all: world
|
||||||
|
|
||||||
|
include toolchain/Makefile.in
|
||||||
|
include package/Makefile.in
|
||||||
include support/dependencies/dependencies.mk
|
include support/dependencies/dependencies.mk
|
||||||
|
|
||||||
# We also need the various per-package makefiles, which also add
|
# We also need the various per-package makefiles, which also add
|
||||||
@ -340,23 +339,6 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
|
|||||||
|
|
||||||
world: prepare dirs dependencies $(BASE_TARGETS) $(TARGETS_ALL)
|
world: prepare dirs dependencies $(BASE_TARGETS) $(TARGETS_ALL)
|
||||||
|
|
||||||
$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
|
|
||||||
mkdir -p $(@D)
|
|
||||||
@echo -en "\
|
|
||||||
set(CMAKE_SYSTEM_NAME Linux)\n\
|
|
||||||
set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
|
|
||||||
set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
|
|
||||||
set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
|
|
||||||
set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
|
|
||||||
set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
|
|
||||||
set(CMAKE_PROGRAM_PATH \"$(HOST_DIR)/usr/bin\")\n\
|
|
||||||
set(CMAKE_FIND_ROOT_PATH \"$(STAGING_DIR)\")\n\
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
|
|
||||||
set(ENV{PKG_CONFIG_SYSROOT_DIR} \"$(STAGING_DIR)\")\n\
|
|
||||||
" > $@
|
|
||||||
|
|
||||||
.PHONY: all world dirs clean distclean source outputmakefile \
|
.PHONY: all world dirs clean distclean source outputmakefile \
|
||||||
$(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
|
$(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
|
||||||
$(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
|
$(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
|
||||||
|
@ -197,3 +197,25 @@ else
|
|||||||
$(call CMAKETARGETS_INNER,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
|
$(call CMAKETARGETS_INNER,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
|
||||||
endif
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Generation of the CMake toolchain file
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
|
||||||
|
@mkdir -p $(@D)
|
||||||
|
@echo -en "\
|
||||||
|
set(CMAKE_SYSTEM_NAME Linux)\n\
|
||||||
|
set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
|
||||||
|
set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
|
||||||
|
set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
|
||||||
|
set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
|
||||||
|
set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
|
||||||
|
set(CMAKE_PROGRAM_PATH \"$(HOST_DIR)/usr/bin\")\n\
|
||||||
|
set(CMAKE_FIND_ROOT_PATH \"$(STAGING_DIR)\")\n\
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
|
||||||
|
set(ENV{PKG_CONFIG_SYSROOT_DIR} \"$(STAGING_DIR)\")\n\
|
||||||
|
" > $@
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user