]> git.tdb.fi Git - builder.git/log
builder.git
20 months agoMake it possible to use built-in plugins
Mikko Rasa [Sun, 12 Mar 2023 11:20:27 +0000 (13:20 +0200)]
Make it possible to use built-in plugins

20 months agoInstall headers of non-installed components in a staging directory
Mikko Rasa [Tue, 7 Mar 2023 23:57:30 +0000 (01:57 +0200)]
Install headers of non-installed components in a staging directory

This allows components to include headers from other local components in
a controlled fashion.

20 months agoRearrange generated source paths
Mikko Rasa [Tue, 7 Mar 2023 23:53:36 +0000 (01:53 +0200)]
Rearrange generated source paths

20 months agoRemove the implicit include path for the generated source directory
Mikko Rasa [Tue, 7 Mar 2023 23:36:26 +0000 (01:36 +0200)]
Remove the implicit include path for the generated source directory

It doesn't work properly when a source file includes a header from a
different component in the local package and that header tries to include
a generated header in its own component.  Adding the generated source
directories of all used compnents isn't good either, in case multiple
components have generated headers with the same name.

20 months agoMove some path and filename manipulations into the Component class
Mikko Rasa [Tue, 7 Mar 2023 23:30:22 +0000 (01:30 +0200)]
Move some path and filename manipulations into the Component class

22 months agoDon't busyloop while waiting for an internal task to complete
Mikko Rasa [Mon, 9 Jan 2023 09:18:07 +0000 (11:18 +0200)]
Don't busyloop while waiting for an internal task to complete

22 months agoReport timings of the build
Mikko Rasa [Mon, 9 Jan 2023 09:17:17 +0000 (11:17 +0200)]
Report timings of the build

22 months agoAssociate targets with FileTargets instead of paths
Mikko Rasa [Mon, 9 Jan 2023 09:15:10 +0000 (11:15 +0200)]
Associate targets with FileTargets instead of paths

22 months agoRename some variables to avoid conflicts with C++20 keywords
Mikko Rasa [Sat, 7 Jan 2023 13:12:53 +0000 (15:12 +0200)]
Rename some variables to avoid conflicts with C++20 keywords

22 months agoAllow source packages to specify exported build info
Mikko Rasa [Thu, 5 Jan 2023 23:00:48 +0000 (01:00 +0200)]
Allow source packages to specify exported build info

22 months agoReport which targets participate in a dependency cycle
Mikko Rasa [Thu, 5 Jan 2023 09:56:38 +0000 (11:56 +0200)]
Report which targets participate in a dependency cycle

22 months agoAvoid spurious dependency loop errors from side effects
Mikko Rasa [Thu, 5 Jan 2023 09:36:41 +0000 (11:36 +0200)]
Avoid spurious dependency loop errors from side effects

If the primary target depends on its own side effect (such as a generated
source file including a header generated by the same command), this could
cause the side effect's prepare() to be entered recursively.

22 months agoMake sure the name of the build macro is valid
Mikko Rasa [Thu, 5 Jan 2023 07:53:18 +0000 (09:53 +0200)]
Make sure the name of the build macro is valid

Component names are arbitrary strings, so non-alphanumeric characters
must be dealt with.

22 months agoUpdate .gitignore to include build products on Windows
Mikko Rasa [Wed, 4 Jan 2023 10:58:22 +0000 (12:58 +0200)]
Update .gitignore to include build products on Windows

22 months agoRemove an unnecessary initializer from a constructor
Mikko Rasa [Wed, 4 Jan 2023 10:55:54 +0000 (12:55 +0200)]
Remove an unnecessary initializer from a constructor

22 months agoMake PackageManager::run_pkgconfig fail on Windows
Mikko Rasa [Wed, 4 Jan 2023 10:38:30 +0000 (12:38 +0200)]
Make PackageManager::run_pkgconfig fail on Windows

... instead of returning an empty string which would be interpreted as a
successful result and used to create bogus binary packages.

22 months agoAvoid exception if plugins directory is not found
Mikko Rasa [Tue, 3 Jan 2023 17:32:29 +0000 (19:32 +0200)]
Avoid exception if plugins directory is not found

22 months agoDisable generation of .exp files on MSVC
Mikko Rasa [Tue, 3 Jan 2023 17:14:56 +0000 (19:14 +0200)]
Disable generation of .exp files on MSVC

They don't seem useful outside of circular import situations, which I
don't have.

22 months agoMove FileTarget's constructors to the .cpp file
Mikko Rasa [Tue, 3 Jan 2023 17:09:48 +0000 (19:09 +0200)]
Move FileTarget's constructors to the .cpp file

This avoids an undefined reference error on MSVC.

22 months agoMark side effects for rebuilding together with their primary targets
Mikko Rasa [Tue, 3 Jan 2023 17:06:45 +0000 (19:06 +0200)]
Mark side effects for rebuilding together with their primary targets

22 months agoExplicitly create import libraries from BinaryComponent
Mikko Rasa [Tue, 3 Jan 2023 17:04:22 +0000 (19:04 +0200)]
Explicitly create import libraries from BinaryComponent

They should not be created for modules.  The linker is still used to
create them since the process is quite different between toolchains.

22 months agoPlace incremental link information files in the temp directory
Mikko Rasa [Tue, 3 Jan 2023 14:15:49 +0000 (16:15 +0200)]
Place incremental link information files in the temp directory

