-
Notifications
You must be signed in to change notification settings - Fork 32
feat: move to vcpkg #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: move to vcpkg #161
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| cmake_minimum_required(VERSION 3.16) | ||
|
|
||
| project(mob) | ||
| project(mob LANGUAGES CXX) | ||
|
|
||
| find_package(clipp CONFIG REQUIRED) | ||
| find_package(nlohmann_json CONFIG REQUIRED) | ||
| find_package(CURL REQUIRED) | ||
|
|
||
| add_subdirectory(src) | ||
|
|
||
| set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT mob) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| { | ||
| "version": 6, | ||
| "configurePresets": [ | ||
| { | ||
| "name": "vcpkg", | ||
| "generator": "Visual Studio 17 2022", | ||
| "architecture": "x64", | ||
| "binaryDir": "${sourceDir}/build/", | ||
| "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", | ||
| "cacheVariables": { | ||
| "VCPKG_TARGET_TRIPLET": "x64-windows-static-md", | ||
| "CMAKE_CONFIGURATION_TYPES": "Debug;Release;RelWithDebInfo" | ||
| } | ||
| } | ||
| ], | ||
| "buildPresets": [ | ||
| { | ||
| "name": "Base", | ||
| "hidden": true, | ||
| "nativeToolOptions": [ | ||
| "-m", | ||
| "-noLogo", | ||
| "-p:UseMultiToolTask=true", | ||
| "-p:EnforceProcessCountAcrossBuilds=true" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "Debug", | ||
| "configurePreset": "vcpkg", | ||
| "inherits": "Base", | ||
| "configuration": "Debug" | ||
| }, | ||
| { | ||
| "name": "Release", | ||
| "configurePreset": "vcpkg", | ||
| "inherits": "Base", | ||
| "configuration": "Release" | ||
| }, | ||
| { | ||
| "name": "RelWithDebInfo", | ||
| "configurePreset": "vcpkg", | ||
| "inherits": "Base", | ||
| "configuration": "RelWithDebInfo" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | ||
| "name": "zlib", | ||
| "version-string": "zlib-ng overlay", | ||
| "dependencies": [ | ||
| "zlib-ng" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| set(VCPKG_TARGET_ARCHITECTURE x64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
|
|
||
| set(ZLIB_COMPAT ON) | ||
| set(nlohmann-json_IMPLICIT_CONVERSIONS OFF) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,18 @@ | ||
| cmake_minimum_required(VERSION 3.16) | ||
|
|
||
| file(GLOB_RECURSE source_files *.cpp) | ||
| file(GLOB_RECURSE header_files *.h) | ||
| file(GLOB_RECURSE source_files CONFIGURE_DEPENDS "*.cpp") | ||
| file(GLOB_RECURSE header_files CONFIGURE_DEPENDS "*.h") | ||
|
|
||
| add_executable(mob ${source_files} ${header_files}) | ||
| set_target_properties(mob PROPERTIES CXX_STANDARD 20) | ||
|
|
||
| target_compile_definitions(mob PUBLIC NOMINMAX) | ||
| target_compile_options(mob PUBLIC "/MT") | ||
| target_include_directories(mob PUBLIC ${CMAKE_SOURCE_DIR}/third-party/include) | ||
| target_link_libraries(mob PUBLIC | ||
| wsock32 ws2_32 crypt32 wldap32 dbghelp shlwapi version | ||
| optimized ${CMAKE_SOURCE_DIR}/third-party/lib/libcurl.lib | ||
| debug ${CMAKE_SOURCE_DIR}/third-party/lib/libcurl-d.lib | ||
| optimized ${CMAKE_SOURCE_DIR}/third-party/lib/zlib.lib | ||
| debug ${CMAKE_SOURCE_DIR}/third-party/lib/zlibd.lib) | ||
| target_compile_features(mob PRIVATE cxx_std_20) | ||
|
|
||
| target_compile_definitions( | ||
| mob PRIVATE _WIN32_WINNT=0x0A00 NTDDI_VERSION=0x0A000007 WIN32_LEAN_AND_MEAN | ||
| NOMINMAX NOCOMM) | ||
|
|
||
| target_link_libraries(mob PRIVATE clipp::clipp nlohmann_json::nlohmann_json | ||
| CURL::libcurl dbghelp shlwapi version) | ||
|
|
||
| source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} | ||
| PREFIX src | ||
| FILES ${source_files} ${header_files}) | ||
| set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT mob) | ||
| source_group( | ||
| TREE ${CMAKE_CURRENT_SOURCE_DIR} | ||
| PREFIX src | ||
| FILES ${source_files} ${header_files}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why this was removed?