File tree Expand file tree Collapse file tree 6 files changed +30
-14
lines changed
Expand file tree Collapse file tree 6 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -16,21 +16,21 @@ if(EXTERNAL_LIBRARY_DIR)
1616 list (APPEND CMAKE_INCLUDE_PATH ${EXTERNAL_LIBRARY_DIR} )
1717endif ()
1818
19- # Offer option for USE_LIBCXX only if not defined by enclosing project
20- # Check for existing definition of USE_LIBCXX
21- if (NOT DEFINED USE_LIBCXX )
22- option (USE_LIBCXX "Build Autowiring using c++11" ON )
19+ # Offer option for autowiring_USE_LIBCXX only if not defined by enclosing project
20+ # Check for existing definition of autowiring_USE_LIBCXX
21+ if (NOT DEFINED autowiring_USE_LIBCXX )
22+ option (autowiring_USE_LIBCXX "Build Autowiring using c++11" ON )
2323else ()
24- if (NOT USE_LIBCXX )
25- message ("Parent project has set USE_LIBCXX = OFF -> Build Autowiring using c++98" )
24+ if (NOT autowiring_USE_LIBCXX )
25+ message ("Parent project has set autowiring_USE_LIBCXX = OFF -> Build Autowiring using c++98" )
2626 endif ()
2727endif ()
2828
2929if (NOT WIN32 )
3030 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
3131 set (CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++" )
3232endif ()
33- if (USE_LIBCXX )
33+ if (autowiring_USE_LIBCXX )
3434 # Clang needs special additional flags to build with C++11
3535 if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "AppleClang" )
3636 # Apple needs us to tell it that we're using libc++, or it will try to use libstdc++ instead
Original file line number Diff line number Diff line change @@ -7,6 +7,22 @@ if(NOT ${CMAKE_SIZEOF_VOID_P} STREQUAL @CMAKE_SIZEOF_VOID_P@)
77 return ()
88endif ()
99
10+ # Determine whether the user's request (either implied or explicit) for libstdc++ can
11+ # be met by this verison of Autowiring
12+ if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "AppleClang" )
13+ # If this value isn't defined, then we assume the user's request is "on"
14+ if (NOT DEFINED autowiring_USE_LIBCXX)
15+ SET (autowiring_USE_LIBCXX ON )
16+ endif ()
17+
18+ # Our built version must be the same as the requested version. If it's not, then we are
19+ # not a match for the user's request
20+ if ((NOT ${autowiring_USE_LIBCXX} AND @autowiring_USE_LIBCXX@) OR (${autowiring_USE_LIBCXX} AND NOT @autowiring_USE_LIBCXX@))
21+ set (PACKAGE_VERSION_COMPATIBLE FALSE )
22+ set (PACKAGE_VERSION_UNSUITABLE TRUE )
23+ endif ()
24+ endif ()
25+
1026# Check whether the requested PACKAGE_FIND_VERSION is compatible
1127if ("${PACKAGE_VERSION} " VERSION_LESS "${PACKAGE_FIND_VERSION} " )
1228 set (PACKAGE_VERSION_COMPATIBLE FALSE )
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ include_directories(
66 ${PROJECT_SOURCE_DIR} /src/autotesting
77)
88
9- # The boost C++11 shim is required when building without USE_LIBCXX
10- if (NOT USE_LIBCXX )
9+ # The boost C++11 shim is required when building without autowiring_USE_LIBCXX
10+ if (NOT autowiring_USE_LIBCXX )
1111 find_package (Boost COMPONENTS thread atomic chrono system date_time QUIET )
1212
1313 if (NOT Boost_FOUND)
14- message (FATAL_ERROR "Boost is required when building without USE_LIBCXX " )
14+ message (FATAL_ERROR "Boost is required when building without autowiring_USE_LIBCXX " )
1515 endif ()
1616
1717 include_directories (${Boost_INCLUDE_DIR} )
Original file line number Diff line number Diff line change @@ -216,8 +216,8 @@ target_include_directories(Autowiring INTERFACE
216216)
217217set_property (TARGET Autowiring PROPERTY FOLDER "Autowiring" )
218218
219- # The boost C++11 shim is required when building without USE_LIBCXX
220- if (NOT USE_LIBCXX )
219+ # The boost C++11 shim is required when building without autowiring_USE_LIBCXX
220+ if (NOT autowiring_USE_LIBCXX )
221221 find_package (Boost COMPONENTS thread atomic chrono system date_time QUIET )
222222 target_link_libraries (Autowiring ${Boost_LIBRARIES} )
223223endif ()
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ set(AutowiringTest_SRCS
5555 UuidTest.cpp
5656)
5757
58- if (USE_LIBCXX )
58+ if (autowiring_USE_LIBCXX )
5959 set (AutowiringTest_SRCS ${AutowiringTest_SRCS}
6060 AutoFilterFunctionTest.cpp
6161 AutoFilterPipeTest.cpp
Original file line number Diff line number Diff line change 1- set (autowiring_VERSION 0.2.5 )
1+ set (autowiring_VERSION 0.2.6 )
You can’t perform that action at this time.
0 commit comments