Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ jobs:

steps:
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Initialize Ubuntu
if: matrix.os.name == 'ubuntu'
Expand Down Expand Up @@ -249,7 +251,7 @@ jobs:
path: ${{ steps.env-info.outputs.BOOST_ROOT }}/libs/iris_x4/build/_deps

# Adapt CMP0168; enable caching in CI
# https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_UPDATES_DISCONNECTED
# https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_FULLY_DISCONNECTED
- name: Setup Cached CMake Dependencies
id: deps-info
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "modules/iris"]
path = modules/iris
url = https://github.com/iris-cpp/iris.git
109 changes: 12 additions & 97 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
# Copyright 2020 Peter Dimov
# Copyright 2025 Nana Sakisaka
# Copyright 2025-2026 Nana Sakisaka
#
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

cmake_minimum_required(VERSION 3.30)

if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE
"$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING ""
)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()

project(iris_x4 VERSION 1.0.0 LANGUAGES CXX)


# -----------------------------------------------------------------
# Global settings
# Handle with care, keep these to the ones that can't be
# accomplished by target-specific settings.

set(CMAKE_COLOR_DIAGNOSTICS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

option(IRIS_X4_REMOVE_MINSIZEREL_CONFIG "Remove rarely used MinSizeRel config" ON)
# Load Iris
# This sets many basic settings and common targets automatically.

if(MSVC)
if(IRIS_X4_REMOVE_MINSIZEREL_CONFIG OR PROJECT_IS_TOP_LEVEL)
list(REMOVE_ITEM CMAKE_CONFIGURATION_TYPES MinSizeRel)
endif()
if(PROJECT_IS_TOP_LEVEL)
include(CTest) # sets BUILD_TESTING
endif()

add_subdirectory(modules/iris)

# -----------------------------------------------------------------
# Create common base targets

# Private component; do not depend on this.
add_library(_iris_x4_cxx_common INTERFACE)
set_target_properties(_iris_x4_cxx_common PROPERTIES CXX_EXTENSIONS OFF)

# -----------------------------------------------------------------
# Create the main X4 target
Expand All @@ -55,71 +39,15 @@ if(MSVC)
# "${PROJECT_SOURCE_DIR}/iris_x4.natvis" # TODO
)

target_link_libraries(iris_x4 PUBLIC Iris::Iris)

else()
add_library(iris_x4 INTERFACE)
target_link_libraries(iris_x4 INTERFACE Iris::Iris)
endif()

add_library(Iris::X4 ALIAS iris_x4)
set_target_properties(iris_x4 PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(iris_x4 INTERFACE _iris_x4_cxx_common)


# -----------------------------------------------------------------
# Configure C++ version

# Set minimal C++ version explicitly; avoid "/std:c++latest"
set(IRIS_X4_CXX_FEATURE cxx_std_23)
if(MSVC)
if(CMAKE_CXX_STANDARD EQUAL 23)
set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "/std:c++23preview")
set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "/std:c++23preview")
target_compile_options(_iris_x4_cxx_common INTERFACE /std:c++23preview)
target_compile_options(iris_x4 PRIVATE /std:c++23preview) # Set strict version for dummy.cpp
else()
# may become /std:c++latest only on this case
target_compile_features(_iris_x4_cxx_common INTERFACE ${IRIS_X4_CXX_FEATURE})
target_link_libraries(iris_x4 PRIVATE _iris_x4_cxx_common) # Virtually sets `/std:c++latest` for dummy.cpp
endif()
else() # Non-MSVC
target_compile_features(_iris_x4_cxx_common INTERFACE ${IRIS_X4_CXX_FEATURE}) # Sets appropriate `-std=c++XX`
endif()
unset(IRIS_X4_CXX_FEATURE)


# -----------------------------------------------------------------
# Advanced compile/link settings

if(MSVC)
# Don't set too strict flags for this! They must go to `iris_x4_cxx_test`.
# ABI-dependent configurations MUST be set here.
target_compile_definitions(
_iris_x4_cxx_common
INTERFACE UNICODE _UNICODE
)
target_compile_options(
_iris_x4_cxx_common
INTERFACE
/EHsc /MP /utf-8 /Zc:preprocessor /permissive-
# $<$<CONFIG:Debug,RelWithDebInfo>:/fsanitize=address> # TODO
)
target_link_options(
_iris_x4_cxx_common
INTERFACE
# $<$<CONFIG:Debug,RelWithDebInfo>:/INCREMENTAL:NO> # TODO
)

else()
target_compile_options(
_iris_x4_cxx_common
INTERFACE
# $<$<CONFIG:Debug>:-fsanitize=undefined,address> # TODO
)
target_link_options(
_iris_x4_cxx_common
INTERFACE
# $<$<CONFIG:Debug>:-fsanitize=undefined,address> # TODO
)
endif()


