Skip to content
Open
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
46 changes: 26 additions & 20 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
"generator": "Ninja",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/vcpkg_toolchain_wrapper.cmake",
"VCPKG_FEATURE_FLAGS": "manifests",
"QUARK_ENABLE_ASAN": "OFF",
"QUARK_ENABLE_UBSAN": "OFF",
"QUARK_ENABLE_TSAN": "OFF",
"QUARK_ENABLE_LTO": "OFF"
}
},

{
"name": "macos-arm64",
"hidden": true,
Expand Down Expand Up @@ -67,12 +66,13 @@
"VCPKG_HOST_TRIPLET": "x64-windows"
}
},

{
"name": "macos-arm64-debug",
"inherits": "macos-arm64",
"binaryDir": "${sourceDir}/build/macos-arm64-debug",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "macos-x64-debug",
Expand All @@ -96,7 +96,9 @@
"name": "macos-arm64-release",
"inherits": "macos-arm64",
"binaryDir": "${sourceDir}/build/macos-arm64-release",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "macos-arm64-release-lto",
Expand All @@ -107,12 +109,13 @@
"QUARK_ENABLE_LTO": "ON"
}
},

{
"name": "linux-x64-gcc-debug",
"inherits": "linux-x64-gcc",
"binaryDir": "${sourceDir}/build/linux-x64-gcc-debug",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "linux-x64-gcc-asan-ubsan",
Expand All @@ -137,7 +140,9 @@
"name": "linux-x64-gcc-release",
"inherits": "linux-x64-gcc",
"binaryDir": "${sourceDir}/build/linux-x64-gcc-release",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "linux-x64-gcc-release-lto",
Expand All @@ -148,12 +153,13 @@
"QUARK_ENABLE_LTO": "ON"
}
},

{
"name": "linux-x64-clang-debug",
"inherits": "linux-x64-clang",
"binaryDir": "${sourceDir}/build/linux-x64-clang-debug",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "linux-x64-clang-asan-ubsan",
Expand All @@ -178,7 +184,9 @@
"name": "linux-x64-clang-release",
"inherits": "linux-x64-clang",
"binaryDir": "${sourceDir}/build/linux-x64-clang-release",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "linux-x64-clang-release-lto",
Expand All @@ -189,18 +197,21 @@
"QUARK_ENABLE_LTO": "ON"
}
},

{
"name": "windows-x64-msvc-debug",
"inherits": "windows-x64-msvc",
"binaryDir": "${sourceDir}/build/windows-x64-msvc-debug",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "windows-x64-msvc-release",
"inherits": "windows-x64-msvc",
"binaryDir": "${sourceDir}/build/windows-x64-msvc-release",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "windows-x64-msvc-release-lto",
Expand All @@ -212,7 +223,6 @@
}
}
],

"buildPresets": [
{
"name": "macos-arm64-debug",
Expand All @@ -230,12 +240,10 @@
"name": "macos-arm64-release-lto",
"configurePreset": "macos-arm64-release-lto"
},

{
"name": "macos-x64-debug",
"configurePreset": "macos-x64-debug"
},

{
"name": "linux-x64-gcc-debug",
"configurePreset": "linux-x64-gcc-debug"
Expand All @@ -256,7 +264,6 @@
"name": "linux-x64-gcc-release-lto",
"configurePreset": "linux-x64-gcc-release-lto"
},

{
"name": "linux-x64-clang-debug",
"configurePreset": "linux-x64-clang-debug"
Expand All @@ -277,7 +284,6 @@
"name": "linux-x64-clang-release-lto",
"configurePreset": "linux-x64-clang-release-lto"
},

{
"name": "windows-x64-msvc-debug",
"configurePreset": "windows-x64-msvc-debug"
Expand All @@ -291,4 +297,4 @@
"configurePreset": "windows-x64-msvc-release-lto"
}
]
}
}
1 change: 1 addition & 0 deletions cmake/preflight_submodules.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message(STATUS "[quark] preflight include active")
50 changes: 50 additions & 0 deletions cmake/vcpkg_toolchain_wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
get_filename_component(QUARK_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
set(QUARK_VCPKG_ROOT "${QUARK_SOURCE_DIR}/vcpkg")

if(EXISTS "${QUARK_SOURCE_DIR}/.gitmodules")
find_program(QUARK_GIT_EXECUTABLE git)
if(QUARK_GIT_EXECUTABLE)
execute_process(
COMMAND "${QUARK_GIT_EXECUTABLE}" submodule update --init --recursive --force
WORKING_DIRECTORY "${QUARK_SOURCE_DIR}"
RESULT_VARIABLE quark_submodule_result
OUTPUT_QUIET
ERROR_QUIET
)

if(NOT quark_submodule_result EQUAL 0)
message(WARNING "Unable to auto-update git submodules. Run 'git submodule update --init --recursive'.")
endif()

if(EXISTS "${QUARK_VCPKG_ROOT}/.git")
foreach(quark_bootstrap_file bootstrap-vcpkg.sh bootstrap-vcpkg.bat)
if(NOT EXISTS "${QUARK_VCPKG_ROOT}/${quark_bootstrap_file}")
execute_process(
COMMAND "${QUARK_GIT_EXECUTABLE}" -C "${QUARK_VCPKG_ROOT}" restore -- "${quark_bootstrap_file}"
RESULT_VARIABLE quark_restore_result
OUTPUT_QUIET
ERROR_QUIET
)

if(NOT quark_restore_result EQUAL 0)
message(WARNING "Unable to restore ${quark_bootstrap_file} in vcpkg submodule.")
endif()
endif()
endforeach()
endif()
endif()
endif()

if(UNIX AND EXISTS "${QUARK_VCPKG_ROOT}/bootstrap-vcpkg.sh")
execute_process(
COMMAND chmod +x "${QUARK_VCPKG_ROOT}/bootstrap-vcpkg.sh"
OUTPUT_QUIET
ERROR_QUIET
)
endif()

if(NOT EXISTS "${QUARK_VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
message(FATAL_ERROR "Missing vcpkg toolchain file at ${QUARK_VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
endif()

include("${QUARK_VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
Loading