Skip to content

Commit

Permalink
Fix MacOS build (#34)
Browse files Browse the repository at this point in the history
* Testing xquartz

* Update build.yml

* Trying to fix macos build

For #33

* utils/paths.hpp: include <cstdint>

* Update gen-components.tsx

* Update ui-field.types.hpp &  ui-field.types.cpp  to remove uint

* Fixes to build.yml before merging & timeout

---------

Co-authored-by: KaruroChori <[email protected]>
  • Loading branch information
andy5995 and KaruroChori authored Dec 4, 2024
1 parent 0ff3686 commit 1d50780
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 8
env:
CC: clang-19
CXX: clang++-19
Expand Down Expand Up @@ -70,9 +71,15 @@ jobs:
bun run codegen
bun run meson-setup.clang-release
meson compile -C build/ vs:executable
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: logs
path: |
build/meson-logs/**/*
macos:
runs-on: macos-14
timeout-minutes: 8
env:
LDFLAGS: '-L/opt/homebrew/opt/llvm/lib'
CPPFLAGS: '-I/opt/homebrew/opt/llvm/include'
Expand All @@ -89,6 +96,7 @@ jobs:
libpng \
meson \
ninja
brew install --cask xquartz
cd /opt/homebrew/opt/llvm/bin
#ln -s clang++ clang++-19
PATH=/opt/homebrew/opt/llvm/bin:$PATH
Expand All @@ -100,5 +108,12 @@ jobs:
bun install
bun run codegen
meson setup --reconfigure build/ --buildtype=release --native-file toolchains/flatpak.ini
# Unclear fix to be investigated
rm subprojects/libtcc/VERSION
meson compile -C build/ vs:executable
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: logs
path: |
build/meson-logs/**/*
4 changes: 2 additions & 2 deletions include/ui-field.types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ namespace field_types{

// Helpers to compute expressions into values that Fl_Widgets can use.

bool h_px(uint T, size_t *dst, const char *expr,
bool h_px(unsigned int T, size_t *dst, const char *expr,
const ui_base *env);
bool h_colour(uint32_t *dst, const char *expr,
const ui_base *env);

bool h_flag(bool *dst, const char *expr,
const ui_base *env);
}
}
}
3 changes: 2 additions & 1 deletion include/utils/paths.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
*/

#include <cstdint>
#include <cstring>
#include <string>
#include <utils/policies.hpp>
Expand Down Expand Up @@ -185,4 +186,4 @@ struct resolve_path{
#undef tnk
#undef prefix

}
}
3 changes: 2 additions & 1 deletion scripts/codegen/gen-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class ${cppname} : public ${data.codegen.extends}{
`;

let class_impl = `
#include <cstdint>
#include <components/autogen/${data.ns}/${data.name}.hpp>
namespace vs{
Expand Down Expand Up @@ -209,4 +210,4 @@ await Bun.write('./commons/schemas/json-component.schema.json', JSON.stringify(w

if (process.argv[2] != 'quick') {
await Bun.write('./src/components/autogen/meson.build', `autogen_components = [${cpp_files.map(x => `'${x}'`)}]`)
}
}
4 changes: 2 additions & 2 deletions src/ui-field.types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace field_types{


//TODO: I need to check if number conversions failed or not too.
bool h_px(uint T, size_t* dst, const char* expr, const ui_base* env){
bool h_px(unsigned int T, size_t* dst, const char* expr, const ui_base* env){
if (T==1){
dst[0]=std::stoi(expr);
return true;
Expand Down Expand Up @@ -182,4 +182,4 @@ namespace field_types{

}

}
}

0 comments on commit 1d50780

Please sign in to comment.