45 Commits

Author SHA1 Message Date
Allan Odgaard
079377ed49 Require macOS 10.12 and remove compatibility checks 2019-10-07 21:28:16 +02:00
Allan Odgaard
990672d1f7 Support macOS 10.11
We don’t yet rely on any 10.12 specific API other than os_log which can be skipped without user impact.

Unfortunately when trying to build for 10.10 using latest Xcode/SDK the linker gives an error for missing symbol: _objc_loadClassref.

Going forward we will require 10.12 but as there is no non-beta build for 10.11 users yet, I wanted to make one.
2019-10-07 12:32:01 +02:00
Allan Odgaard
4c318529ab Build as C++20 (up from C++14)
The C++20 feature list has been frozen although clang (and libc++) doesn’t yet have full support and the clang option we are using is -std=c++2a to indicate that things may still change.
2019-08-01 10:17:51 +02:00
Allan Odgaard
72f4b7447e Do not hardcode code signing flags in bin/gen_build 2019-07-13 08:49:45 +02:00
Allan Odgaard
3f8c2d0bbd No need for visibility setting when all objects are linked together
I’m keeping it in the sources though as it provides semantic value and may be required if the build system is updated, e.g. we may want to create static libraries for some targets and would thus need to know which symbols to export.
2019-07-07 20:52:50 +02:00
Allan Odgaard
63724e67a4 Bump required OS version to 10.12
This is so that we can use the new logging infrastructure.
2019-07-07 17:57:50 +02:00
Allan Odgaard
0796431196 Remove COMPILE_DATE definition from build file 2019-06-26 23:32:54 +02:00
Allan Odgaard
8e2de26529 Move PLIST_FLAGS to TextMate’s target specification 2019-06-26 23:32:54 +02:00
Allan Odgaard
92f4a91cca Remove required OS version as a ./configure option
The code is written with a certain OS target in mind, so it makes sense to have this explicitly stated.
2019-06-26 23:32:54 +02:00
Allan Odgaard
9f6781ec3f Get rid of the APP_NAME variable 2019-06-26 23:32:54 +02:00
Allan Odgaard
412e6798ca Update build generator script
This changes a bunch of things:

1. Each framework now creates its own include directory for exported headers, and any target linking with this framework, gets that directory added to its include search path. This ensures deterministic behavior, unlike previously where a single shared directory was used, so even if target A did not explicitly link with target B, there was a reasonable chance that target B’s headers would be available when target A was built.

2. There is a new IMPORT keyword to indicate that a target depends on the headers of another framework but does not want to link with it. For example the `commit` shell command imports headers from the CommitWindow framework (related to their communications protocol) but linking with the CommitWindow framework would not be practical (as that would bring in all the resources of the CommitWindow).

3. All embedded targets are signed before being copied to their destination.

4. A new CS_ENTITLEMENTS keyword allows specifying `codesign` entitlements. Currently the hardened runtime is enabled, although this does make development problematic, as modifying files of a running instance (as done during rebuild) can cause TextMate to crash with EXC_BAD_ACCESS (Code Signature Invalid). Worse though, it seems the system has a cache of blacklisted executables indexed by inode. So if e.g. the embedded `mate` executable gets blacklisted, one has to manually remove and rebuild it, before it gets possible to use it again (by default, rebuilding causes the inode to be re-used, but I may change the build system to unlink before copy).

5. The build file no longer contains rules related to deployment. Instead variables are declared that a user build file can reference to extend the build with notarization/deployment rules (without having to hardcode build directory paths).

6. The code has been made modular with a Compiler super class that is subclassed to add support for file transformations (xib, ragel, asset catalogs, etc.) and a transformed file can have its own settings.

7. If target A links with target B, the linker flags of target B will now be included when linking target A.

8. Currently no indexing of help books. Unsure if this is actually useful.

