]> git.tdb.fi Git - builder.git/log
builder.git
16 months agoRemove ExportDefinitions from ImportLibrary's constructor
Mikko Rasa [Mon, 2 Jan 2023 10:33:19 +0000 (12:33 +0200)]
Remove ExportDefinitions from ImportLibrary's constructor

It's not necessary with the MSVC toolchain.

16 months agoComment cleanup and other cosmetic fixes
Mikko Rasa [Fri, 30 Dec 2022 22:47:29 +0000 (00:47 +0200)]
Comment cleanup and other cosmetic fixes

16 months agoOptimize Binary::collect_build_info
Mikko Rasa [Fri, 30 Dec 2022 22:37:59 +0000 (00:37 +0200)]
Optimize Binary::collect_build_info

It's likely that all object files are built with very few different
tools, evne just one.  Updating the build info multiple times from the
same tool is pointless.

16 months agoAvoid observing the same header twice in ObjectFile
Mikko Rasa [Fri, 30 Dec 2022 22:34:41 +0000 (00:34 +0200)]
Avoid observing the same header twice in ObjectFile

This is a bit crude since the dependencies are not sorted, but still
avoids a massive slowdown from updating dependencies many times when a
header is generated.

16 months agoRewrite BinaryComponent::create_targets in a more general way
Mikko Rasa [Fri, 30 Dec 2022 17:00:15 +0000 (19:00 +0200)]
Rewrite BinaryComponent::create_targets in a more general way

Instead of assuming a generator-compiler-linker chain, with generators
only coming from the package, it now applies tools until it arrives at
object files, which are then fed to the linker.  This allows global
generator tools and also allows multiple generators to be chained, with
the caveat that if the chain contains more than one step operating on
a directory or a component, the results may be unpredictable.

16 months agoIf a binary package is not found, briefly describe what was missing
Mikko Rasa [Thu, 29 Dec 2022 18:30:10 +0000 (20:30 +0200)]
If a binary package is not found, briefly describe what was missing

16 months agoCorrect MSVC tools' input suffixes
Mikko Rasa [Thu, 29 Dec 2022 16:37:14 +0000 (18:37 +0200)]
Correct MSVC tools' input suffixes

16 months agoImprove package brokenness checks and problem reporting
Mikko Rasa [Thu, 29 Dec 2022 16:36:26 +0000 (18:36 +0200)]
Improve package brokenness checks and problem reporting

Packages are now considered broken if any required packages are broken,
and problems are reported for required packages as well.

16 months agoCheck for existence of Android NDK in AndroidLinker
Mikko Rasa [Thu, 29 Dec 2022 16:34:21 +0000 (18:34 +0200)]
Check for existence of Android NDK in AndroidLinker

16 months agoReplace the stdc++ library with gnustl_static on Android
Mikko Rasa [Thu, 29 Dec 2022 16:33:58 +0000 (18:33 +0200)]
Replace the stdc++ library with gnustl_static on Android

16 months agoAvoid preparing packages multiple times
Mikko Rasa [Thu, 29 Dec 2022 13:03:43 +0000 (15:03 +0200)]
Avoid preparing packages multiple times

16 months agoReject nonexistent sources
Mikko Rasa [Thu, 29 Dec 2022 12:54:52 +0000 (14:54 +0200)]
Reject nonexistent sources

16 months agoConvert the remaining tools into actual plugins
Mikko Rasa [Wed, 28 Dec 2022 15:50:27 +0000 (17:50 +0200)]
Convert the remaining tools into actual plugins

16 months agoAllow new component types to be registered at runtime
Mikko Rasa [Wed, 28 Dec 2022 15:35:15 +0000 (17:35 +0200)]
Allow new component types to be registered at runtime

16 months agoMove the VS project and solution generators to the MSVC plugin
Mikko Rasa [Wed, 28 Dec 2022 13:47:10 +0000 (15:47 +0200)]
Move the VS project and solution generators to the MSVC plugin

16 months agoRename builtintools to basetools
Mikko Rasa [Wed, 28 Dec 2022 13:43:18 +0000 (15:43 +0200)]
Rename builtintools to basetools

