cmake: add flags to only build the compiler

... and to use an external compiler

For example, this is how one only build the compiler:

```
cmake .. -DSLINT_BUILD_RUNTIME=OFF -DCMAKE_INSTALL_PREFIX=/tmp/slint_compiler
make install
```

And this only build the runtime
```
cmake .. -DSLINT_FEATURE_COMPILER=OFF -DCMAKE_INSTALL_PREFIX=/tmp/install_runtime
make install
```

And then this can be used in a project like so:
```
cmake .. -DCMAKE_PREFIX_PATH=/tmp/install_runtime/ -DSLINT_COMPILER=/tmp/install_compiler/bin/slint-compiler
```
This commit is contained in:
Olivier Goffart 2023-09-15 14:42:52 +02:00 committed by GitHub
parent d299f0bf3e
commit 14f7fe4ba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 265 additions and 243 deletions

View file

@ -45,7 +45,9 @@ if(NOT SLINT_FEATURE_FREESTANDING)
endif()
slint_test(models)
add_subdirectory(multiple-includes)
if(SLINT_FEATURE_COMPILER OR SLINT_COMPILER)
add_subdirectory(multiple-includes)
endif()
slint_test(platform_eventloop)
target_link_libraries(test_platform_eventloop PRIVATE Threads::Threads)