9. Previously it was possible to have umbrella targets that would not generate any output, but just change settings for their sub-targets. This is no longer supported, as the implementation was arcane. I would like to introduce a different system for managing sectioned settings. Related to this; settings in target files are now always merged, regardless of whether using ‘=’ or ‘+=’.
2019-06-26 23:32:19 +02:00
Jason Gavris
0a597f1505 Enable ThinLTO 2017-10-05 08:16:42 +02:00
Ronald Wampler
71aa9764af Add capnp include path for C++/Objective-C++ files
This is needed after commit 2748e12699.
2017-10-03 19:11:20 -04:00
Ronald Wampler
234e64dcfc Temporarily peg support at C++14 (10.13)
Building with c++1z support on the latest version of clang on High Sierra (10.13) causes a couple of runtime crashes.
2017-10-02 20:53:05 +02:00
Ronald Wampler
1fb9947d42 Don't specify libc++ (10.9)
Since our minimum target is now 10.9, clang will default to use and link with libc++
instead of libstdc++.

This also reverts commit 162b3dee2c.
2017-10-02 20:53:05 +02:00
Allan Odgaard
2f7d55dfb8 Remove use of -rpath build setting
We no longer dynamically load any (custom) libraries or frameworks, so this setting is no longer needed.
2016-11-06 16:49:47 +07:00
Allan Odgaard
5caf3f789d Update build file generator
We no longer build frameworks as standalone targets but instead link it all together, which also means resources from “frameworks” will end up in the main bundle.

Currently the new build file generator does not create test targets and changing linker settings in frameworks is not inherited by the main target (since there is no naive way to “merge” framework specific linker settings).

For custom library dependencies (capnp, kj, and libressl) we specify them via `LIBS` using `/path/to/libfoo.a` so that the root target will inherit these dependencies and using the absolute path ensures that we get the static (rather than dynamic) version.
2016-11-06 16:49:46 +07:00
Allan Odgaard
383cae795d Move libressl include path to main target file
Although we only use the headers in a single framework, we generally do not use per-framework include paths and furthermore, by having it as a “global” setting, it’s much easier to change how TextMate is built (w/o having to analyzer compiler flags like `-I`).
2016-11-06 16:49:14 +07:00
Allan Odgaard
5befa321b9 Remove reference to obsolete target location 2016-10-24 02:21:29 +07:00
Allan Odgaard
b3c64db20f Enable preliminary C++17 support (C++1z)
Not using any new C++17 (draft) features, but we may want to use std::variant as soon as it becomes available (as we currently use boost::variant), although std::variant will be a library feature.
2016-10-12 10:43:42 +02:00
Ronald Wampler
162b3dee2c Explicitly link with libc++
When building with Xcode 8 beta (on my system at least), clang produced the following warning:

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9

It appears clang will link with libstdc++ if present by default instead of libc++. This was verified using `otool -L bundles.dylib` which produce the following output prior to this change.

bundles.dylib:
	@rpath/bundles.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/OakSystem.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/io.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/plist.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/regexp.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/scope.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/text.dylib (compatibility version 1.0.0, current version 1.0.1)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

With this change the output is now:

bundles.dylib:
	@rpath/bundles.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/OakSystem.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/io.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/plist.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/regexp.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/scope.dylib (compatibility version 1.0.0, current version 1.0.1)
	@rpath/text.dylib (compatibility version 1.0.0, current version 1.0.1)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
2016-06-14 20:49:31 +02:00
Ronald Wampler
14c6a70b85 Use our own lightweight wrapper for thread local storage
With the boost thread helper we have to statically link to the boost libraries, which on most system is built against the latest version of the OS (instead of our current target 10.7). This doesn't seem to be an actual problem, but newer versions of clang issue warnings about it.
2015-08-11 21:01:07 +02:00
Allan Odgaard
9d1d1a1a5a Link directly with static versions of boost libraries
This is currently using absolute paths since it’s a quick fix.
2015-06-13 19:16:10 +02:00
Ronald Wampler
172ce9d428 Replace thread_local with boost equivalent
The new version of clang (Apple LLVM version 6.1.0) as shipped with Xcode 6.3, disabled TLS. According to http://clang.llvm.org/cxx_status.html, in order to support `thread_local`, the C++ runtime library from g++-4.8 or later is needed.

