Skip to content

Commit

Permalink
Add vcpkg toolchain file
Browse files Browse the repository at this point in the history
  • Loading branch information
cfnptr committed Aug 27, 2024
1 parent 5542bbb commit 47d7bd4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.22)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Prevented in-tree build")
Expand All @@ -22,6 +22,13 @@ if(TARGET nets-static)
return()
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CMAKE_TOOLCHAIN_FILE $ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
if (NOT EXISTS ${CMAKE_TOOLCHAIN_FILE})
message(FATAL_ERROR "vcpkg is not installed or added to the System Environment Variables.")
endif()
endif()

project(nets VERSION 2.0.3 LANGUAGES C
DESCRIPTION "Secure multi-platform networking library \
with implemented TCP / UDP / HTTP server and client"
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ A library providing generic interface for transferring data over a **network** a

* C99 compiler
* [Git 2.30+](https://git-scm.com/)
* [CMake 3.10+](https://cmake.org/)
* [OpenSSL 3.3+](https://openssl.org/) (Optional)
* [CMake 3.22+](https://cmake.org/)
* [vcpkg](https://learn.microsoft.com/en-us/vcpkg/) (Windows only)
* [brew](https://brew.sh/) (macOS only)

### OpenSSL installation

* Ubuntu: sudo apt-get install libssl-dev
* MacOS: [brew](https://brew.sh/) install openssl
* Windows: [vcpkg](https://learn.microsoft.com/en-us/vcpkg/) install openssl
* macOS: brew install openssl
* Windows: vcpkg install openssl

### CMake options

Expand Down

0 comments on commit 47d7bd4

Please sign in to comment.