summaryrefslogtreecommitdiff
path: root/Meta/Lagom/CMakeLists.txt
AgeCommit message (Collapse)Author
2021-12-29Build: Remove gzip -k usage in PCI/USB ID files and crypt for OpenBSDtuftedocelot
OpenBSD gzip does not have the -k flag to keep the original after extraction. Work around this by copying the original gzip to the dest and then extracting. A bit of a hack, but only needs to be done for the first-time or rebuilds OpenBSD provides crypt in libc, not libcrypt. Adjust if/else to check for either and proceed accordingly Remove outdated OpenBSD checks when building the toolchain
2021-12-24LibGL+LibSoftGPU: Move rendering related code to LibSoftGPU libraryStephan Unverwerth
This introduces a new library, LibSoftGPU, that incorporates all rendering related features that formerly resided within LibGL itself. Going forward we will make both libraries completely independent from each other allowing LibGL to load different, possibly accelerated, rendering backends.
2021-12-22Meta: Add a cmake flag for building for compiler explorerAli Mohammad Pur
We don't need to build tests/binaries for CE.
2021-12-21LibUnicode: Dynamically load the generated UnicodeData symbolsTimothy Flynn
The generated data for libunicodedata.so is quite large, and loading it is a price paid by nearly every application by way of depending on LibRegex. In order to defer this cost until an application actually uses one of the surrounding APIs, dynamically load the generated symbols. To be able to load the symbols dynamically, the generated methods must have demangled names. Typically, this is accomplished with `extern "C"` blocks. The clang toolchain complains about this here because the types returned from the generators are strictly C++ types. So to demangle the names, we use the asm() compiler directive to manually define a symbol name; the caveat is that we *must* be sure the symbols are unique. As an extra precaution, we prefix each symbol name with "unicode_". For more details, see: https://gcc.gnu.org/onlinedocs/gcc/Asm-Labels.html This symbol loader used in this implementation provides the additional benefit of removing many [[maybe_unused]] attributes from the LibUnicode methods. Internally, if ENABLE_UNICODE_DATABASE_DOWNLOAD is OFF, the loader is able to stub out the function pointers it returns. Note that as of this commit, LibUnicode is still directly linked against LibUnicodeData. This commit is just a first step towards removing that.
2021-12-15Lagom: Add argument `WORKING_DIRECTORY` to `lagom_test(...)`Simon Woertz
So far the working directory was set in some cases using `set_tests_properties(...)`, but this requires to know which name is picked by `lagom_test(...)` when calling `add_test(...)`. In case of adding multiple test cases using a globbing pattern this would require to duplicate code to construct the test name from the file name.
2021-11-29Tests: Add a simple LibGL render-testHendiadyoin1
At the moment we just check if we *can* render a simple triangle, we do not yet actually test if the image is indeed the triangle we wanted. This test also outputs the rendered image when GL_DEBUG is enabled to a file called "picture.bmp" for manual verification. Co-authored-by: sunverwerth <s.unverwerth@serenityos.org>
2021-11-29Lagom: Add LibGL to the librariesHendiadyoin1
2021-11-29Lagom: Disable implicit-const-int-float-conversion warningsHendiadyoin1
2021-11-23Meta: Define LagomMain outside of the BUILD_LAGOM branchTimothy Flynn
This allows code generators to use LagomMain. Otherwise, during CI, they are built during the superbuild without BUILD_LAGOM=ON.
2021-11-22js: Port to LibMain :^)Linus Groh
This wasn't particularly difficult, and there's not much use for the nicer interface yet either. While unveil() is of limited use in js(1) as it should be able to open arbitrary files, I feel like we should be able to add a pledge() call.
2021-11-22Lagom: Add LibMain as a lagom_lib()Linus Groh
2021-10-30Lagom/Fuzzers: Add fuzzer for PDF documentBrendan Coles
2021-10-16Lagom: Do not use -fno-sematic-interposition in fuzzer buildsNico Weber
Apparently it breaks the fuzzer build. There's probably a better fix for this, but for now just unbreak the fuzzer build. Keep this for non-fuzzer builds though since it's apparently a 17% speedup for running test262 tests :^)
2021-10-15Lagom: Build with -fno-no-semantic-interpositionNico Weber
Lagom: Build with -fno-no-semantic-interposition We build with this in non-lagom builds, and serenity's gcc even adds it to its CC1_SPEC. Let's use it for lagom too. Reduces the number of dynamic relocations in liblagom-js.so.0.0.0 (per `objdump -R`) from 15133 to 14534, and increases its size back to 91M (95156800 bytes), probably due to more inlining being possible. This might help perf of lagom binaries.
2021-10-15Lagom: Build with -fno-exceptionsNico Weber
We build with this in non-lagom builds, so there's no reason not to use it in lagom builds as well. Reduces the size of liblagom-js.so.0.0.0 from 94M to 90M (from 98352784 to 93831056 bytes to be exact).
2021-10-10markdown-checker: New tool that checks document linksBen Wiederhake
2021-10-10Meta: Re-enable warnings for deprecated copies also for LagomBen Wiederhake
2021-10-07Meta: Disable -Wmaybe-uninitialized for LagomIdan Horowitz
2021-10-03LibJS: Add a specific test for invalid unicode characters in the lexerdavidot
Also fixes that it tried to make substrings past the end of the source if we overran the source length.
2021-09-16Meta: Fix Lagom RPATH for non-Ubuntu Linux and macOS hostsAndrew Kaster
Multi-lib distros like Gentoo and Fedora install lagom-core.so into lagom-install/lib64 rather than lib. Set the install RPATH based on CMAKE_INSTALL_LIBDIR to avoid the wrong path being set in the binaries. Also apply macOS specific RPATH rules to fix the build on that platform.
2021-09-15Meta: Add FIXME for not setting BUILD_SHARED_LIBS in Lagom buildAndrew Kaster
This is really the business of the consuming project. We will need to make changes to libjs-test262 and to oss-fuzz to address this properly.
2021-09-15Meta: Switch to a SuperBuild that splits host and target buildsAndrew Kaster
Replace the old logic where we would start with a host build, and swap all the CMake compiler and target variables underneath it to trick CMake into building for Serenity after we configured and built the Lagom code generators. The SuperBuild creates two ExternalProjects, one for Lagom and one for Serenity. The Serenity project depends on the install stage for the Lagom build. The SuperBuild also generates a CMakeToolchain file for the Serenity build to use that replaces the old toolchain file that was only used for Ports. To ensure that code generators are rebuilt when core libraries such as AK and LibCore are modified, developers will need to direct their manual `ninja` invocations to the SuperBuild's binary directory instead of the Serenity binary directory. This commit includes warning coalescing and option style cleanup for the affected CMakeLists in the Kernel, top level, and runtime support libraries. A large part of the cleanup is replacing USE_CLANG_TOOLCHAIN with the proper CMAKE_CXX_COMPILER_ID variable, which will no longer be confused by a host clang compiler.
2021-09-15Meta: Move all options to targetname_options.cmake filesAndrew Kaster
This common strategy of having a serenity_option() macro defined in either the Lagom or top level CMakeLists.txt allows us to do two things: First, we can more clearly see which options are Serenity-specific, Lagom-specific, or common between the target and host builds. Second, it enables the upcoming SuperBuild changes to set() the options in the SuperBuild's CMake cache and forward each target's options to the corresponding ExternalProject.
2021-09-15Meta: Add Meta/CMake to the CMAKE_MODULE_PATH for Serenity and LagomAndrew Kaster
This makes it so we don't need to specify the full path to all the helper scripts we include() from different places in the codebase and feels a lot cleaner.
2021-08-31Tests: Test LibMarkdown against commonmark test suitePeter Elliott
TestCommonmark runs the CommonMark test suite (https://spec.commonmark.org/0.30/spec.json) against LibMarkdown. Currently 44/652 tests pass.
2021-08-30CMake: Add custom target to build only the generated sourcesBrian Gianforcaro
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-28Everywhere: Move all host tools into the Lagom/Tools subdirectoryAndrew Kaster
This allows us to remove all the add_subdirectory calls from the top level CMakeLists.txt that referred to targets linking LagomCore. Segregating the host tools and Serenity targets helps us get to a place where the main Serenity build can simply use a CMake toolchain file rather than swapping all the compiler/sysroot variables after building host libraries and tools.
2021-08-28Meta+LibUnicode: Move unicode_data helper to Meta/CMakeAndrew Kaster
Moving this helper CMake file to the centralized Meta/CMake folder helps to get a better grasp on what extra files are required for the build, and what files are generated. While we're at it, don't use add_compile_definitions for ENABLE_UNICODE_DATA, which only needs to be seen by LibUnicode sources.
2021-08-17Meta: Semi-automatically detect ccache for Lagom buildsTimothy Flynn
The top-level CMakeLists.txt already automatically detects ccache, but CI will invoke CMake with Lagom's CMakeLists.txt. Add an option to Lagom to do the same detection.
2021-08-02Meta: Add BUILD_SHARED_LIBS option for Lagom buildsAndrew Kaster
This standard CMake option controls whether add_library() calls will use STATIC or SHARED by default. The flag is set to on by default since that's what we want for normal CI jobs and local builds and the test262 runner, but disabled for oss-fuzz builds. This should finally fix the oss-fuzz build after it was broken in #9017 oss-fuzz un-breakage was verified by running the following commands in the oss-fuzz repo: python infra/helper.py build_image serenity python infra/helper.py build_fuzzers --sanitizer address --engine afl \ --architecture x86_64 serenity /path/to/local/checkout/Meta/Lagom python infra/helper.py check_build --sanitizer address --engine afl \ --architecture x86_64 serenity
2021-07-30LibRegex+LibUnicode: Begin implementing Unicode property escapesTimothy Flynn
This supports some binary property matching. It does not support any properties not yet parsed by LibUnicode, nor does it support value matching (such as Script_Extensions=Latin).
2021-07-29Lagom: Add proper install rulesAndrew Kaster
Create the proper export files to allow Lagom to be a well-behaved ExternalProject, based on the example project from the cmake-init project generator here: https://github.com/friendlyanon/cmake-init-shared-static
2021-07-29Lagom: Exclude GMLAutocompleteProvider.cpp from GML library sourcesLinus Groh
2021-07-29Lagom: Change to shared library build for all Lagom codeAndrew Kaster
Split the Lagom build into shared libraries to match the Serenity build. This reduces the cognitive load when trying to edit the Lagom CMakeLists significantly. It also reduces the amount of source files that must be compiled to run each test or host program significantly. Also re-organize all the build rules into sections. And reorganize the CMakeLists file in general.
2021-07-29LibTTF/LibGfx: Remove circular dependency by merging LibTTF into LibGfxAndrew Kaster
LibTTF has a concrete dependency on LibGfx for things like Gfx::Bitmap, and LibGfx has a concrete dependency in the TTF::Font class in Gfx::FontDatabase. This circular dependency works fine for Serenity and Lagom Linux builds of the two libraries. It also works fine for static library builds on Lagom macOS builds. However, future changes will make Lagom use shared libraries, and circular library dependencies are not tolerated in macOS.
2021-07-26Meta: Add LibUnicode (and its tests) to LagomTimothy Flynn
This is primarily to allow using LibUnicode within LibJS and its REPL. Note: this seems to be the first time that a Lagom dependency requires generated source files. For this to work, some of Lagom's CMakeLists.txt commands needed to be re-organized to include the CMake files that fetch and parse UnicodeData.txt. The paths required to invoke the generator also differ depending on what is currently building (SerenityOS vs. Lagom as part of the Serenity build vs. a standalone Lagom build).
2021-07-08Lagom: Exclude LibSQL/SQLClient.cpp and the sql utility from LagomJan de Visser
Lagom doesn't seem to like IPC services, and sql needs SQLClient.
2021-07-06Meta: Fix building Lagom on LinuxGunnar Beutner
2021-07-06LibThreading: Fix building the library on macOSGunnar Beutner
2021-06-24LibSQL: Move Lexer and Parser machinery to AST directoryJan de Visser
The SQL engine is expected to be a fairly sizeable piece of software. Therefore we're starting to restructure the codebase for growth.
2021-06-22LibCore: Add unit test for File::read_linecoderdreams
2021-06-19LibCrypto+LibTLS: Split and move test suite into Tests directoryPeter Bocan
This change splits test-crypto.cpp from Userland into separate test suites located in Tests/ directory.
2021-06-17Lagom: Add an install targetsin-ack
This is used by libjs-test262-runner to be able to copy the libraries within its own build directory in order to link with them.
2021-06-15LibJS: Add a basic pass manager and add some basic passesAli Mohammad Pur
This commit adds a bunch of passes, the most interesting of which is a pass that merges blocks together, and a pass that places blocks that flow into each other next to each other, and a very simply pass that removes duplicate basic blocks. Note that this does not remove the jump at the end of each block in that pass to avoid scope creep in the passes.
2021-06-11Meta: Fuzz the LibIMAP Parserx-yl
2021-05-27Meta: Run the Wasm spec tests in CIAli Mohammad Pur
Since LibWasm is still not capable of passing all of the spec tests, ignore failing tests, only fail the build if some segfault/abort/etc occurs.
2021-05-21LibWasm+Meta: Add test-wasm and optionally test the conformance testsAli Mohammad Pur
This only tests "can it be parsed", but the goal of this commit is to provide a test framework that can be built upon :) The conformance tests are downloaded, compiled* and installed only if the INCLUDE_WASM_SPEC_TESTS cmake option is enabled. (*) Since we do not yet have a wast parser, the compilation is delegated to an external tool from binaryen, `wasm-as`, which is required for the test suite download/install to succeed. This *does* run the tests in CI, but it currently does not include the spec conformance tests.
2021-05-18LibJS+LibTest: Move out the test-js test runner into LibTestAli Mohammad Pur
2021-05-17Meta: Build LibWasm and the wasm utility as part of LagomAli Mohammad Pur
2021-05-14Lagom: Enable sanitizer builds with gccAndrew Kaster
Previously the CMake options for -fsanitize=address, thread and undefined were gated behind clang, which was unecessary. Only -fsanitize=fuzzer is clang-only.