It doesn't make much sense to call it "builtin" if it's actually a
plugin.

16 months agoConvert builtin tools into a plugin
Mikko Rasa [Wed, 28 Dec 2022 13:39:12 +0000 (15:39 +0200)]
Convert builtin tools into a plugin

16 months agoAllow plugins to create additional targets in SourcePackages
Mikko Rasa [Wed, 28 Dec 2022 13:38:27 +0000 (15:38 +0200)]
Allow plugins to create additional targets in SourcePackages

16 months agoConvert the simpler toolchains into plugins
Mikko Rasa [Wed, 28 Dec 2022 13:17:14 +0000 (15:17 +0200)]
Convert the simpler toolchains into plugins

These have no references to them from the main library and were the
easiest to convert.

16 months agoAdd an interface for dynamically loaded plugins
Mikko Rasa [Wed, 28 Dec 2022 13:16:21 +0000 (15:16 +0200)]
Add an interface for dynamically loaded plugins

16 months agoAvoid some failures from MicrosoftTools when running on Linux
Mikko Rasa [Wed, 28 Dec 2022 12:47:49 +0000 (14:47 +0200)]
Avoid some failures from MicrosoftTools when running on Linux

Don't try to run vswhere.exe if it isn't found.  If running on WSL, map
its result to the mount location to the Windows drive.

16 months agoRefactor VsSolutionFile::find_dependencies as recursive
Mikko Rasa [Wed, 28 Dec 2022 12:19:19 +0000 (14:19 +0200)]
Refactor VsSolutionFile::find_dependencies as recursive

This avoids an issue with inserting elements into a vector while
iterating over it.

16 months agoDisallow two components with the same name
Mikko Rasa [Wed, 28 Dec 2022 11:43:23 +0000 (13:43 +0200)]
Disallow two components with the same name

16 months agoCollapse the component loading functions in SourcePackage::Loader
Mikko Rasa [Wed, 28 Dec 2022 11:42:34 +0000 (13:42 +0200)]
Collapse the component loading functions in SourcePackage::Loader

16 months agoRename the library component as libbuilder
Mikko Rasa [Wed, 28 Dec 2022 11:40:35 +0000 (13:40 +0200)]
Rename the library component as libbuilder

Using the same name for the program and the library components causes
some trouble especially with MSVC, since the pdb and ilk files overlap.

16 months agoRemove a lib prefix from the libname of built SharedLibraries
Mikko Rasa [Wed, 28 Dec 2022 11:23:46 +0000 (13:23 +0200)]
Remove a lib prefix from the libname of built SharedLibraries

It may be useful to have the prefix in a library component name to
differentiate it from a program component.

16 months agoRearrange sources into subdirectories
Mikko Rasa [Tue, 27 Dec 2022 20:52:34 +0000 (22:52 +0200)]
Rearrange sources into subdirectories

16 months agoAdd gcc's private library directory to ClangLinker's system path
Mikko Rasa [Tue, 27 Dec 2022 20:41:22 +0000 (22:41 +0200)]
Add gcc's private library directory to ClangLinker's system path

It's needed for libstdc++.

16 months agoRefactor the use of external tasks in tools
Mikko Rasa [Tue, 27 Dec 2022 19:52:10 +0000 (21:52 +0200)]
Refactor the use of external tasks in tools

The run functions now just return the arguments, and a wrapper in the
Tool class creates the task object.

16 months agoInitialize AndroidCompiler's build info in do_prepare
Mikko Rasa [Tue, 27 Dec 2022 16:12:49 +0000 (18:12 +0200)]
Initialize AndroidCompiler's build info in do_prepare

16 months agoAdd a customized linker tool to ClangTools
Mikko Rasa [Tue, 27 Dec 2022 16:11:11 +0000 (18:11 +0200)]
Add a customized linker tool to ClangTools

Also remove the GnuArchiver from it, beacuse the GNU and clang toolchains
can now be active at the same time.

16 months agoUse GnuCompiler's build info to link libstdc++
Mikko Rasa [Tue, 27 Dec 2022 16:08:20 +0000 (18:08 +0200)]
Use GnuCompiler's build info to link libstdc++

