Skip to content

Commit

Permalink
CMake: Simplify vcpkg integration and re-order default build profiles
Browse files Browse the repository at this point in the history
Fixes #577
  • Loading branch information
julianxhokaxhiu committed Oct 12, 2023
1 parent 70b3d4f commit 2881c93
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .ci/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ cmd.exe /c "call $vcpkgRoot\bootstrap-vcpkg.bat"

vcpkg integrate install

cmake --preset "x86-${env:_RELEASE_CONFIGURATION}" -D_DLL_VERSION="$env:_BUILD_VERSION"
cmake --build --preset "x86-${env:_RELEASE_CONFIGURATION}"
cmake --preset "${env:_RELEASE_CONFIGURATION}" -D_DLL_VERSION="$env:_BUILD_VERSION"
cmake --build --preset "${env:_RELEASE_CONFIGURATION}"

mkdir .dist\pkg\FF7_1998 | Out-Null
mkdir .dist\pkg\FF8_2000 | Out-Null
Expand Down
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ if (NOT DEFINED _DLL_VERSION OR NOT _DLL_VERSION)
message(FATAL_ERROR "_DLL_VERSION must be set to continue building with cmake. \nExample: Add -D_DLL_VERSION=devel to your cmake command line.")
endif ()

set(VCPKG_DISABLE_COMPILER_TRACKING 1)
set(VCPKG_INSTALL_OPTIONS "--clean-after-build" "--x-use-aria2")
set(VCPKG_TARGET_TRIPLET x86-windows-static)

set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCRTD /DEBUG:FULL /FORCE:MULTIPLE /IGNORE:4006,4075,4099,4217"
Expand Down
39 changes: 20 additions & 19 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,62 +25,63 @@
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"_DLL_VERSION": "devel",
"CMAKE_C_COMPILER": "cl"
"CMAKE_C_COMPILER": "cl",
"VCPKG_TARGET_TRIPLET": "x86-windows-static"
}
},
{
"name": "x86-Debug",
"name": "Release",
"inherits": "base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "x86-RelWithDebInfo",
"name": "RelWithDebInfo",
"inherits": "base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "x86-MinSizeRel",
"name": "Debug",
"inherits": "base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "MinSizeRel"
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x86-Release",
"name": "MinSizeRel",
"inherits": "base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "MinSizeRel"
}
}
],
"buildPresets": [
{
"name": "x86-Debug",
"name": "Release",
"displayName": "Default",
"configurePreset": "x86-Debug",
"configuration": "Debug"
"configurePreset": "Release",
"configuration": "Release"
},
{
"name": "x86-RelWithDebInfo",
"name": "RelWithDebInfo",
"displayName": "Default",
"configurePreset": "x86-RelWithDebInfo",
"configurePreset": "RelWithDebInfo",
"configuration": "RelWithDebInfo"
},
{
"name": "x86-MinSizeRel",
"name": "Debug",
"displayName": "Default",
"configurePreset": "x86-MinSizeRel",
"configuration": "MinSizeRel"
"configurePreset": "Debug",
"configuration": "Debug"
},
{
"name": "x86-Release",
"name": "MinSizeRel",
"displayName": "Default",
"configurePreset": "x86-Release",
"configuration": "Release"
"configurePreset": "MinSizeRel",
"configuration": "MinSizeRel"
}
],
"vendor": {
Expand Down

0 comments on commit 2881c93

Please sign in to comment.