aboutsummaryrefslogtreecommitdiffstats
path: root/include/cmake.mk
Commit message (Collapse)AuthorAgeFilesLines
* include/cmake.mk: add support for overriding the host install prefixFelix Fietkau2021-11-041-1/+2
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/cmake.mk: fix host builds with CMAKE_BINARY_SUBDIRFelix Fietkau2021-10-201-4/+6
| | | | | | Use it in the same way as for target builds Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: do not override DESTDIR for cmake ninja host buildsFelix Fietkau2021-06-121-2/+2
| | | | | | The full prefix is already passed to cmake Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: use ninja for cmake packages by defaultFelix Fietkau2021-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | Speed goes from: Executed in 178.08 secs fish external usr time 20.16 mins 509.00 micros 20.16 mins sys time 2.88 mins 39.00 micros 2.88 mins To: Executed in 175.90 secs fish external usr time 20.19 mins 0.00 micros 20.19 mins sys time 2.85 mins 497.00 micros 2.85 mins Tested with "time make -j 12" on AMD Ryzen 3600 When building individual packages, the build time difference is often significantly bigger than that. Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Rosen Penev <rosenp@gmail.com>
* build: add ninja build tool and make it available for cmakeFelix Fietkau2021-06-121-0/+34
| | | | | | | | | | | | ninja is faster at building cmake packages than make, and according to reports also more reliable at handling parallel builds This commit includes a patch that adds GNU make jobserver support, in order to allow more precise control over the number of parallel tasks Enable parallel build by default for packages using ninja Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Rosen Penev <rosenp@gmail.com>
* Revert "build: replace which with Bash command built-in"Clemens Fruhwirth2021-03-031-1/+1
| | | | | | | | | | | This reverts commit c7aec47e5e3a3ff7b5fdaa11cd1e62cae6746acb. The original commit replaces 'which' with 'command'. Sadly most of them are not equivalent and for 'which -a', there is no easy replacements that would not reimplement PATH parsing logic. Hence revert. Keeping a dependency on which is absolutely fine. Signed-off-by: Clemens Fruhwirth <clemens@endorphin.org>
* build: replace which with Bash command built-inPetr Štetiar2021-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | `which` utility is not shipped by default for example on recent Arch Linux and then any steps relying on its presence fails, like for example following Python3 prereq build check: $ python3 --version Python 3.9.1 $ make /bin/sh: line 1: which: command not found /bin/sh: line 1: which: command not found /bin/sh: line 1: which: command not found ... Checking 'python3'... failed. ... Fix this by switching to Bash builtin `command` which should provide same functionality. Fixes: FS#3525 Signed-off-by: Petr Štetiar <ynezz@true.cz>
* include/cmake.mk: Fix the bug in ccache supportHirokazu MORIKAWA2020-12-211-18/+14
| | | | | | | | | | Fix the bug in ccache support due to this change. https://github.com/openwrt/openwrt/commit/bfc433efd4a0c6875a92981d1bd2a5e3e60c61c6 The new cmake uses this for the wrapper. https://cmake.org/cmake/help/v3.19/prop_tgt/LANG_COMPILER_LAUNCHER.html Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
* cmake.mk,rules.mk: fix host builds using CMake and ccachePetr Štetiar2020-11-281-2/+16
| | | | | | | | | | | | | | Commit f98878e4c17d ("cmake.mk: set C/CXX compiler for host builds as well") has introduced regression as it didn't taken usage of ccache into the account so fix it by handling ccache use cases as well. In order to get this working we need to export HOSTCXX_NOCACHE in rules.mk as well. Fixes: f98878e4c17d ("cmake.mk: set C/CXX compiler for host builds as well") Reported-by: Ansuel Smith <ansuelsmth@gmail.com> Tested-by: Ansuel Smith <ansuelsmth@gmail.com> Signed-off-by: Petr Štetiar <ynezz@true.cz>
* cmake.mk: set C/CXX compiler for host builds as wellRosen Penev2020-11-271-0/+2
| | | | | | | Without this, cmake will use whatever CC/CXX is set to, which could be clang. In that case, at least libjson-c/host will fail to compile. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* build: support cmake verbose for host buildsFelix Fietkau2020-11-141-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* cmake: Disable use of package registriesJeffery To2020-08-241-0/+12
| | | | | | | | | | | | | | | | | CMake provides a user package registry (stored in ~/.cmake/packages) and a system package registry (not available on non-Windows platforms). The "export(PACKAGE)" command may store information in the user package registry, and the "find_package()" command may search both user and system package registries for information. This sets various variables to disable the use of these package registries (both saving and retrieval of package information). This also sets deprecated variables that perform similar functions, in case external toolchains include older versions of CMake. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* cmake: Install host packages to lib instead of lib64Rosen Penev2019-12-231-0/+1
| | | | | | | | | Several CMake packages such as log4cplus and protobuf(-c) install to lib64 instead of lib on some hosts. This completely breaks rpath linking. Override it globally to avoid fixing each package individually. Signed-off-by: Rosen Penev <rosenp@gmail.com> Tested-by: Sebastian Kemper <sebastian_ml@gmx.net>
* build: use CMAKE_SOURCE_SUBDIR variable to cmake.mkAmol Bhave2018-09-291-2/+2
| | | | | | | | Sometimes, the CMakeLists.txt file is not in the root directory of a repo. In those cases, the CMAKE_SOURCE_SUBDIR variable can be specified to use CMakeLists.txt from a subdirectory instead. Signed-off-by: Amol Bhave <ambhave@fb.com>
* cmake: skip build system check on compileFelix Fietkau2017-02-211-0/+4
| | | | | | | | | | | | | cmake checks the build system and its variables on its own to detect if the makefiles need to be regenerated. Unfortunately this can invalidate overrides passed in the Build/Configure step. On non-Linux systems this breaks the build when switching between targets of the same package architecture. Fix this by forcibly disabling the build system check and relying on the LEDE build system to take care of these things Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common ↵Matthias Schiffer2017-01-181-1/+1
| | | | | | | | | | | | | directory for all targets Using a single host package staging dir (and build dir) significantly speeds up builds when multiple targets are built in succession, especially for large host packages like NodeJS. $(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most places; it is still used as destination for host files in Build/InstallDev. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* build: use CXXFLAGS if definedHauke Mehrtens2016-10-131-1/+1
| | | | | | | | | | | Instead of using TARGET_CFLAGS and EXTRA_CFLAGS in cmake and scons build use the TARGET_CXXFLAGS and EXTRA_CXXFLAGS like it is done for normal make and configure. configure used TARGET_CXXFLAGS and EXTRA_CFLAGS for the CXXFLAGS. The package-default.mk sets "EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)" so using EXTRA_CXXFLAGS flags should be save. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* include/cmake.mk: fix host buildsFelix Fietkau2016-07-291-1/+2
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* cmake: include/cmake.mk add CMAKE_BINARY_SUBDIR to allow out of source tree ↵Luke McKee2016-07-291-2/+5
| | | | | | | | | | | | builds Some packages need out of source tree building with cmake, for example when building kernel modules. See an example here: https://sourceforge.net/p/accel-ppp/code/ci/master/tree/README Signed-off-by: Luke McKee <hojuruku@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup, rework]
* include/cmake.mk: Add helper macro to handle conditionals for CMake boolean ↵Vasilis Tsiligiannis2016-04-131-0/+2
| | | | | | | | type variables Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr> SVN-Revision: 49164
* include/cmake.mk: search in $(STAGING_DIR)/usr instead of plain ↵Felix Fietkau2016-01-251-1/+1
| | | | | | | | $(STAGING_DIR) to avoid picking up stuff from host/ Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48492
* include/cmake.mk: adjust for STAGING_DIR_HOST splitFelix Fietkau2016-01-251-3/+3
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48491
* build: for cmake, always use ccache from staging dir instead of relying on ↵Felix Fietkau2016-01-031-4/+1
| | | | | | | | the host Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48079
* cmake.mk: enable -Bsymbolic-functions by default for linking shared libs, ↵Felix Fietkau2015-04-191-2/+3
| | | | | | | | slightly improves performance and compression Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45508
* cmake.mk: add host build supportFelix Fietkau2015-04-061-0/+26
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45282
* build: fix CMake assembly builds with ccacheFelix Fietkau2015-03-291-0/+2
| | | | | | | | | | | | CMAKE_ASM_COMPILER is automatically set to CMAKE_C_COMPILER by CMake, but CMAKE_C_COMPILER_ARG1 is lost. This causes assembly builds to fail when ccache is enabled (for example the package fastd on x86). Fix this by explicitly defining CMAKE_ASM_COMPILER and CMAKE_ASM_COMPILER_ARG1. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> SVN-Revision: 45119
* cmake: include external toolchain directory in CMAKE_FIND_ROOT_PATH (fixes ↵Felix Fietkau2015-03-161-1/+3
| | | | | | | | #19074) Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 44825
* include: cmake: prevent inclusion of rpath in binariesJo-Philipp Wich2015-02-081-0/+1
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44328
* build: use gcc-provided ar, nm and ranlib where appropriateFelix Fietkau2014-12-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since GCC 4.7, GCC provides its own wrappers around ar, nm and ranlib, which should be used for builds with link-time optimization. Since GCC 4.9, using them actually necessary for LTO builds using convenience libraries to succeed. There are some packages which try to automatically detect if gcc-{ar,nm,ranlib} exist (one example is my package "fastd" in the package repository, which tries to use LTO). This breaks because the OpenWrt build system explicitly sets the binutils versions of these tools. As it doesn't cause any issues to use gcc-{ar,nm,ranlib} instead of {ar,nm,ranlib} even without LTO, this patch just makes OpenWrt use the GCC-provided versions by default, which fixes the build of such packages with GCC 4.9. (I know that builds fail though when clang is used with -flto and gcc-{ar,nm,ranlib}, but as all OpenWrt toolchains are based on GCC, this isn't a real issue.) Completely cleaning the tree (or at least `make clean toolchain/clean`) is necessary to get a consistent state after the binutils plugins support patch and this one (as trying to use gcc-{ar,nm,ranlib} with a binutils built without plugin support will definitely lead to a build failure). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> SVN-Revision: 43784
* include/cmake.mk: fix indentationFelix Fietkau2014-06-111-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41144
* include/cmake.mk: define CMAKE_AR and CMAKE_RANLIB to fix build errorsFelix Fietkau2014-05-301-11/+14
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 40885
* cmake.mk: fix support for ccacheFelix Fietkau2013-11-181-2/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 38853
* include: cmake: pass toolchain directory to default root find path as wellJo-Philipp Wich2013-08-071-1/+1
| | | | SVN-Revision: 37737
* cmake.mk: add support for overriding the source dir, and define the cmake ↵Felix Fietkau2012-12-291-1/+4
| | | | | | prefix path to avoid picking up host libraries for target builds (patch by Henning Rogge) SVN-Revision: 34914
* cmake: add support for V=csFelix Fietkau2012-04-261-1/+3
| | | | SVN-Revision: 31485
* cmake.mk: fix passing of LDFLAGSJo-Philipp Wich2012-01-091-3/+4
| | | | SVN-Revision: 29701
* cmake: fix ccache command when using host ccache (patch from #9611)Felix Fietkau2011-07-241-2/+6
| | | | SVN-Revision: 27742
* cmake.mk: fix bogus values for FIND_ROOT_PATH_MODE_*; kept plplot from ↵Jo-Philipp Wich2011-06-221-3/+3
| | | | | | compiling (#9573) SVN-Revision: 27256
* add LD_LIBRARY to cmake.mkFelix Fietkau2011-05-201-0/+1
| | | | | | | | Otherwise cmake programs try to link with host ld.so Signed-off-by: Jan Willies <jan@willies.info> SVN-Revision: 26963
* cmake.mk: don't assume toolchain binaries in .../bin/ if an external ↵Jo-Philipp Wich2011-04-111-0/+7
| | | | | | toolchain is used, rely on `which` instead SVN-Revision: 26584
* cmake: Fix ccacheMichael Büsch2011-03-051-2/+16
| | | | SVN-Revision: 25878
* cmake: Pass VERBOSE=1 to the generated makefile to reveal flags and commands ↵Michael Büsch2011-02-051-0/+2
| | | | | | in a verbose openwrt build. SVN-Revision: 25376
* cmake: Remove -O3 from release CFLAGS. Honor the OpenWRT -Os flag instead.Michael Büsch2011-02-051-0/+2
| | | | SVN-Revision: 25372
* add a template for cmake packagesFelix Fietkau2011-01-311-0/+33
SVN-Revision: 25265