22 months agoMake the clang and android plugins require gnutools
Mikko Rasa [Tue, 3 Jan 2023 12:17:31 +0000 (14:17 +0200)]
Make the clang and android plugins require gnutools

22 months agoMake it possible for plugins to require other plugins
Mikko Rasa [Tue, 3 Jan 2023 12:16:42 +0000 (14:16 +0200)]
Make it possible for plugins to require other plugins

This is used to ensure correct ordering if one plugin customizes tools
from another.

22 months agoAvoid exception if a directory in the package path does not exist
Mikko Rasa [Tue, 3 Jan 2023 11:48:03 +0000 (13:48 +0200)]
Avoid exception if a directory in the package path does not exist

22 months agoAdjust plugin dependencies
Mikko Rasa [Tue, 3 Jan 2023 11:01:09 +0000 (13:01 +0200)]
Adjust plugin dependencies

Mspcrypto dependency has been moved to msvctools, since the base program
doesn't need it.

22 months agoMake symbols hidden by default on Linux
Mikko Rasa [Tue, 3 Jan 2023 10:58:22 +0000 (12:58 +0200)]
Make symbols hidden by default on Linux

This will encourage me to add the visibility decorations where necessary
and reduce work needed for porting to Windows.

22 months agoAdd visibility decorations to the library and plugins
Mikko Rasa [Tue, 3 Jan 2023 10:57:31 +0000 (12:57 +0200)]
Add visibility decorations to the library and plugins

22 months agoAvoid double deletion of the module if a plugin fails to load
Mikko Rasa [Tue, 3 Jan 2023 00:54:27 +0000 (02:54 +0200)]
Avoid double deletion of the module if a plugin fails to load

The destructor of LoadedPlugin will delete it.

22 months agoRemove automatic export/import of symbols from GNU tools on Windows
Mikko Rasa [Tue, 3 Jan 2023 00:15:05 +0000 (02:15 +0200)]
Remove automatic export/import of symbols from GNU tools on Windows

MSVC can't do this, so I'm finally going to add the necessary decorations
to my libraries.

22 months agoAdd shell32 to libraries on Windows
Mikko Rasa [Mon, 2 Jan 2023 22:49:06 +0000 (00:49 +0200)]
Add shell32 to libraries on Windows

It's needed for SHGetKnownFolderPath

22 months agoMake sure the main target of a side effect is prepared
Mikko Rasa [Mon, 2 Jan 2023 22:48:26 +0000 (00:48 +0200)]
Make sure the main target of a side effect is prepared

Tool invocation is formed from the main target.

22 months agoDisable some warnings related to dllexport on MSVC
Mikko Rasa [Mon, 2 Jan 2023 22:47:43 +0000 (00:47 +0200)]
Disable some warnings related to dllexport on MSVC

22 months agoCreate import libraries with MSVC linker
Mikko Rasa [Mon, 2 Jan 2023 22:46:59 +0000 (00:46 +0200)]
Create import libraries with MSVC linker

22 months agoDefine a macro to indicate which component is being built
Mikko Rasa [Mon, 2 Jan 2023 22:24:59 +0000 (00:24 +0200)]
Define a macro to indicate which component is being built

This can be used in libraries to export or import functions across a DLL
interface as appropriate.

22 months agoExplicitly set import library name with MSVC linker
Mikko Rasa [Mon, 2 Jan 2023 22:23:11 +0000 (00:23 +0200)]
Explicitly set import library name with MSVC linker

Also disable import library if one does not exist in the build.

22 months agoRemove the now obsolete install_filename from FileTarget
Mikko Rasa [Mon, 2 Jan 2023 20:36:49 +0000 (22:36 +0200)]
Remove the now obsolete install_filename from FileTarget

22 months agoCorrectly fetch libmode when looking for dependencies of Binary
Mikko Rasa [Mon, 2 Jan 2023 20:36:13 +0000 (22:36 +0200)]
Correctly fetch libmode when looking for dependencies of Binary

22 months agoDon't use a versioned name for import libraries
Mikko Rasa [Mon, 2 Jan 2023 20:30:59 +0000 (22:30 +0200)]
Don't use a versioned name for import libraries

Windows doesn't have symlinks so the import library would not be found.
In fact, the import library is kind of like an soname symlink.

22 months agoBuild shared libraries directly to a versioned name
Mikko Rasa [Mon, 2 Jan 2023 20:25:48 +0000 (22:25 +0200)]
Build shared libraries directly to a versioned name

The MSVC linker does not have an equivalent to the GNU linker's soname
option, so the build filename must match the one the library will be
loaded with at runtime.

22 months agoUse the architecture's patterns to remove prefix from libname
Mikko Rasa [Mon, 2 Jan 2023 20:22:36 +0000 (22:22 +0200)]
Use the architecture's patterns to remove prefix from libname

With the MSVC toolchain a lib prefix is not added automatically when
searching for libraries, so removing it could result in a mismatch.

22 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.

22 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

22 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.

22 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.

22 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.

22 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

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

22 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.

22 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

22 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

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

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

22 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

22 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

22 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

22 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.

22 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

22 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

22 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.

22 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

22 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.

22 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.

22 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

22 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

22 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.

22 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.

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

22 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++.

22 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.

22 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

22 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.

22 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++

22 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

22 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.

22 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.

22 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.

22 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

22 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.

22 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

22 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

22 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.

22 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

22 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

22 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

22 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

22 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.

22 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

22 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.

22 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

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

23 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

23 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.

23 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

23 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

23 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

23 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

23 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.

23 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

23 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.