feat(solver-bootstrap): step 1 — cmake-project-scaffold
This commit is contained in:
@@ -2,4 +2,5 @@ __pycache__/
|
|||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
.harness/build/
|
.harness/build/
|
||||||
|
out/
|
||||||
.worktrees/
|
.worktrees/
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"projectType": "cmake",
|
||||||
|
"cmake": {
|
||||||
|
"sourceDir": ".",
|
||||||
|
"binaryDir": "out/build/windows-debug",
|
||||||
|
"configurePreset": "windows-debug",
|
||||||
|
"buildPreset": "windows-debug",
|
||||||
|
"testPreset": "windows-debug"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.30)
|
||||||
|
|
||||||
|
project(FESA VERSION 0.1.0 LANGUAGES CXX)
|
||||||
|
|
||||||
|
if(NOT MSVC)
|
||||||
|
message(FATAL_ERROR "FESA requires the Microsoft Visual C++ compiler (MSVC v145).")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT CMAKE_VS_PLATFORM_TOOLSET STREQUAL "v145")
|
||||||
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"FESA requires the v145 platform toolset; configured toolset is "
|
||||||
|
"'${CMAKE_VS_PLATFORM_TOOLSET}'."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
|
||||||
|
message(FATAL_ERROR "FESA requires the x64 generator platform.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
message(FATAL_ERROR "FESA requires a 64-bit target.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(cmake/FesaDependencies.cmake)
|
||||||
|
|
||||||
|
add_library(fesa_core STATIC
|
||||||
|
src/fesa/core/version.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(fesa_core
|
||||||
|
PUBLIC
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_features(fesa_core PUBLIC cxx_std_20)
|
||||||
|
target_compile_options(fesa_core PRIVATE /W4 /permissive- /EHsc)
|
||||||
|
|
||||||
|
add_executable(fesa
|
||||||
|
src/fesa/cli/main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(fesa PRIVATE fesa_core)
|
||||||
|
target_compile_features(fesa PRIVATE cxx_std_20)
|
||||||
|
target_compile_options(fesa PRIVATE /W4 /permissive- /EHsc)
|
||||||
|
|
||||||
|
include(CTest)
|
||||||
|
|
||||||
|
if(BUILD_TESTING)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"version": 6,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "windows-debug",
|
||||||
|
"displayName": "Windows Debug",
|
||||||
|
"generator": "Visual Studio 18 2026",
|
||||||
|
"architecture": {
|
||||||
|
"value": "x64",
|
||||||
|
"strategy": "set"
|
||||||
|
},
|
||||||
|
"toolset": {
|
||||||
|
"value": "v145",
|
||||||
|
"strategy": "set"
|
||||||
|
},
|
||||||
|
"binaryDir": "${sourceDir}/out/build/windows-debug",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_CXX_EXTENSIONS": "OFF",
|
||||||
|
"CMAKE_CXX_STANDARD": "20",
|
||||||
|
"CMAKE_CXX_STANDARD_REQUIRED": "ON"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "windows-release",
|
||||||
|
"displayName": "Windows Release",
|
||||||
|
"generator": "Visual Studio 18 2026",
|
||||||
|
"architecture": {
|
||||||
|
"value": "x64",
|
||||||
|
"strategy": "set"
|
||||||
|
},
|
||||||
|
"toolset": {
|
||||||
|
"value": "v145",
|
||||||
|
"strategy": "set"
|
||||||
|
},
|
||||||
|
"binaryDir": "${sourceDir}/out/build/windows-release",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_CXX_EXTENSIONS": "OFF",
|
||||||
|
"CMAKE_CXX_STANDARD": "20",
|
||||||
|
"CMAKE_CXX_STANDARD_REQUIRED": "ON"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "windows-debug",
|
||||||
|
"configurePreset": "windows-debug",
|
||||||
|
"configuration": "Debug"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "windows-release",
|
||||||
|
"configurePreset": "windows-release",
|
||||||
|
"configuration": "Release"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testPresets": [
|
||||||
|
{
|
||||||
|
"name": "windows-debug",
|
||||||
|
"configurePreset": "windows-debug",
|
||||||
|
"configuration": "Debug",
|
||||||
|
"output": {
|
||||||
|
"outputOnFailure": true
|
||||||
|
},
|
||||||
|
"execution": {
|
||||||
|
"noTestsAction": "error"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "windows-release",
|
||||||
|
"configurePreset": "windows-release",
|
||||||
|
"configuration": "Release",
|
||||||
|
"output": {
|
||||||
|
"outputOnFailure": true
|
||||||
|
},
|
||||||
|
"execution": {
|
||||||
|
"noTestsAction": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
include_guard(GLOBAL)
|
||||||
|
|
||||||
|
# Third-party package discovery is added by the dependency smoke-test step.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
|
namespace fesa {
|
||||||
|
|
||||||
|
[[nodiscard]] std::string_view version() noexcept;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include <fesa/core/version.hpp>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
if (argc == 2 && std::string_view{argv[1]} == "--version") {
|
||||||
|
std::cout << fesa::version() << '\n';
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cerr << "Usage: fesa --version\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#include <fesa/core/version.hpp>
|
||||||
|
|
||||||
|
namespace fesa {
|
||||||
|
|
||||||
|
std::string_view version() noexcept {
|
||||||
|
return "0.1.0";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
add_test(
|
||||||
|
NAME VersionCommand
|
||||||
|
COMMAND "${CMAKE_BINARY_DIR}/$<CONFIG>/fesa.exe" --version
|
||||||
|
)
|
||||||
|
|
||||||
|
set_tests_properties(
|
||||||
|
VersionCommand
|
||||||
|
PROPERTIES
|
||||||
|
PASS_REGULAR_EXPRESSION "[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user