summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a5a37a1ee..04783f2ef 100644
--- a/Makefile
+++ b/Makefile
@@ -363,7 +363,7 @@ $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
$(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
-$(BASE_TARGETS): dirs
+$(BASE_TARGETS): dirs $(O)/toolchainfile.cmake
$(BUILD_DIR)/buildroot-config/auto.conf: $(CONFIG_DIR)/.config
$(MAKE) $(EXTRAMAKEARGS) silentoldconfig
@@ -372,6 +372,21 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
world: prepare dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
+$(O)/toolchainfile.cmake:
+ @echo -en "\
+ set(CMAKE_SYSTEM_NAME Linux)\n\
+ set(CMAKE_C_COMPILER $(CMAKE_TARGET_CC))\n\
+ set(CMAKE_CXX_COMPILER $(CMAKE_TARGET_CXX))\n\
+ set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(CMAKE_TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
+ set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(CMAKE_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 \
$(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \