Skip to content

Commit

Permalink
fix: windows build of zencode-exec
Browse files Browse the repository at this point in the history
also build osx and add zencode-exec to released packages
  • Loading branch information
jaromil committed Jun 30, 2023
1 parent 1e42cc7 commit dd62a34
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ jobs:
name: release-bin-linux-amd64
path: |
src/zenroom
src/zencode-exec
- name: Clean for next build
run: make clean
- name: Build x86_64 shlib
Expand All @@ -552,9 +553,29 @@ jobs:
name: release-exe-win-w64
path: |
src/zenroom.exe
src/zencode-exec.exe
src/libzenroom_dll.lib
src/zenroom.dll
build-release-on-osx:
name: 🍎 mac osx release build
needs: [semantic-release]
runs-on: macos-latest
if: ${{ needs.semantic-release.outputs.release == 'True' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
make osx
- name: Upload artifact win x86_64
uses: actions/upload-artifact@v3
with:
name: release-bin-osx
path: |
src/zenroom.command
src/zencode-exec.command
draft-binary-release:
name: 📦 Pack release
needs: [semantic-release, build-release-on-ubuntu]
Expand Down
2 changes: 1 addition & 1 deletion src/stamp-exe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BEGIN
VALUE "LegalCopyright", "Written and designed by Denis Roio <[email protected]>"
VALUE "OriginalFilename", "zenroom.exe"
VALUE "ProductName", "Zenroom"
VALUE "ProductVersion", "`cat ../VERSION`"
VALUE "ProductVersion", "3"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 8 additions & 0 deletions src/zencode-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@

#include <zenroom.h>

#if !defined(ARCH_WIN)
#include <sys/poll.h>
#endif

int main(int argc, char **argv) {
(void)argc;
(void)argv;
register int ret;
zenroom_t *Z;

#if !defined(ARCH_WIN)
struct pollfd fds;
#endif

char script_b64[MAX_ZENCODE];
char keys_b64[MAX_FILE];
Expand All @@ -42,6 +47,8 @@ int main(int argc, char **argv) {
data_b64[0] = 0x0;
conf[0] = 0x0;

// TODO(jaromil): find a way to check stdin on windows
#if !defined(ARCH_WIN)
fds.fd = 0; // stdin
fds.events = POLLIN;
ret = poll(&fds, 1, 0);
Expand All @@ -52,6 +59,7 @@ int main(int argc, char **argv) {
fprintf(stderr,"stdin error: %s\n",strerror(errno));
exit(1);
}
#endif

if( fgets(conf, MAX_CONFIG, stdin) ) {
if(strlen(conf)>=MAX_CONFIG) {
Expand Down

0 comments on commit dd62a34

Please sign in to comment.