diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-18 08:12:10 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-18 08:12:10 +0000 |
| commit | 0b1c500e9cbc7837dbef5fb24be21dc4f6078714 (patch) | |
| tree | f14ad0ec10226e3db90e9a1d26a91cb7da0a5623 | |
| parent | cd3c09a5c2566d674680193042baf6474b6d0976 (diff) | |
build(lib): compile pseudocode-lib objects
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fd86892..86fef58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,6 +116,32 @@ target_link_libraries(cpsc PRIVATE include(cmake/NativeCompiler.cmake) +# Build the experimental pseudocode library with the same host C++ ABI. +file(GLOB cpsc_library_cc CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/pseudocode-lib/*.cc") +file(GLOB cpsc_library_sources CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/pseudocode-lib/*.cps") +set(cpsc_library_outputs) +foreach(source IN LISTS cpsc_library_cc) + get_filename_component(name "${source}" NAME_WE) + set(output "${CMAKE_BINARY_DIR}/pseudocode-lib/${name}.o") + add_custom_command(OUTPUT "${output}" + COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_BINARY_DIR}/pseudocode-lib" + COMMAND "${CMAKE_CXX_COMPILER}" -c -O2 -fPIC -std=c++17 "${source}" -o "${output}" + DEPENDS "${source}" + VERBATIM) + list(APPEND cpsc_library_outputs "${output}") +endforeach() +foreach(source IN LISTS cpsc_library_sources) + get_filename_component(name "${source}" NAME) + set(output "${CMAKE_BINARY_DIR}/pseudocode-lib/${name}") + add_custom_command(OUTPUT "${output}" + COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_BINARY_DIR}/pseudocode-lib" + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${source}" "${output}" + DEPENDS "${source}" + VERBATIM) + list(APPEND cpsc_library_outputs "${output}") +endforeach() +add_custom_target(pseudocode-lib ALL DEPENDS ${cpsc_library_outputs}) + option(BUILD_TESTING "Enable compiler conformance tests" OFF) if(BUILD_TESTING) enable_testing() |
