Skip to content

Commit

Permalink
Added utf-8 compiler option for windows compile
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Jan 9, 2025
1 parent 66ced32 commit ce2afd0
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 9 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ endif()

# Disable abi warnings (nlohmann)
if(WIN32)
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
else()
SET(GCC_VSCP_COMPILE_FLAGS "-Wno-psabi -D WITH_SYSTEMD")
endif()
Expand Down Expand Up @@ -166,7 +168,7 @@ if(WIN32)
add_definitions(-DWIN32_LEAN_AND_MEANS)
add_definitions(-DOPENSSL_API_1_1)
add_definitions(-D_POSIX_C_SOURCE)
add_definitions(-DVCPKG_TARGET_TRIPLET=x64-windows)
add_definitions(-DVCPKG_TARGET_TRIPLET=x64-windows)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(LIBS_SYSTEM ws2_32)
if (MSVC)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Documentation for VSCP is available at [https://docs.vscp.org](https://docs.vscp
Checkout with

```bash
git clone -j8 https://github.com/grodansparadis/vscp.git
git clone -j4 --recurse-submodules https://github.com/grodansparadis/vscp.git
```

<p>A short introduction to VSCP is available
Expand Down
Binary file modified database
Binary file not shown.
45 changes: 42 additions & 3 deletions docs/setting_up_the_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ unzip file
If you want to use bleeding edge source use git and clone the repository with

```bash
git clone https://github.com/grodansparadis/vscp.git
git clone -j4 --recurse-submodules https://github.com/grodansparadis/vscp.git
```

*Note* For a production system choosing a stable release version is strongly recommended.
Expand All @@ -113,7 +113,7 @@ You can also download a zip of the latest bleeding edge source by clicking on th
[GitHub](https://github.com/grodansparadis/vscp).

```
git clone https://github.com/grodansparadis/vscp
git clone -j4 --recurse-submodules https://github.com/grodansparadis/vscp
```

Enter the 'vscp' folder created by the unpacking/clone process
Expand Down Expand Up @@ -183,7 +183,7 @@ to start the service

## Setting up the system on Rasperry Pi

The [Raspberry Pi](https://www.raspberrypi.org/) is a very nice single board computer and a perfect match for VSCP & Friends. __The VSCP daemon should work on all Raspberry Pi's except the RPi1 with 256 MB memory where the SSL lib fails probably due to out of memory.__
The [Raspberry Pi](https://www.raspberrypi.org/) is a very nice single board computer and a perfect match for VSCP & Friends. __The VSCP daemon should work on all Raspberry Pi's except the RPi1 with 256 MB memory where the SSL lib probably fails due to out of memory.__

If the startup script does not work or if you experience other startup problems you may need to update the firmware of your Raspberry Pi with **rpi-update**

Expand All @@ -200,6 +200,45 @@ The setup is the same as on other Unix systems so the instructions to [setup VSC
VSCP & Friends has been tested and works very well on Beaglebone Black. The setup is the same as on other Unix systems so the instructions to [setup VSCP & Friends on a Unix system](./setting_up_the_system_on_linux.md) can be used.


## Setting up the system on Windows

The VSCP daemon is not (yet) available on Windows. You can however use Windows Subsystem for Linux (WSL) to run it if you like. With the system installed follow the Linux install instructions. The main problem is that the daemon is not yet available as a service on Windows. This is something that will be added in the future. However the VSCP daemon compiles and runs just fine on windows.

### Compile and run on Windows

Firts make a folder **build** and enter it

```bash
mkdir build
cd build
```

If vcpkg is installed on the G: drive and the vcpkg triplet is x64-windows the following cmake commands can be used to compile the VSCP daemon on Windows.

```bash
cmake .. -G "Visual Studio 17 2022" -DVCPKG_TARGET_TRIPLET=x64-windows -D CMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=G:\vcpkg\scripts\buildsystems\vcpkg.cmake
```

Build with

```bash
cmake --build . --config Release
```




#### Run as sercice
* http://nssm.cc/
* https://github.com/winsw/winsw/
* https://github.com/kflu/serman
* https://stackoverflow.com/questions/3582108/create-windows-service-from-executable


## Setting up the system on MacOS

t.b.d.

### Related Links


Expand Down
Binary file modified resources/database/vscp-hashtypeevents.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion src/vscp/common/vscp-class.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
!!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!!
This file is auto-generated
see https://github.com/grodansparadis/vscp-classes
Generated: 2025-01-07 12:06:42.980280
Generated: 2025-01-09 13:58:47.024168
*/

#ifndef VSCP_CLASS_H
Expand Down
2 changes: 1 addition & 1 deletion src/vscp/common/vscp-hashclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!!
This file is auto-generated
see https://github.com/grodansparadis/vscp-classes
Generated: 2025-01-07 12:06:43.868265
Generated: 2025-01-09 13:58:47.930197
*/

m_hashClass[ 0 ] = _("CLASS1_PROTOCOL");
Expand Down
2 changes: 1 addition & 1 deletion src/vscp/common/vscp-hashtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!!
This file is auto-generated
see https://github.com/grodansparadis/vscp-classes
Generated: 2025-01-07 12:06:44.319955
Generated: 2025-01-09 13:58:48.368187
*/


Expand Down
2 changes: 1 addition & 1 deletion src/vscp/common/vscp-type.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
!!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!!
This file is auto-generated
see https://github.com/grodansparadis/vscp-classes
Generated: 2025-01-07 12:06:43.396468
Generated: 2025-01-09 13:58:47.447090
*/

#ifndef VSCP_TYPE_H
Expand Down

0 comments on commit ce2afd0

Please sign in to comment.