16 months agoGather more system path information for GnuLinker
Mikko Rasa [Tue, 27 Dec 2022 15:58:08 +0000 (17:58 +0200)]
Gather more system path information for GnuLinker

16 months agoImprove prefix management
Mikko Rasa [Tue, 27 Dec 2022 01:23:31 +0000 (03:23 +0200)]
Improve prefix management

An automatically set prefix is now updated when the default toolchain
is selected.  Setting the architecture won't override prefix if it was
already explicitly set.

16 months agoPrepare early dependencies of a target before finding more
Mikko Rasa [Tue, 27 Dec 2022 01:15:51 +0000 (03:15 +0200)]
Prepare early dependencies of a target before finding more

AndroidCompiler supplies build information for the C++ standard library,
which is consumed by Binary through ObjectFiles.  The compiler needs to
be prepared before Binary is, or the C++ stdlib won't be found.

16 months agoFurther tweak GnuCompiler::query_version
Mikko Rasa [Mon, 26 Dec 2022 20:40:20 +0000 (22:40 +0200)]
Further tweak GnuCompiler::query_version

Some compilers return non-numeric version components, like 4.9.x.  This
change keeps values of all the initial numeric components.

16 months agoFix initialization of Android tools' commands
Mikko Rasa [Mon, 26 Dec 2022 18:36:19 +0000 (20:36 +0200)]
Fix initialization of Android tools' commands

16 months agoAdd a sanity check for derived tool commands
Mikko Rasa [Mon, 26 Dec 2022 19:01:30 +0000 (21:01 +0200)]
Add a sanity check for derived tool commands

It doesn't seem correct to copy the command in CustomizedTool, since
often the derived class will want to use a different command anyway.

16 months agoMake sure the extra_data of GnuCompiler is initialized
Mikko Rasa [Mon, 26 Dec 2022 18:35:20 +0000 (20:35 +0200)]
Make sure the extra_data of GnuCompiler is initialized

16 months agoInitialize AndroidDevKit::supported_api_levels in the declaration
Mikko Rasa [Mon, 26 Dec 2022 13:41:53 +0000 (15:41 +0200)]
Initialize AndroidDevKit::supported_api_levels in the declaration

16 months agoAvoid zeroing version of -dumpfullversion doesn't return anything
Mikko Rasa [Mon, 26 Dec 2022 13:30:56 +0000 (15:30 +0200)]
Avoid zeroing version of -dumpfullversion doesn't return anything

Clang doesn't seem to recognize it.  This is a bit of a hack and it
would be better if ClangCompiler could handle the version check somehow,
but it's not obvious how to do that.

16 months agoDon't load a cross prefix for a native architecture
Mikko Rasa [Mon, 26 Dec 2022 12:55:38 +0000 (14:55 +0200)]
Don't load a cross prefix for a native architecture

16 months agoUse a cross prefix for the new unified GnuLinker driver
Mikko Rasa [Mon, 26 Dec 2022 12:51:02 +0000 (14:51 +0200)]
Use a cross prefix for the new unified GnuLinker driver

16 months agoAvoid a memory leak if Builder::set_architecture is called again
Mikko Rasa [Mon, 26 Dec 2022 12:45:50 +0000 (14:45 +0200)]
Avoid a memory leak if Builder::set_architecture is called again

16 months agoUse CustomizedTool for tools which derive from other tools
Mikko Rasa [Mon, 26 Dec 2022 12:20:51 +0000 (14:20 +0200)]
Use CustomizedTool for tools which derive from other tools

16 months agoFix logic issues with Tool::prepare
Mikko Rasa [Mon, 26 Dec 2022 12:07:51 +0000 (14:07 +0200)]
Fix logic issues with Tool::prepare

CustomizedTool's do_prepare will call the parent tool's prepare with
itself as argument, so the prepared flag shouldn't be checked in this
case.

The command and executable checks are also better to do in the outer
call to avoid doing them twice, since they don't depend on the base
tool's logic.