# -----------------------------------------------------------------
Expand Down Expand Up @@ -188,17 +116,8 @@ foreach(dep IN LISTS iris_x4_boost_deps)
add_subdirectory(../${dep} build_deps/${dep})
endforeach()

# find_package(...)
# target_link_libraries(iris_x4 INTERFACE ...)

# TODO: link Iris::iris

foreach(dep IN LISTS iris_x4_boost_deps)
target_link_libraries(
iris_x4
INTERFACE
Boost::${dep}
)
target_link_libraries(iris_x4 INTERFACE Boost::${dep})
endforeach()


Expand Down Expand Up @@ -227,14 +146,10 @@ target_include_directories(
# -----------------------------------------------------------------
# Test

if(PROJECT_IS_TOP_LEVEL)
include(CTest)
endif()

if(BUILD_TESTING)
add_subdirectory(test)

if(MSVC)
if(MSVC AND PROJECT_IS_TOP_LEVEL)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Iris::X4)
endif()
endif()
51 changes: 0 additions & 51 deletions include/iris/config.hpp

This file was deleted.

38 changes: 0 additions & 38 deletions include/iris/core/type_traits.hpp

This file was deleted.

1 change: 1 addition & 0 deletions include/iris/x4/core/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
=============================================================================*/

#include <iris/config.hpp>

#include <iris/x4/core/context.hpp>
#include <iris/x4/core/action_context.hpp>

Expand Down
1 change: 1 addition & 0 deletions include/iris/x4/core/action_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
=============================================================================*/

#include <iris/config.hpp>

#include <iris/x4/core/context.hpp>

namespace iris::x4 {
Expand Down
4 changes: 3 additions & 1 deletion include/iris/x4/core/container_appender.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef IRIS_X4_CORE_CONTAINER_APPENDER_HPP
#define IRIS_X4_CORE_CONTAINER_APPENDER_HPP

#include <iris/core/type_traits.hpp>
#include <iris/config.hpp>
#include <iris/type_traits.hpp>

#include <iris/x4/traits/container_traits.hpp>
#include <iris/x4/traits/transform_attribute.hpp>

Expand Down
2 changes: 1 addition & 1 deletion include/iris/x4/core/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
=============================================================================*/

#include <iris/config.hpp>
#include <iris/core/type_traits.hpp>
#include <iris/type_traits.hpp>

#include <iris/x4/core/unused.hpp>

Expand Down
1 change: 1 addition & 0 deletions include/iris/x4/core/detail/parse_alternative.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
=============================================================================*/

#include <iris/config.hpp>

#include <iris/x4/core/move_to.hpp>
#include <iris/x4/core/parser_traits.hpp>

Expand Down
1 change: 1 addition & 0 deletions include/iris/x4/core/detail/parse_into_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
=============================================================================*/

#include <iris/config.hpp>

#include <iris/x4/core/parser.hpp>
#include <iris/x4/core/container_appender.hpp>

Expand Down
1 change: 1 addition & 0 deletions include/iris/x4/core/detail/parse_sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
=============================================================================*/

#include <iris/config.hpp>

#include <iris/x4/core/parser_traits.hpp>
#include <iris/x4/core/detail/parse_into_container.hpp>

Expand Down
1 change: 1 addition & 0 deletions include/iris/x4/core/expectation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
=============================================================================*/

#include <iris/config.hpp>

#include <iris/x4/core/parser.hpp> // for `x4::what`
#include <iris/x4/core/context.hpp>

Expand Down
2 changes: 1 addition & 1 deletion include/iris/x4/core/move_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
=============================================================================*/

#include <iris/config.hpp>
#include <iris/core/type_traits.hpp>
#include <iris/type_traits.hpp>

#include <iris/x4/traits/attribute_category.hpp>
#include <iris/x4/traits/tuple_traits.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/iris/x4/core/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
==============================================================================*/

#include <iris/config.hpp>

#include <iris/x4/core/attribute.hpp>
#include <iris/x4/core/unused.hpp>
#include <iris/x4/core/parser_traits.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/iris/x4/core/skip_over.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
==============================================================================*/

#include <iris/config.hpp>

#include <iris/x4/core/expectation.hpp>
#include <iris/x4/core/unused.hpp>
#include <iris/x4/core/context.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/iris/x4/rule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
==============================================================================*/

#include <iris/config.hpp>
#include <iris/core/type_traits.hpp>
#include <iris/type_traits.hpp>

#include <iris/x4/core/parser.hpp>
#include <iris/x4/core/skip_over.hpp>
Expand Down
1 change: 1 addition & 0 deletions modules/iris
Submodule iris added at 0a7c23
Loading