Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Kaster
f8e1544f41 StateMachineGenerator: Pass output file as an argument
This allows us to avoid shell redirection to create output files, and
will help with the GN build.
2023-08-19 21:05:06 -06:00
kleines Filmröllchen
d1645efde9 Meta+Userland: Allow generating C++ initializer code from GML
This does the exact same thing as the runtime initializer,
except it is faster and can catch some errors much earlier.

The code generator includes these important features:
- Automatic include generation where necessary
- Special-casing for TabWidget and ScrollableContainerWidget
- No use of DeprecatedString where possible
2023-08-11 21:33:48 +02:00
kleines Filmröllchen
1e67435ff5 Meta: Rename compile_gml to stringify_gml
This is what this function really does, it doesn't compile anything.
2023-08-11 21:33:48 +02:00
Andrew Kaster
aa329cb2f8 IPCCompiler: Add option to pass output file path
Instead of requiring the caller to redirect stdout, let's be nice
citizens and add an option for the output file.
2023-07-07 06:41:51 -04:00
Andreas Kling
2ac385f4db CMake: Don't mess with absolute compile_ipc() source paths
If given an absolute path, compile_ipc() should just use it verbatim
instead of trying to be helpful.
2022-10-06 11:23:53 +02:00
Andrew Kaster
5ab3fcf710 Meta: Update jakt build support for fully bootstrapped compiler
Remove the Corrosion dependency, and use the now-builtin
add_jakt_executable function from the Jakt install rules to build our
example application.

By using find_package(Jakt), we now have to set ENABLE_JAKT manually on
both serenity and Lagom at the same time, so the preferred method to do
this for now is:

    cmake -B Build/superbuild<arch><toolchain> \
          -S Meta/CMake/Superbuild \
          -DENABLE_JAKT=ON \
          -DJAKT_SOURCE_DIR=/path/to/jakt

Where omitting JAKT_SOURCE_DIR will still pull from the main branch of
SerenityOS/jakt. This can be done after runing Meta/serenity.sh run.
2022-09-09 11:23:42 +02:00
Andrew Kaster
02e8f29560 Meta: Use CMAKE_INSTALL_FOODIR variables instead of hardcoding usr/foo
In preparation for future refactoring of Lagom, let's use the variables
from GNUInstallDirs as much as possible for the helper macros and other
scripts used by the main build already.
2022-07-06 14:24:23 +02:00
Andrew Kaster
fef83ed47d Meta: Install runtime/utility from jakt to make hello-jakt build again
Also add a compile flag that fixes a warning from including <serenity.h>
2022-06-19 09:00:02 +02:00
MacDue
4656198127 Meta: Add -S to Jakt compiler invocation in compile_jakt
This prevents the Jakt compiler from attempting to compile the
generated C++ source itself.
2022-05-25 09:48:28 +02:00
Andrew Kaster
ca42da23c2 Meta+Userland: Add jakt as an optional Lagom Tool
We can now use ENABLE_JAKT to pull jakt as a host tool and use it to
pre-process .jakt files into .cpp files for use in serenity applications
2022-05-23 23:05:45 +02:00
Itamar
b6f358689c CMake: Modify include path when building from Hack Studio
With regular builds, the generated IPC headers exist inside the Build
directory. The path Userland/Services under the build directory is
added to the include path.

For in-system builds the IPC headers are installed at /usr/include/.
To support this, we add /usr/include/Userland/Services to the build path
when building from Hack Studio.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2022-03-19 22:02:44 +01:00
Itamar
fe7d28e870 CMake: Install generated IPC headers under /usr/include in compile_ipc()
Generated IPC headers are now installed under /usr/include in the
system's filesystem image.
2022-03-19 22:02:44 +01:00
Andrew Kaster
a269a32a17 Meta: Use Lagom:: namespaced names for code generators
This will be required when we switch to a SuperBuild that has Lagom as
a configure time dependency, but is a distinct enough change to be
separate.
2021-09-15 19:04:52 +04:30
Brian Gianforcaro
619200774b CMake: Add custom target to build only the generated sources
This is needed so all headers and files exist on disk, so that
the sonar cloud analyzer can find them when executing the compilation
commands contained in compile_commands.json, without actually building.

Co-authored-by: Andrew Kaster <akaster@serenityos.org>
2021-08-30 16:44:16 +02:00
Andrew Kaster
20e904d87c Meta: Move code generator helpers to their own CMake helper file
compile_gml, compile_ipc, and generate_state_machine all use host
tools to generate sources for the target build. As part of trying to
organize host tools into a common area, let's move these helper rules to
a common file that we can add other host tools to later. And, keep the
host tool helpers separate from the CMake target helpers for apps and
libraries.
2021-08-28 08:44:17 +01:00