16 months agoUse priorities to determine the default toolchain
Mikko Rasa [Mon, 26 Dec 2022 11:28:21 +0000 (13:28 +0200)]
Use priorities to determine the default toolchain

16 months agoReject architecture specification conflicts for all fields
Mikko Rasa [Mon, 26 Dec 2022 11:01:27 +0000 (13:01 +0200)]
Reject architecture specification conflicts for all fields

This gives errors for nonsensical stuff like linux-windows-32-64-gnu-msvc,
which was previously accepted.

16 months agoAllow architecture specifications to be refined after creation
Mikko Rasa [Mon, 26 Dec 2022 11:01:10 +0000 (13:01 +0200)]
Allow architecture specifications to be refined after creation

16 months agoFix a shadowed variable warning
Mikko Rasa [Mon, 26 Dec 2022 10:35:26 +0000 (12:35 +0200)]
Fix a shadowed variable warning

16 months agoAdd a helper class for tool customization
Mikko Rasa [Sat, 24 Dec 2022 21:34:14 +0000 (23:34 +0200)]
Add a helper class for tool customization

16 months agoRework Tool::prepare to be able to work on other objects than self
Mikko Rasa [Sat, 24 Dec 2022 21:25:29 +0000 (23:25 +0200)]
Rework Tool::prepare to be able to work on other objects than self

This is another piece required for inheritance-less tool customization.

16 months agoRefactor GnuCompiler::prepare_version a bit
Mikko Rasa [Sat, 24 Dec 2022 21:21:37 +0000 (23:21 +0200)]
Refactor GnuCompiler::prepare_version a bit

16 months agoChange Tool's protected constructor to take a pointer to Architecture
Mikko Rasa [Sat, 24 Dec 2022 16:26:52 +0000 (18:26 +0200)]
Change Tool's protected constructor to take a pointer to Architecture

16 months agoRemove the now obsolete SubTool class
Mikko Rasa [Sat, 24 Dec 2022 13:11:41 +0000 (15:11 +0200)]
Remove the now obsolete SubTool class

16 months agoRedesign GnuLinker to work without subtools
Mikko Rasa [Sat, 24 Dec 2022 12:30:54 +0000 (14:30 +0200)]
Redesign GnuLinker to work without subtools

16 months agoDon't complain about missing executable if a tool has no command
Mikko Rasa [Sat, 24 Dec 2022 12:12:53 +0000 (14:12 +0200)]
Don't complain about missing executable if a tool has no command

This is the case for internal tools.

16 months agoFix bit shifts to be 64-bit
Mikko Rasa [Sat, 24 Dec 2022 12:12:18 +0000 (14:12 +0200)]
Fix bit shifts to be 64-bit

16 months agoCapture value evaluation function by value
Mikko Rasa [Sat, 24 Dec 2022 12:11:01 +0000 (14:11 +0200)]
Capture value evaluation function by value

Otherwise it will go out of scope if a temporary is passed.

16 months agoFile Tool's executable before calling do_prepare
Mikko Rasa [Fri, 23 Dec 2022 21:25:04 +0000 (23:25 +0200)]
File Tool's executable before calling do_prepare

16 months agoRedesign how tools are run
Mikko Rasa [Thu, 22 Dec 2022 16:05:25 +0000 (18:05 +0200)]
Redesign how tools are run

It also uses functors now.  The run functions access properties of the
tool through the target.  This will allow tool customization without
having to derive from the class, which will be useful for modularization.

16 months agoClear the line before printing task info if progress is enabled
Mikko Rasa [Thu, 22 Dec 2022 14:22:46 +0000 (16:22 +0200)]
Clear the line before printing task info if progress is enabled

16 months agoRemove redundant task setup from Copy
Mikko Rasa [Thu, 22 Dec 2022 14:22:22 +0000 (16:22 +0200)]
Remove redundant task setup from Copy

FileTarget already does this

16 months agoRefactor InternalTask to take a functor
Mikko Rasa [Thu, 22 Dec 2022 14:01:43 +0000 (16:01 +0200)]
Refactor InternalTask to take a functor

This way the tools don't all have to implement the same worker thread
boilerplate.

