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
1 change: 1 addition & 0 deletions include/asio/awaitable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# include <experimental/coroutine>
#endif // defined(ASIO_HAS_STD_COROUTINE)

#include <utility> // for std::exchange (needed in C++20)
#include "asio/any_io_executor.hpp"

#include "asio/detail/push_options.hpp"
Expand Down
31 changes: 27 additions & 4 deletions proj/cmake/libcinder_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,43 @@ if( CINDER_MSW AND MSVC )
endif()
endif()

target_compile_features( cinder PUBLIC cxx_std_17 )
# Determine C++ standard for Cinder (default 17, allow user override)
if( CMAKE_CXX_STANDARD )
set( CINDER_CXX_STANDARD ${CMAKE_CXX_STANDARD} )
else()
set( CINDER_CXX_STANDARD 17 )
endif()

# Validate minimum
if( CINDER_CXX_STANDARD LESS 17 )
message( FATAL_ERROR "Cinder requires C++17 or later. CMAKE_CXX_STANDARD is set to ${CINDER_CXX_STANDARD}" )
endif()

# Set C++ standard for cinder target
target_compile_features( cinder PUBLIC cxx_std_${CINDER_CXX_STANDARD} )

# Determine CXX_EXTENSIONS: default OFF (prevents "namespace linux" issue)
# Only enable if user explicitly sets CMAKE_CXX_EXTENSIONS=ON
if( DEFINED CMAKE_CXX_EXTENSIONS )
set( CINDER_CXX_EXTENSIONS ${CMAKE_CXX_EXTENSIONS} )
else()
set( CINDER_CXX_EXTENSIONS OFF )
endif()

set_target_properties( cinder PROPERTIES
CXX_STANDARD 17
CXX_STANDARD ${CINDER_CXX_STANDARD}
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
CXX_EXTENSIONS ${CINDER_CXX_EXTENSIONS}
)

# This file will contain all dependencies, includes, definition, compiler flags and so on..
export( TARGETS cinder FILE ${PROJECT_BINARY_DIR}/${CINDER_LIB_DIRECTORY}/cinderTargets.cmake )

# And this command will generate a file on the ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
# that applications have to pull in order to link successfully with Cinder and its dependencies.
# This specific cinderConfig.cmake file will just hold a path to the above mention
# This specific cinderConfig.cmake file will just hold a path to the above mention
# cinderTargets.cmake file which holds the actual info.
# CINDER_CXX_STANDARD and CINDER_CXX_EXTENSIONS will be substituted into the template
configure_file( ${CMAKE_CURRENT_LIST_DIR}/modules/cinderConfig.buildtree.cmake.in
"${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/cinderConfig.cmake"
)
5 changes: 5 additions & 0 deletions proj/cmake/modules/cinderConfig.buildtree.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
if( NOT TARGET cinder${CINDER_LIB_SUFFIX} )
include( "${PROJECT_BINARY_DIR}/${CINDER_LIB_DIRECTORY}/cinderTargets.cmake" )

# Record the C++ standard and extensions setting Cinder was built with
# These will be inherited by apps unless they explicitly override
set( CINDER_CXX_STANDARD @CINDER_CXX_STANDARD@ )
set( CINDER_CXX_EXTENSIONS @CINDER_CXX_EXTENSIONS@ )
endif()


30 changes: 30 additions & 0 deletions proj/cmake/modules/cinderMakeApp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,36 @@ function( ci_make_app )
target_include_directories( ${ARG_APP_NAME} PUBLIC ${ARG_INCLUDES} )
target_link_libraries( ${ARG_APP_NAME} PUBLIC cinder ${ARG_LIBRARIES} )

# Determine C++ standard: user override > Cinder's standard > 17
if( CMAKE_CXX_STANDARD )
set( APP_CXX_STANDARD ${CMAKE_CXX_STANDARD} )
elseif( DEFINED CINDER_CXX_STANDARD )
set( APP_CXX_STANDARD ${CINDER_CXX_STANDARD} )
else()
set( APP_CXX_STANDARD 17 )
endif()

if( APP_CXX_STANDARD LESS 17 )
message( FATAL_ERROR "Cinder requires C++17 or later. App is configured to use C++${APP_CXX_STANDARD}" )
endif()

target_compile_features( ${ARG_APP_NAME} PUBLIC cxx_std_${APP_CXX_STANDARD} )

# Determine CXX_EXTENSIONS: inherit from Cinder, or default OFF (prevents "namespace linux" issue)
if( DEFINED CMAKE_CXX_EXTENSIONS )
set( APP_CXX_EXTENSIONS ${CMAKE_CXX_EXTENSIONS} )
elseif( DEFINED CINDER_CXX_EXTENSIONS )
set( APP_CXX_EXTENSIONS ${CINDER_CXX_EXTENSIONS} )
else()
set( APP_CXX_EXTENSIONS OFF )
endif()

set_target_properties( ${ARG_APP_NAME} PROPERTIES
CXX_STANDARD ${APP_CXX_STANDARD}
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ${APP_CXX_EXTENSIONS}
)

if( MSVC )
# Ignore Specific Default Libraries for Debug build
set_target_properties( ${ARG_APP_NAME} PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCPMT" )
Expand Down