oglplus
oglplus copied to clipboard
cpp_feature_detection(THREADS) lack of pthread lib
Now GCC supports all the c++11 features, but when I use cmake on Ubuntu, I always get this message "Detecting support for c++ feature 'THREADS': false", and I see it try_compile the file oglplus/config/cpp/has_THREADS.cpp
when I use command gcc has_THREADS.cpp -Wall -lstdc++ -std=c++11 -pthread
, it's OK.
So I guess try_compile command is missing pthread lib, and finally it works. (What about Windows platform?)
try_compile( OGLPLUS_HAS_${FEATURE_NAME} ${PROJECT_BINARY_DIR}/cpp ${PROJECT_BINARY_DIR}/cpp/has_${FEATURE_NAME}.cpp COMPILE_DEFINITIONS ${OGLPLUS_CPP_STD_COMPILER_SWITCH} LINK_LIBRARIES pthread )
I pushed some changes on develop. Could You test if that fixes the problem for you?
NO, it fails again.
-- Detecting support for c++ feature 'SCOPED_ENUMS': TRUE -- Detecting support for c++ feature 'SCOPED_ENUM_TEMPLATE_PARAMS': TRUE -- Detecting support for c++ feature 'VARIADIC_MACROS': TRUE -- Detecting support for c++ feature 'VARIADIC_TEMPLATES': TRUE -- Detecting support for c++ feature 'UNIFIED_INITIALIZATION_SYNTAX': TRUE -- Detecting support for c++ feature 'INITIALIZER_LISTS': TRUE -- Detecting support for c++ feature 'DEFAULTED_FUNCTIONS': TRUE -- Detecting support for c++ feature 'DELETED_FUNCTIONS': TRUE -- Detecting support for c++ feature 'EXPLICIT_CONVERSION_OPERATORS': TRUE -- Detecting support for c++ feature 'FUNCTION_TEMPLATE_DEFAULT_ARGS': TRUE -- Detecting support for c++ feature 'UNICODE_LITERALS': TRUE -- Detecting support for c++ feature 'USER_DEFINED_LITERALS': TRUE -- Detecting support for c++ feature 'INHERITED_CONSTRUCTORS': TRUE -- Detecting support for c++ feature 'GENERALIZED_ATTRIBUTES': TRUE -- Detecting support for c++ feature 'TEMPLATE_ALIASES': TRUE -- Detecting support for c++ feature 'CONSTEXPR': TRUE -- Detecting support for c++ feature 'NOEXCEPT': TRUE -- Detecting support for c++ feature 'OVERRIDE': TRUE -- Detecting support for c++ feature 'LAMBDAS': TRUE -- Detecting support for c++ feature 'CHRONO': TRUE -- Detecting support for c++ feature 'THREADS': FALSE -- Could NOT find Boost -- Skipping 'glx_main' because 'THREADS' not implemented properly.