16 months agoInline simple constructors
Mikko Rasa [Thu, 22 Dec 2022 12:56:28 +0000 (14:56 +0200)]
Inline simple constructors

16 months agoUse default member initializers and constructor delegation
Mikko Rasa [Thu, 22 Dec 2022 12:45:50 +0000 (14:45 +0200)]
Use default member initializers and constructor delegation

16 months agoBump version to 3.0 and update copyright years
Mikko Rasa [Wed, 21 Dec 2022 10:55:03 +0000 (12:55 +0200)]
Bump version to 3.0 and update copyright years

I've done some modernization of the code and am about to make the program
modular, so a version bump is warranted.

16 months agoRefactor logger to do message formatting internally
Mikko Rasa [Wed, 21 Dec 2022 10:26:15 +0000 (12:26 +0200)]
Refactor logger to do message formatting internally

This shortens the syntax of using it and may also provide a minor
performance improvement since formatting doesn't need to be done for
disabled channels.

16 months agoTrack Android API levels with a bitmask
Mikko Rasa [Wed, 21 Dec 2022 09:52:11 +0000 (11:52 +0200)]
Track Android API levels with a bitmask

16 months agoReplace some sets with vectors as well
Mikko Rasa [Wed, 21 Dec 2022 09:48:44 +0000 (11:48 +0200)]
Replace some sets with vectors as well

In these cases the number of expected elements is small and/or the set
is built up once and then used many times.

16 months agoConvert all list containers to vectors
Mikko Rasa [Wed, 21 Dec 2022 09:23:37 +0000 (11:23 +0200)]
Convert all list containers to vectors

16 months agoRewrite dependency finding algorithms in a few classes
Mikko Rasa [Tue, 20 Dec 2022 22:38:59 +0000 (00:38 +0200)]
Rewrite dependency finding algorithms in a few classes

They no longer depend on iterators to the dependencies list staying valid
when elements are added, allowing conversion to std::vector.

16 months agoMake data members of Task protected
Mikko Rasa [Tue, 20 Dec 2022 12:08:14 +0000 (14:08 +0200)]
Make data members of Task protected

I'm not sure why they were public, maybe by accident.

16 months agoCheck for empty sources in Tar::create_target
Mikko Rasa [Tue, 20 Dec 2022 12:04:01 +0000 (14:04 +0200)]
Check for empty sources in Tar::create_target

16 months agoUse dynamic_cast to reference when incorrect type is not acceptable
Mikko Rasa [Tue, 20 Dec 2022 12:03:45 +0000 (14:03 +0200)]
Use dynamic_cast to reference when incorrect type is not acceptable

16 months agoAdjust build signatures to contain the tool tag
Mikko Rasa [Tue, 20 Dec 2022 12:00:14 +0000 (14:00 +0200)]
Adjust build signatures to contain the tool tag

External tools now have a build signature by default.

16 months agoGuard against build type being missing
Mikko Rasa [Mon, 19 Dec 2022 19:24:40 +0000 (21:24 +0200)]
Guard against build type being missing

16 months agoLog environment information before preparing the build
Mikko Rasa [Mon, 19 Dec 2022 19:14:28 +0000 (21:14 +0200)]
Log environment information before preparing the build

16 months agoImprove architecture name matching
Mikko Rasa [Mon, 19 Dec 2022 19:12:29 +0000 (21:12 +0200)]
Improve architecture name matching

It will now treat x86_64 as a more specific match than just x86.

16 months agoUse format() when creating strings from more than two parts
Mikko Rasa [Mon, 19 Dec 2022 19:11:40 +0000 (21:11 +0200)]
Use format() when creating strings from more than two parts

16 months agoRefactor BooleanEvaluator to have overloaded constructors
Mikko Rasa [Mon, 19 Dec 2022 19:00:51 +0000 (21:00 +0200)]
Refactor BooleanEvaluator to have overloaded constructors

The signature of the function passed in is now used to determine if
comparison operators are permitted.

16 months agoUse std::function instead of sigc::slot in BooleanEvaluator
Mikko Rasa [Mon, 19 Dec 2022 18:54:29 +0000 (20:54 +0200)]
Use std::function instead of sigc::slot in BooleanEvaluator

