fix: built base emsdk and other tool fixes
This commit is contained in:
+6
-21
@@ -1,10 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.25)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Dependency-pinning guard (Rule: pin all dependency versions on Day 1).
|
||||
# We refuse to configure until vcpkg.json carries a 'builtin-baseline', which
|
||||
# scripts/bootstrap adds via `vcpkg x-update-baseline --add-initial-baseline`.
|
||||
# ---------------------------------------------------------------------------
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg.json" _pdfengine_vcpkg_json)
|
||||
string(JSON _pdfengine_baseline ERROR_VARIABLE _pdfengine_baseline_err
|
||||
GET "${_pdfengine_vcpkg_json}" "builtin-baseline")
|
||||
@@ -24,32 +19,30 @@ project(PdfEngine
|
||||
HOMEPAGE_URL "https://example.invalid/pdf-engine"
|
||||
LANGUAGES CXX)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Global C++ settings — C++23, no compiler extensions (engine blueprint §1.3).
|
||||
# ---------------------------------------------------------------------------
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# compile_commands.json — consumed by clang-tidy and editors.
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# Single output dirs so test binaries find imported shared libs at runtime.
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
message(STATUS "PdfEngine ${PROJECT_VERSION} — WASM hello-world configuration (Phase 0)")
|
||||
add_subdirectory(wasm)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Only the top-level project drives testing/install defaults.
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||
message(FATAL_ERROR "In-source builds are not allowed. Use a preset: "
|
||||
"cmake --preset <platform>-debug")
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Build options.
|
||||
# ---------------------------------------------------------------------------
|
||||
option(PDFENGINE_BUILD_TESTS "Build engine unit/smoke tests" ON)
|
||||
option(PDFENGINE_ENABLE_SANITIZERS "Build with AddressSanitizer/UBSan" OFF)
|
||||
option(PDFENGINE_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
|
||||
@@ -59,9 +52,6 @@ include(CompilerWarnings)
|
||||
include(Sanitizers)
|
||||
include(pdfium) # defines pdfium::pdfium when PDFENGINE_WITH_PDFIUM is ON
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Third-party dependencies (resolved by vcpkg via the manifest).
|
||||
# ---------------------------------------------------------------------------
|
||||
find_package(freetype CONFIG REQUIRED)
|
||||
find_package(harfbuzz CONFIG REQUIRED)
|
||||
find_package(spdlog CONFIG REQUIRED)
|
||||
@@ -72,13 +62,8 @@ if(PDFENGINE_BUILD_TESTS)
|
||||
include(GoogleTest)
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Subprojects.
|
||||
# ---------------------------------------------------------------------------
|
||||
add_subdirectory(engine)
|
||||
|
||||
# bindings/, gateway/, frontend/, wasm/ are placeholders in Phase 0 and are not
|
||||
# wired into the build yet.
|
||||
|
||||
message(STATUS "PdfEngine ${PROJECT_VERSION} configured")
|
||||
message(STATUS " C++ standard ......... ${CMAKE_CXX_STANDARD}")
|
||||
|
||||
Reference in New Issue
Block a user