Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,22 @@ closereq (only thing really missing, will need to figure out how to deal with mu
Linux or MinGW `g++` (C++):
```
cd build
g++ -o <binary> ../<source> -I../../HUI -L. -lHUI
g++ -o <binary> ../<source> -I../../HUI/{c,c++} -L. -lHUI
```
Linux or MinGW `gcc` (C):
```
cd build
gcc -o <binary> ../<source> -I../../HUI -L. -lHUI
gcc -o <binary> ../<source> -I../../HUI/c -L. -lHUI
```
Windows MSVC `cl.exe` (C++):
```
cd build
cl /EHsc /Fe:<binary>.exe ../<source> /I../../HUI /link /LIBPATH:. libHUI.lib
cl /EHsc /Fe:<binary>.exe ../<source> /I../../HUI/c /I../../HUI/c++ /link /LIBPATH:. libHUI.lib
```
Windows MSVC `cl.exe` (C):
```
cd build
cl /Fe:<binary>.exe ../<source> /I../../HUI /link /LIBPATH:. libHUI.lib
cl /Fe:<binary>.exe ../<source> /I../../HUI/c /link /LIBPATH:. libHUI.lib
```
Rust (first, copy your project into HUI root):
```
Expand Down Expand Up @@ -229,7 +229,7 @@ HUI 'newnew' - attempt to reimplement HUI from beginning \

- [ ] single master build script for everything + make it possible to combine windowcontrols/webview/windowembeder in different languages at linkage time
- [ ] debug control flag/rust --debug/release
- [ ] c, cpp, rust, python bindings in own directories
- [x] c, cpp, rust, python bindings in own directories
- [ ] put backends in own directories + make it possible to build webview and controls separately
- [ ] handle hui.js and hui.css as define/text replace (so we dont need quoting)
- [ ] create master build script that calls others + build scripts directory + release naming ( HUI-{platform}-{backend}_{version or commit hash}_{more info} )
Expand Down
4 changes: 2 additions & 2 deletions build_linux_dummy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cd $BUILD
## Build

# build
g++ -shared -fPIC -o ./libHUI.so ../hui_webview__dummy.cc ../hui_controls__dummy.cc -I..
g++ -shared -fPIC -o ./libHUI.so ../hui_webview__dummy.cc ../hui_controls__dummy.cc -I../{c,c++}


## Deploy
Expand All @@ -43,7 +43,7 @@ fi
## Tests
if [[ " $@ " =~ " --tests " ]]; then
# build tests
g++ -o test_webview_js_api ../tests/test_webview_js_api.cc -I.. -L. -lHUI
g++ -o test_webview_js_api ../tests/test_webview_js_api.cc -I../{c,c++} -L. -lHUI
fi


Expand Down
8 changes: 4 additions & 4 deletions build_linux_gtk3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ cd $BUILD
## Build

# build
g++ -fPIC -c -o ./libHUIwebview.o ../hui_webview__webkit_gtk3.cc -I.. `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.1`
g++ -fPIC -c -o ./libHUIcontrols.o ../hui_windowcontrols__gtk3.cc -I.. `pkg-config --cflags --libs gtk+-3.0 gtk-layer-shell-0`
g++ -shared -fPIC -o ./libHUI.so ./libHUIwebview.o ./libHUIcontrols.o -I.. `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.1 gtk-layer-shell-0`
g++ -fPIC -c -o ./libHUIwebview.o ../hui_webview__webkit_gtk3.cc -I../{c,c++} `pkg-config --cflags gtk+-3.0 webkit2gtk-4.1`
g++ -fPIC -c -o ./libHUIcontrols.o ../hui_windowcontrols__gtk3.cc -I../{c,c++} `pkg-config --cflags gtk+-3.0 gtk-layer-shell-0`
g++ -shared -fPIC -o ./libHUI.so ./libHUIwebview.o ./libHUIcontrols.o `pkg-config --libs gtk+-3.0 webkit2gtk-4.1 gtk-layer-shell-0`


## Deploy
Expand All @@ -45,7 +45,7 @@ fi
## Tests
if [[ " $@ " =~ " --tests " ]]; then
# build tests
g++ -o test_webview_js_api ../tests/test_webview_js_api.cc -I.. -L. -lHUI
g++ -o test_webview_js_api ../tests/test_webview_js_api.cc -I../{c,c++} -L. -lHUI
fi


Expand Down
4 changes: 2 additions & 2 deletions build_linux_qt5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cd $BUILD
## Build

# build
g++ -shared -fPIC -o ./libHUI.so ../hui_webview__webkit_qt5.cc ../hui_windowcontrols__qt5.cc -I.. `pkg-config --cflags --libs Qt5Widgets Qt5WebKitWidgets`
g++ -shared -fPIC -o ./libHUI.so ../hui_webview__webkit_qt5.cc ../hui_windowcontrols__qt5.cc -I../{c,c++} `pkg-config --cflags --libs Qt5Widgets Qt5WebKitWidgets`

# TODO: qmake *.moc

Expand All @@ -43,7 +43,7 @@ fi
## Tests
if [[ " $@ " =~ " --tests " ]]; then
# build tests
g++ -o test_webview_js_api ../tests/test_webview_js_api.cc -I.. -L. -lHUI
g++ -o test_webview_js_api ../tests/test_webview_js_api.cc -I../{c,c++} -L. -lHUI
fi


Expand Down
4 changes: 2 additions & 2 deletions build_mingw_dummy.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cd $BUILD
## Build

# build with simple g++
g++ -shared -fPIC -o ./libHUI.dll ../hui_webview__dummy.cc ../hui_controls__dummy.cc -I..
g++ -shared -fPIC -o ./libHUI.dll ../hui_webview__dummy.cc ../hui_controls__dummy.cc -I../{c,c++}


## Deploy
Expand All @@ -60,7 +60,7 @@ if [[ " $@ " =~ " --tests " ]]; then
#ldd <your_executable> | grep -vE /c/WINDOWS\|System32\|SYSTEM32 | awk '{print $3}' | xargs -I {} sh -c '[ -f {} ] && cp {} .'

# build tests
g++ -o test_webview_js_api.exe ../tests/test_webview_js_api.cc -I.. -L. -lHUI
g++ -o test_webview_js_api.exe ../tests/test_webview_js_api.cc -I../{c,c++} -L. -lHUI

fi

Expand Down
4 changes: 2 additions & 2 deletions build_mingw_dummy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cd $BUILD
## Build

# build with simple g++
g++ -shared -fPIC -o ./libHUI.dll ../hui_webview__dummy.cc ../hui_controls__dummy.cc -I..
g++ -shared -fPIC -o ./libHUI.dll ../hui_webview__dummy.cc ../hui_controls__dummy.cc -I../{c,c++}


## Deploy
Expand All @@ -42,7 +42,7 @@ if [[ " $@ " =~ " --tests " ]]; then
#ldd <your_executable> | grep -vE /c/WINDOWS\|System32\|SYSTEM32 | awk '{print $3}' | xargs -I {} sh -c '[ -f {} ] && cp {} .'

# build tests
g++ -o test_webview_js_api.exe ../tests/test_webview_js_api.cc -I.. -L. -lHUI
g++ -o test_webview_js_api.exe ../tests/test_webview_js_api.cc -I../{c,c++} -L. -lHUI

fi

Expand Down
4 changes: 2 additions & 2 deletions build_mingw_qt5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cd $BUILD
## Build

# build with simple g++
g++ -shared -fPIC -o ./libHUI.dll ../hui_webview__webkit_qt5.cc ../hui_windowcontrols__qt5.cc -I.. `pkg-config --cflags --libs Qt5Widgets Qt5WebKitWidgets`
g++ -shared -fPIC -o ./libHUI.dll ../hui_webview__webkit_qt5.cc ../hui_windowcontrols__qt5.cc -I../{c,c++} `pkg-config --cflags --libs Qt5Widgets Qt5WebKitWidgets`


## Deploy
Expand All @@ -54,7 +54,7 @@ if [[ " $@ " =~ " --tests " ]]; then
#ldd <your_executable> | grep -vE /c/WINDOWS\|System32\|SYSTEM32 | awk '{print $3}' | xargs -I {} sh -c '[ -f {} ] && cp {} .'

# build tests
g++ -o test_webview_js_api.exe ../tests/test_webview_js_api.cc -I.. -L. -lHUI
g++ -o test_webview_js_api.exe ../tests/test_webview_js_api.cc -I../{c,c++} -L. -lHUI

fi

Expand Down
2 changes: 1 addition & 1 deletion build_win_cef.bat
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ REM Tests
if not "%ARGS%" == "%ARGS: --tests =%" (

:: build tests
cl /EHsc /Fe:test_webview_js_api.exe ../tests/test_webview_js_api.cc /I.. /link /LIBPATH:. libHUI.lib
cl /EHsc /Fe:test_webview_js_api.exe ../tests/test_webview_js_api.cc /I..\c /I..\c++ /link /LIBPATH:. libHUI.lib

)

Expand Down
4 changes: 2 additions & 2 deletions build_win_dummy.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ REM Build
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"

:: build
cl /LD /EHsc /D"and=&" /Fe:libHUI.dll ..\hui_webview__dummy.cc ..\hui_controls__dummy.cc
cl /LD /EHsc /D"and=&" /Fe:libHUI.dll ..\hui_webview__dummy.cc ..\hui_controls__dummy.cc /I..\c /I..\c++

:: create definiton file (dumpbin output edited to be "EXPORTS \n HUI_<list of all methods> \n ...") - its easier to have the file prepared and just copy it
::dumpbin.exe /EXPORTS HUI.dll > HUI.def
Expand All @@ -55,7 +55,7 @@ REM Tests
if not "%ARGS%" == "%ARGS: --tests =%" (

:: build tests
cl /EHsc /Fe:test_webview_js_api.exe ../tests/test_webview_js_api.cc /I.. /link /LIBPATH:. libHUI.lib
cl /EHsc /Fe:test_webview_js_api.exe ../tests/test_webview_js_api.cc /I..\c /I..\c++ /link /LIBPATH:. libHUI.lib

)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions cef_CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ foreach(flag_var
endforeach()

# Additional include and link directories
include_directories(../c)
include_directories(../c++)
include_directories(${CEF_ROOT}/include)
include_directories(${CEF_ROOT})

Expand Down
2 changes: 1 addition & 1 deletion hui_webview__webkit_gtk3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define _hui_webview_use_common_code
#include "HUI.hh"

#include "./hui_datatypes.h"
#include "hui_datatypes.h"
#include <fstream>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
Expand Down
2 changes: 1 addition & 1 deletion hui_webview__webkit_qt5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "HUI.hh"


#include "./hui_datatypes.h"
#include "hui_datatypes.h"
#include <fstream>
#include <QtWidgets/QApplication>
#include <QtWidgets/QDesktopWidget>
Expand Down
2 changes: 1 addition & 1 deletion hui_windowcontrols__gtk3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "HUI.hh"

#include "./hui_datatypes.h"
#include "hui_datatypes.h"
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <gdk/gdkwayland.h>
Expand Down
2 changes: 1 addition & 1 deletion hui_windowcontrols__qt5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "HUI.hh"

#include "./hui_datatypes.h"
#include "hui_datatypes.h"
#include <fstream>
#include <QtWidgets/QApplication>
#include <QtWidgets/QDesktopWidget>
Expand Down
6 changes: 3 additions & 3 deletions python/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
print("installing dependencies...")
os.system("pacman -S --noconfirm --needed mingw-w64-x86_64-pybind11")
print("running build...")
os.system('bash -c "g++ -O3 -shared -fPIC ../python/hui_python.cc -o HUI$(python3-config --extension-suffix) -I.. -L. -lHUI $(python3 -m pybind11 --includes) -lpython'+str(sys.version_info.major)+'.'+str(sys.version_info.minor)+'"') # '-lpython3.12' needed to avoid 'undefined reference to'
os.system('bash -c "g++ -O3 -shared -fPIC ../python/hui_python.cc -o HUI$(python3-config --extension-suffix) -I../c -I../c++ -L. -lHUI $(python3 -m pybind11 --includes) -lpython'+str(sys.version_info.major)+'.'+str(sys.version_info.minor)+'"') # '-lpython3.12' needed to avoid 'undefined reference to'

else:
print("building on windows (msvc)...")
Expand All @@ -27,7 +27,7 @@
pyname = "python"+str(sys.version_info.major)+str(sys.version_info.minor) # python312
suffix = sysconfig.get_config_var('EXT_SUFFIX') # .cp312-win_amd64.pyd
#os.system("call \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\" && cl /LD /EHsc /O2 /Fe:HUI"+suffix+" ../python/hui_python.cc "+includes+" /I\"..\" /link /LIBPATH:\""+libpath+"\\libs"+"\" "+pyname+".lib libHUI.lib")
os.system("cl /LD /EHsc /O2 /Fe:HUI"+suffix+" ../python/hui_python.cc "+includes+" /I\"..\" /link /LIBPATH:\""+libpath+"\\libs"+"\" "+pyname+".lib libHUI.lib")
os.system("cl /LD /EHsc /O2 /Fe:HUI"+suffix+" ../python/hui_python.cc "+includes+" /I\"..\\c\" /I\"..\\c++\" /link /LIBPATH:\""+libpath+"\\libs"+"\" "+pyname+".lib libHUI.lib")

print("done")

Expand All @@ -48,7 +48,7 @@
print("unknown linux distro, hope you have everything installed...")

print("running build...")
os.system("g++ -O3 -shared -fPIC ../python/hui_python.cc -o HUI$(python3-config --extension-suffix) -I.. -L. -lHUI $(python3 -m pybind11 --includes)")
os.system("g++ -O3 -shared -fPIC ../python/hui_python.cc -o HUI$(python3-config --extension-suffix) -I../c -I../c++ -L. -lHUI $(python3 -m pybind11 --includes)")
print("done")


Expand Down
Loading