For now, we can use the boost `thread_specific_ptr`. This is probably a reasonable solution since 1) it should be portable with old and future versions of (Apple's) clang and 2) requires no additional dependencies.
2015-04-30 15:15:56 +02:00
Allan Odgaard
09dfe50051 Avoid taking the address of compound literals
Clang considers this to be an error, previously we disabled diagnostics for this case, but probably better to adapt our code.
2014-11-30 09:12:07 +07:00
Allan Odgaard
fe798f4c0e Don’t explicitly define targets as applications or libraries
Libraries can be identified by either being linked with other targets, or exporting headers, so that is what we do.
2014-11-20 14:58:34 +01:00
Allan Odgaard
f16e83fb4f Get rid of APP_REVISION
This was just mirroring the last part of our version number so redundant and it wasn’t monotonically increasing as we switched from alpha.n → beta.1 (with n > 1), so it probably did more harm than good.
2014-10-30 20:49:10 +01:00
Allan Odgaard
ac9f64ed4a Do not specify SDK version as using ‘latest’ is generally desired
If we need to build with a specific version we can include it in CC/CXX using the --sdk argument.
2014-09-05 14:31:05 +02:00
Allan Odgaard
397fdb52d4 Make REST_API a global define and make it a C string 2014-04-28 18:23:50 +07:00
Allan Odgaard
3bc0c65c7a Introduce variable for where cap’n’proto is installed
Set the `capnp_prefix` variable when calling ./configure.

E.g. build and install cap’n’proto in $HOME/build:

    ./configure --disable-shared --prefix="$HOME/build"
    make -j6 check && make install

Then configure TextMate to find it there:

    capnp_prefix="$HOME/build" ./configure
2014-03-30 11:18:41 +07:00
Allan Odgaard
77eb21f33e Switch from C++11 → C++1y (C++14) 2014-03-16 18:06:03 +07:00
Allan Odgaard
e2d2b1ef6a Do not pass -fobjc-default-synthesize-properties to clang
This option was removed in revision 191551 of clang (Sep 27, 2013).

Property synthesizing seems to now be default, it’s unclear to me what revision of clang made the behavior default, but since we require a fairly recent version for other things (like Cap’n’proto) I don’t think this change will cause a problem.
2014-02-15 09:40:59 +07:00
Allan Odgaard
4080e1dc96 Add support for serialization of cache_t with cap’n proto
See http://kentonv.github.io/capnproto/install.html for how to install.
2013-08-18 17:14:23 +02:00
Jacob Bandes-Storch
847bef3bdd Use @rpath so frameworks can be loaded from the app bundle
@executable_path is the originally-executed program, whereas @loader_path is the program that caused the load to occur (e.g. a Quick Look generator). @rpath can be changed at link time — a QL generator can specify a value that points to the enclosing app bundle’s Frameworks directory.
2013-07-30 22:16:17 +02:00
Allan Odgaard
c9812c5e8a Do not set hidden visibility for C sources
This is for oniguruma and ideally we would set this only for the oniguruma target, but then we need special precompiled headers for that target, so this is a practical way to achieve the goal (there are no other C sources in the build tree).
2013-07-21 13:25:29 +02:00
Allan Odgaard
bd5b105a44 Only set -fobjc-link-runtime for app targets
Ideally this should be set for executable targets that use Objective-C (and have deployment target set to 10.7).

This change is a quick fix for not having pure C++ tests leak. For more info see https://github.com/sorbits/rdar/blob/master/LeakWith10_7ObjCRunTime/README.md
2013-02-25 15:28:37 +01:00
Allan Odgaard
91d786b2cd Don’t set -fobjc-arc-cxxlib=libc++
I never understood what this option was good for and now it gives a warning about being unused during compilation (even though it was set only during linking).
2013-02-02 08:52:13 +01:00
Allan Odgaard
e7b81dba9b Strip indirectly referenced dylibs
Basically libraries referenced indirectly will be setup as a requirement of the target and this option strips that. Doesn’t really matter, but enabling it rather than deleting the line (which was previously commented).
2013-01-29 21:16:49 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Allan Odgaard
065f5552bb Enable implicit @synthesize
I haven’t removed the current use of @synthesize since that results in a build that throws exceptions and crashes.
2012-09-12 18:30:37 +02:00
Allan Odgaard
7cfc9c38fc Link with -fobjc-link-runtime for arclite 2012-08-29 14:27:35 +02:00
Jacob Bandes-Storch
dca4292990 Use 64-bit: compiler/linker settings 2012-08-28 21:32:46 +02:00
Jacob Bandes-Storch
502b9e59d1 Use colored diagnostics for compiler output 2012-08-28 20:34:05 +02:00
Jacob Bandes-Storch
c6b6d1a21d Use libc++: compiler/linker settings 2012-08-28 13:30:20 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00