16 months agoFix typos
Mikko Rasa [Mon, 19 Dec 2022 18:15:27 +0000 (20:15 +0200)]
Fix typos

16 months agoCache result of parsing $PATH
Mikko Rasa [Mon, 19 Dec 2022 18:14:52 +0000 (20:14 +0200)]
Cache result of parsing $PATH

16 months agoRefuse to create an empty data pack
Mikko Rasa [Mon, 19 Dec 2022 18:08:13 +0000 (20:08 +0200)]
Refuse to create an empty data pack

This avoids a segfault from trying to access te front element of an
empty list.

16 months agoUse DataFile::Writer to write package configuration files
Mikko Rasa [Mon, 19 Dec 2022 18:04:40 +0000 (20:04 +0200)]
Use DataFile::Writer to write package configuration files

16 months agoCombine the processing of configuration and tool overrides
Mikko Rasa [Mon, 19 Dec 2022 18:01:03 +0000 (20:01 +0200)]
Combine the processing of configuration and tool overrides

16 months agoRemove most container typedefs and refactor others
Mikko Rasa [Mon, 19 Dec 2022 17:18:11 +0000 (19:18 +0200)]
Remove most container typedefs and refactor others

16 months agoUse braced initializer lists for map insertions
Mikko Rasa [Mon, 19 Dec 2022 14:52:50 +0000 (16:52 +0200)]
Use braced initializer lists for map insertions

16 months agoUse bound loader function arguments for binary component types
Mikko Rasa [Mon, 19 Dec 2022 14:19:21 +0000 (16:19 +0200)]
Use bound loader function arguments for binary component types

16 months agoRefactor the constructor of SourcePackage::Loader
Mikko Rasa [Mon, 19 Dec 2022 14:18:18 +0000 (16:18 +0200)]
Refactor the constructor of SourcePackage::Loader

There isn't much point to have two differnt overloads when it could just
take a nullable pointer.

16 months agoUse auto type for iterator variables
Mikko Rasa [Mon, 19 Dec 2022 14:02:38 +0000 (16:02 +0200)]
Use auto type for iterator variables

16 months agoMark overridden virtual functions as such
Mikko Rasa [Mon, 19 Dec 2022 13:39:27 +0000 (15:39 +0200)]
Mark overridden virtual functions as such

16 months agoUse shortcut functions for find calls
Mikko Rasa [Mon, 19 Dec 2022 12:52:33 +0000 (14:52 +0200)]
Use shortcut functions for find calls

16 months agoReplace basic for loops with range-based loops or algorithms
Mikko Rasa [Mon, 19 Dec 2022 12:32:43 +0000 (14:32 +0200)]
Replace basic for loops with range-based loops or algorithms

In remaining cases use auto as a shortcut for the iterator type.

16 months agoBegin converting the code to C++11
Mikko Rasa [Mon, 19 Dec 2022 10:11:32 +0000 (12:11 +0200)]
Begin converting the code to C++11

16 months agoImprove help output for the local package
Mikko Rasa [Sun, 18 Dec 2022 18:16:38 +0000 (20:16 +0200)]
Improve help output for the local package

Only output the required packages list if anything is required, and
output an overall header before the package-specific section.

16 months agoEmit configurations in Visual Studio solutions
Mikko Rasa [Sun, 18 Dec 2022 18:02:17 +0000 (20:02 +0200)]
Emit configurations in Visual Studio solutions

Projects other than the main one are marked as not being built, since
builder will build them implicitly as part of the main project.

This also seems to be enough for Visual Studio to not complain about the
solution being modified when closing it.

16 months agoAdd ability to generate Visual Studio solution files
Mikko Rasa [Sun, 18 Dec 2022 16:03:41 +0000 (18:03 +0200)]
Add ability to generate Visual Studio solution files

Currently very minimal, and VS treats the solution as modified
immediately after loading it.

16 months agoGenerate GUIDs for Visual C++ project files
Mikko Rasa [Sun, 18 Dec 2022 15:58:59 +0000 (17:58 +0200)]
Generate GUIDs for Visual C++ project files