Revision: 70829 http://sourceforge.net/p/brlcad/code/70829 Author: starseeker Date: 2018-03-21 01:01:43 +0000 (Wed, 21 Mar 2018) Log Message: ----------- get as far as the undefined reference to _tthread_timespec_get error reported earlier
Modified Paths: -------------- brlcad/trunk/src/other/tinycthread/CMakeLists.txt brlcad/trunk/src/other/tinycthread/tinycthread.h Modified: brlcad/trunk/src/other/tinycthread/CMakeLists.txt =================================================================== --- brlcad/trunk/src/other/tinycthread/CMakeLists.txt 2018-03-19 15:30:29 UTC (rev 70828) +++ brlcad/trunk/src/other/tinycthread/CMakeLists.txt 2018-03-21 01:01:43 UTC (rev 70829) @@ -4,6 +4,41 @@ # Set CMake project name project(TINYCTHREAD) +# Match BRL-CAD +unset(C_STANDARD_FLAGS) +set(CMAKE_C_EXTENSIONS OFF) +if("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT MSVC) + set(CMAKE_C_STANDARD 99) + set(CMAKE_C_STANDARD_REQUIRED ON) + set(API_FLAGS "-D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500") + if(CMAKE_C_EXTENSIONS) + set(C_STANDARD_FLAGS "${CMAKE_C${CMAKE_C_STANDARD}_EXTENSION_COMPILE_OPTION}") + else() + set(C_STANDARD_FLAGS "${CMAKE_C${CMAKE_C_STANDARD}_STANDARD_COMPILE_OPTION} ${API_FLAGS}") + endif(CMAKE_C_EXTENSIONS) + if("${C_STANDARD_FLAGS}" STREQUAL "") + message(FATAL_ERROR "C standard specification failure: compiler does not support the C${CMAKE_C_STANDARD} standard:\n${CMAKE_C_COMPILE_FEATURES}") + endif("${C_STANDARD_FLAGS}" STREQUAL "") +else() + set(CMAKE_C_STANDARD 90) + set(CMAKE_C_STANDARD_REQUIRED ON) + set(API_FLAGS "-D_POSIX_C_SOURCE=199009L -D_XOPEN_SOURCE=3") + if(CMAKE_C_EXTENSIONS) + set(C_STANDARD_FLAGS "${CMAKE_C${CMAKE_C_STANDARD}_EXTENSION_COMPILE_OPTION}") + else() + set(C_STANDARD_FLAGS "${CMAKE_C${CMAKE_C_STANDARD}_STANDARD_COMPILE_OPTION} ${API_FLAGS}") + endif(CMAKE_C_EXTENSIONS) +endif("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT MSVC) + +include(CheckStructHasMember) +cmake_push_check_state() +set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${CMAKE_C_STD_FLAG}") +check_struct_has_member("struct timespec" tv_sec "time.h;sys/select.h" HAVE_STRUCT_TIMESPEC) +cmake_pop_check_state() +if(HAVE_STRUCT_TIMESPEC) + add_definitions(-DHAVE_STRUCT_TIMESPEC=1) +endif(HAVE_STRUCT_TIMESPEC) + include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) Modified: brlcad/trunk/src/other/tinycthread/tinycthread.h =================================================================== --- brlcad/trunk/src/other/tinycthread/tinycthread.h 2018-03-19 15:30:29 UTC (rev 70828) +++ brlcad/trunk/src/other/tinycthread/tinycthread.h 2018-03-21 01:01:43 UTC (rev 70829) @@ -130,7 +130,15 @@ long tv_nsec; }; #define timespec _tthread_timespec +#else +#if !defined(HAVE_STRUCT_TIMESPEC) +struct timespec { + time_t tv_sec; + long tv_nsec; +}; #endif +#define HAVE_STRUCT_TIMESPEC 1 +#endif TINYCTHREAD_EXPORT extern int _tthread_timespec_get(struct timespec *ts, int base); #define timespec_get _tthread_timespec_get This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits