From 8d1183cb3dd915a487ba9a2a3f60e58a111d4748 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 8 Oct 2018 16:10:34 -0700 Subject: [PATCH 01/95] test case fixes --- tests/openmp1.c | 6 +++--- tests/tryentercs.c | 2 +- tests/tryentercs2.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/openmp1.c b/tests/openmp1.c index b5791e2..30adb33 100755 --- a/tests/openmp1.c +++ b/tests/openmp1.c @@ -88,9 +88,6 @@ int main(int argc, char *argv[]) { pthread_t b_thr; int status; - printf("%s:%d - %s - a_thr:%p - b_thr:%p\n", - __FILE__,__LINE__,__FUNCTION__,a_thr.p,b_thr.p); - status = pthread_create(&a_thr, NULL, _thread, (void*) 1 ); if ( status != 0 ) { printf("Failed to create thread 1\n"); @@ -103,6 +100,9 @@ int main(int argc, char *argv[]) { return (-1); } + printf("%s:%d - %s - a_thr:%p - b_thr:%p\n", + __FILE__,__LINE__,__FUNCTION__,a_thr.p,b_thr.p); + status = pthread_join(a_thr, NULL); if ( status != 0 ) { printf("Failed to join thread 1\n"); diff --git a/tests/tryentercs.c b/tests/tryentercs.c index 51154e6..15d1420 100644 --- a/tests/tryentercs.c +++ b/tests/tryentercs.c @@ -66,7 +66,7 @@ main() */ _h_kernel32 = LoadLibrary(TEXT("KERNEL32.DLL")); _try_enter_critical_section = - (BOOL (PT_STDCALL *)(LPCRITICAL_SECTION)) + (BOOL (WINAPI *)(LPCRITICAL_SECTION)) GetProcAddress(_h_kernel32, (LPCSTR) "TryEnterCriticalSection"); diff --git a/tests/tryentercs2.c b/tests/tryentercs2.c index a747b0f..50c540a 100644 --- a/tests/tryentercs2.c +++ b/tests/tryentercs2.c @@ -65,7 +65,7 @@ main() */ _h_kernel32 = LoadLibrary(TEXT("KERNEL32.DLL")); _try_enter_critical_section = - (BOOL (PT_STDCALL *)(LPCRITICAL_SECTION)) + (BOOL (WINAPI *)(LPCRITICAL_SECTION)) GetProcAddress(_h_kernel32, (LPCSTR) "TryEnterCriticalSection"); From ab514e7f019680f21498c03d4cf9843509fbd967 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 8 Oct 2018 16:12:35 -0700 Subject: [PATCH 02/95] cmake first pass --- .gitignore | 3 + CMakeLists.txt | 149 ++++++++++++++ appveyor.yml | 93 +++++++++ cmake/common.cmake | 150 ++++++++++++++ cmake/get_version.cmake | 21 ++ cmake/target_arch.cmake | 36 ++++ cmake/version.rc.in | 418 ++++++++++++++++++++++++++++++++++++++++ tests/CMakeLists.txt | 77 ++++++++ 8 files changed, 947 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 appveyor.yml create mode 100644 cmake/common.cmake create mode 100644 cmake/get_version.cmake create mode 100644 cmake/target_arch.cmake create mode 100644 cmake/version.rc.in create mode 100644 tests/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 0fa70b6..7d7555e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ tests/benchlib.o tests/SIZES.* tests/*.log /.project +build +PTHREADS-BUILT +.vscode \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..73af7de --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,149 @@ +cmake_minimum_required(VERSION 3.11) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "MinSizeRel" CACHE STRING "Choose the type of build, options are: Debug, Release, or MinSizeRel." FORCE) + message(STATUS "No build type specified, defaulting to MinSizeRel.") +endif() + +set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake") + +include (get_version) + +message(STATUS "Generator ......... ${CMAKE_GENERATOR}") +message(STATUS "Build Type ........ ${CMAKE_BUILD_TYPE}") +message(STATUS "Version ........... ${PTHREADS4W_VERSION}") + +project(pthreads4w VERSION ${PTHREADS4W_VERSION} LANGUAGES C) + +set(PTW32_VER ${PROJECT_VERSION_MAJOR}${EXTRAVERSION}) +set(CMAKE_DEBUG_POSTFIX d) + +# Uncomment this if config.h defines RETAIN_WSALASTERROR +#set(XLIBS wsock32.lib) + +include (common) + +include_directories(.) + +################################# +# Target Arch # +################################# +include (target_arch) + +get_target_arch(TARGET_ARCH) + +if(${TARGET_ARCH} STREQUAL "ARM") + add_definitions(-D__PTW32_ARCHARM) +elseif(${TARGET_ARCH} STREQUAL "x86_64") + add_definitions(-D__PTW32_ARCHAMD64) +elseif(${TARGET_ARCH} STREQUAL "x86") + add_definitions(-D__PTW32_ARCHX86) +elseif(${TARGET_ARCH} STREQUAL "x64") + add_definitions(-D__PTW32_ARCHX64) +else() + MESSAGE(ERROR "\"${TARGET_ARCH}\" not supported in version.rc") +endif() + +################################# +# Install Path # +################################# +if(DIST_ROOT) + set(CMAKE_INSTALL_PREFIX "${DIST_ROOT}") +else() + set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/PTHREADS-BUILT") +endif() +message(STATUS "Install Path ${CMAKE_INSTALL_PREFIX}") + + +set(DLLDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/bin) +set(LIBDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/lib) +set(HDRDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/include) +set(TESTDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/test) + +################################# +# Defs # +################################# +add_definitions(-D__PTW32_BUILD_INLINED) + +if(MSVC) + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /errorReport:none /nologo ") + + # C++ Exceptions + # (Note: If you are using Microsoft VC++6.0, the library needs to be built + # with /EHa instead of /EHs or else cancellation won't work properly.) + if(MSVC_VERSION EQUAL 1200) + set(VCEFLAGS "/EHa /TP ") + else() + set(VCEFLAGS "/EHs /TP ") + endif() + + add_definitions(-DHAVE_CONFIG_H -D__PTW32_RC_MSC) + +endif() + +# Update filename with proper version info +configure_file(${CMAKE_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_BINARY_DIR}/version.rc @ONLY) + +################################# +# Libraries # +################################# +set(targ_suffix "") +if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(targ_suffix ${CMAKE_DEBUG_POSTFIX}) +endif() + +macro(shared_lib type def) + set(targ pthread${type}${PTW32_VER}) + add_library(${targ} SHARED pthread.c ${CMAKE_BINARY_DIR}/version.rc) + message(STATUS ${targ}) + target_compile_definitions(${targ} PUBLIC "-D${def}") + if(${type} STREQUAL "VCE") + set_target_properties(${targ} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + endif() + if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.dll DESTINATION ${DLLDEST}) + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) + else() + install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.dll DESTINATION ${DLLDEST}) + install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) + endif() +endmacro() + +macro(static_lib type def) + set(targ libpthread${type}${PTW32_VER}) + add_library(${targ} STATIC pthread.c) + message(STATUS ${targ}) + target_compile_definitions(${targ} PUBLIC "-D${def}" -D__PTW32_STATIC_LIB) + if(${type} STREQUAL "VCE") + set_target_properties(${targ} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + endif() + if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) + else() + install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) + endif() +endmacro() + +shared_lib ( VCE __PTW32_CLEANUP_CXX ) +shared_lib ( VSE __PTW32_CLEANUP_SEH ) +shared_lib ( VC __PTW32_CLEANUP_C ) + +static_lib ( VCE __PTW32_CLEANUP_CXX ) +static_lib ( VSE __PTW32_CLEANUP_SEH ) +static_lib ( VC __PTW32_CLEANUP_C ) + +################################# +# Install # +################################# +install(FILES _ptw32.h pthread.h sched.h semaphore.h DESTINATION ${HDRDEST}) + +################################# +# Test # +################################# +option(ENABLE_TESTS "Enable Test code build" FALSE) + +#TODO determine if cross compile... +if(ENABLE_TESTS) + add_subdirectory(tests) +endif() diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..1f5700f --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,93 @@ +version: 3.0.1.{build} + +cache: + - C:\Tools\ninja\ninja.exe + +shallow_clone: true +clone_depth: 1 + +branches: + only: + - cmake + +configuration: +- MinSizeRel +- Release +- Debug + +environment: + DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' + CMAKE_DIST_DIR: C:/projects/pthreads4w/dist + NINJA_DIR: C:\Tools\ninja + matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + PLATFORM: x64 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + ARCHITECTURE: x86_amd64 + ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + PLATFORM: x86 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + ARCHITECTURE: x86 + ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + PLATFORM: x64 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' + ARCHITECTURE: + ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + PLATFORM: x86 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"' + ARCHITECTURE: + ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + +init: + - echo BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% + +install: + # Ninja + - if not exist %NINJA_DIR%\ mkdir %NINJA_DIR% + - cd %NINJA_DIR% + - if not exist ninja.exe appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip + - if not exist ninja.exe 7z x ninja-win.zip + - set PATH=%NINJA_DIR%;%PATH% + # CMake + - cmake --version + +build: + parallel: true + +build_script: + - call "%VCVARSALL%" %ARCHITECTURE% + - cd %APPVEYOR_BUILD_FOLDER% + - mkdir build + - cd build + - cmake -G"%GENERATOR%" + -DCMAKE_BUILD_TYPE=%CONFIGURATION% + -DBUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% + -DDIST_ROOT="%CMAKE_DIST_DIR%/%APPVEYOR_BUILD_WORKER_IMAGE%" + -DENABLE_TESTS=ON + .. + - cmake --build . --config %CONFIGURATION% --target install + +after_build: + - cd %DIST_DIR% + - 7z a -tzip %ARCHIVE%.zip "%APPVEYOR_BUILD_WORKER_IMAGE%" + - certutil -hashfile %ARCHIVE%.zip MD5 > %ARCHIVE%.md5 + +artifacts: + - path: dist\$(ARCHIVE).zip + - path: dist\$(ARCHIVE).md5 + +test: +before_test: + - set PATH=%APPVEYOR_BUILD_FOLDER%\build;%PATH% +test_script: + - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ cd %APPVEYOR_BUILD_FOLDER%\build\tests + - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% +after_test: + # TODO process CTest output \ No newline at end of file diff --git a/cmake/common.cmake b/cmake/common.cmake new file mode 100644 index 0000000..70ead8a --- /dev/null +++ b/cmake/common.cmake @@ -0,0 +1,150 @@ + +set(PTHREAD_SRCS + ptw32_MCS_lock.c + ptw32_is_attr.c + ptw32_processInitialize.c + ptw32_processTerminate.c + ptw32_threadStart.c + ptw32_threadDestroy.c + ptw32_tkAssocCreate.c + ptw32_tkAssocDestroy.c + ptw32_callUserDestroyRoutines.c + ptw32_semwait.c + ptw32_timespec.c + ptw32_throw.c + ptw32_getprocessors.c + ptw32_calloc.c + ptw32_new.c + ptw32_reuse.c + ptw32_relmillisecs.c + ptw32_cond_check_need_init.c + ptw32_mutex_check_need_init.c + ptw32_rwlock_check_need_init.c + ptw32_rwlock_cancelwrwait.c + ptw32_spinlock_check_need_init.c + pthread_attr_init.c + pthread_attr_destroy.c + pthread_attr_getaffinity_np.c + pthread_attr_setaffinity_np.c + pthread_attr_getdetachstate.c + pthread_attr_setdetachstate.c + pthread_attr_getname_np.c + pthread_attr_setname_np.c + pthread_attr_getscope.c + pthread_attr_setscope.c + pthread_attr_getstackaddr.c + pthread_attr_setstackaddr.c + pthread_attr_getstacksize.c + pthread_attr_setstacksize.c + pthread_barrier_init.c + pthread_barrier_destroy.c + pthread_barrier_wait.c + pthread_barrierattr_init.c + pthread_barrierattr_destroy.c + pthread_barrierattr_setpshared.c + pthread_barrierattr_getpshared.c + pthread_setcancelstate.c + pthread_setcanceltype.c + pthread_testcancel.c + pthread_cancel.c + pthread_condattr_destroy.c + pthread_condattr_getpshared.c + pthread_condattr_init.c + pthread_condattr_setpshared.c + pthread_cond_destroy.c + pthread_cond_init.c + pthread_cond_signal.c + pthread_cond_wait.c + create.c + cleanup.c + dll.c + errno.c + pthread_exit.c + global.c + pthread_equal.c + pthread_getconcurrency.c + pthread_kill.c + pthread_once.c + pthread_self.c + pthread_setconcurrency.c + w32_CancelableWait.c + pthread_mutex_init.c + pthread_mutex_destroy.c + pthread_mutexattr_init.c + pthread_mutexattr_destroy.c + pthread_mutexattr_getpshared.c + pthread_mutexattr_setpshared.c + pthread_mutexattr_settype.c + pthread_mutexattr_gettype.c + pthread_mutexattr_setrobust.c + pthread_mutexattr_getrobust.c + pthread_mutex_lock.c + pthread_mutex_timedlock.c + pthread_mutex_unlock.c + pthread_mutex_trylock.c + pthread_mutex_consistent.c + pthread_mutexattr_setkind_np.c + pthread_mutexattr_getkind_np.c + pthread_getw32threadhandle_np.c + pthread_getunique_np.c + pthread_timedjoin_np.c + pthread_tryjoin_np.c + pthread_setaffinity.c + pthread_delay_np.c + pthread_num_processors_np.c + pthread_win32_attach_detach_np.c + pthread_timechange_handler_np.c + pthread_rwlock_init.c + pthread_rwlock_destroy.c + pthread_rwlockattr_init.c + pthread_rwlockattr_destroy.c + pthread_rwlockattr_getpshared.c + pthread_rwlockattr_setpshared.c + pthread_rwlock_rdlock.c + pthread_rwlock_timedrdlock.c + pthread_rwlock_wrlock.c + pthread_rwlock_timedwrlock.c + pthread_rwlock_unlock.c + pthread_rwlock_tryrdlock.c + pthread_rwlock_trywrlock.c + pthread_attr_setschedpolicy.c + pthread_attr_getschedpolicy.c + pthread_attr_setschedparam.c + pthread_attr_getschedparam.c + pthread_attr_setinheritsched.c + pthread_attr_getinheritsched.c + pthread_setschedparam.c + pthread_getschedparam.c + sched_get_priority_max.c + sched_get_priority_min.c + sched_setscheduler.c + sched_getscheduler.c + sched_yield.c + sched_setaffinity.c + sem_init.c + sem_destroy.c + sem_trywait.c + sem_timedwait.c + sem_wait.c + sem_post.c + sem_post_multiple.c + sem_getvalue.c + sem_open.c + sem_close.c + sem_unlink.c + pthread_spin_init.c + pthread_spin_destroy.c + pthread_spin_lock.c + pthread_spin_unlock.c + pthread_spin_trylock.c + pthread_detach.c + pthread_join.c + pthread_timedjoin_np.c + pthread_tryjoin_np.c + pthread_key_create.c + pthread_key_delete.c + pthread_getname_np.c + pthread_setname_np.c + pthread_setspecific.c + pthread_getspecific.c +) diff --git a/cmake/get_version.cmake b/cmake/get_version.cmake new file mode 100644 index 0000000..82e92c7 --- /dev/null +++ b/cmake/get_version.cmake @@ -0,0 +1,21 @@ + +file(READ ${CMAKE_SOURCE_DIR}/_ptw32.h _PTW32_H_CONTENTS) + +string(REGEX MATCH "#define __PTW32_VERSION_MAJOR ([a-zA-Z0-9_]+)" PTW32_VERSION_MAJOR "${_PTW32_H_CONTENTS}") +string(REPLACE "#define __PTW32_VERSION_MAJOR " "" PTW32_VERSION_MAJOR "${PTW32_VERSION_MAJOR}") + +string(REGEX MATCH "#define __PTW32_VERSION_MINOR ([a-zA-Z0-9_]+)" PTW32_VERSION_MINOR "${_PTW32_H_CONTENTS}") +string(REPLACE "#define __PTW32_VERSION_MINOR " "" PTW32_VERSION_MINOR "${PTW32_VERSION_MINOR}") + +string(REGEX MATCH "#define __PTW32_VERSION_MICRO ([a-zA-Z0-9_]+)" PTW32_VERSION_MICRO "${_PTW32_H_CONTENTS}") +string(REPLACE "#define __PTW32_VERSION_MICRO " "" PTW32_VERSION_MICRO "${PTW32_VERSION_MICRO}") + +string(REGEX MATCH "#define __PTW32_VERION_BUILD ([a-zA-Z0-9_]+)" PTW32_VERSION_BUILD "${_PTW32_H_CONTENTS}") +string(REPLACE "#define __PTW32_VERION_BUILD " "" PTW32_VERSION_BUILD "${PTW32_VERSION_BUILD}") + +if(BUILD_NUMBER) + set(PTW32_VERSION_BUILD ${BUILD_NUMBER}) +endif() + +set(PTHREADS4W_VERSION ${PTW32_VERSION_MAJOR}.${PTW32_VERSION_MINOR}.${PTW32_VERSION_MICRO}.${PTW32_VERSION_BUILD}) + diff --git a/cmake/target_arch.cmake b/cmake/target_arch.cmake new file mode 100644 index 0000000..0545044 --- /dev/null +++ b/cmake/target_arch.cmake @@ -0,0 +1,36 @@ + +set(TARGET_ARCH_DETECT_CODE " + + #if defined(_M_ARM) + #error cmake_arch ARM + #elif defined(_M_ARM64) + #error cmake_arch ARM64 + #elif defined(_M_AMD64) + #error cmake_arch x86_64 + #elif defined(_M_X64) + #error cmake_arch x64 + #elif defined(_M_IX86) + #error cmake_arch x86 + #else + #error cmake_arch unknown + #endif +") + +function(get_target_arch out) + + file(WRITE + "${CMAKE_BINARY_DIR}/target_arch_detect.c" + "${TARGET_ARCH_DETECT_CODE}") + + try_run( + run_result_unused compile_result_unused + "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/target_arch_detect.c" + COMPILE_OUTPUT_VARIABLE TARGET_ARCH) + + # parse compiler output + string(REGEX MATCH "cmake_arch ([a-zA-Z0-9_]+)" TARGET_ARCH "${TARGET_ARCH}") + string(REPLACE "cmake_arch " "" TARGET_ARCH "${TARGET_ARCH}") + + set(${out} "${TARGET_ARCH}" PARENT_SCOPE) + +endfunction() diff --git a/cmake/version.rc.in b/cmake/version.rc.in new file mode 100644 index 0000000..0afaa8d --- /dev/null +++ b/cmake/version.rc.in @@ -0,0 +1,418 @@ +/* This is an implementation of the threads API of POSIX 1003.1-2001. + * + * -------------------------------------------------------------------------- + * + * Pthreads4w - POSIX Threads for Windows + * Copyright 1998 John E. Bossom + * Copyright 1999-2018, Pthreads4w contributors + * + * Homepage: https://sourceforge.net/projects/pthreads4w/ + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * + * https://sourceforge.net/p/pthreads4w/wiki/Contributors/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "pthread.h" + +/* + * Note: the correct __PTW32_CLEANUP_* macro must be defined corresponding to + * the definition used for the object file builds. This is done in the + * relevent makefiles for the command line builds, but users should ensure + * that their resource compiler knows what it is too. + * If using the default (no __PTW32_CLEANUP_* defined), pthread.h will define it + * as __PTW32_CLEANUP_C. + */ + +#if defined (__PTW32_RC_MSC) +# if defined (__PTW32_ARCHx64) || defined (__PTW32_ARCHX64) || defined (__PTW32_ARCHAMD64) +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadVC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C x64\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadVCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ x64\0" +# elif defined(__PTW32_CLEANUP_SEH) +# define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH x64\0" +# endif +# elif defined (__PTW32_ARCHx86) || defined (__PTW32_ARCHX86) +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadVC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C x86\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadVCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ x86\0" +# elif defined(__PTW32_CLEANUP_SEH) +# define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH x86\0" +# endif +# elif defined (__PTW32_ARCHARM) || defined (__PTW32_ARCHARM) +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadVC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C ARM\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadVCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ ARM\0" +# elif defined(__PTW32_CLEANUP_SEH) +# define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH ARM\0" +# endif +# endif +#elif defined(__GNUC__) +# if defined(_M_X64) +# define __PTW32_ARCH "x64 (mingw64)" +# else +# define __PTW32_ARCH "x86 (mingw32)" +# endif +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadGC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "GNU C " __PTW32_ARCH "\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadGCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "GNU C++ " __PTW32_ARCH "\0" +# else +# error Resource compiler doesn't know which cleanup style you're using - see version.rc +# endif +#elif defined(__BORLANDC__) +# if defined(_M_X64) +# define __PTW32_ARCH "x64 (Borland)" +# else +# define __PTW32_ARCH "x86 (Borland)" +# endif +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadBC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "BORLAND C " __PTW32_ARCH "\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadBCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "BORLAND C++ " __PTW32_ARCH "\0" +# else +# error Resource compiler doesn't know which cleanup style you're using - see version.rc +# endif +#elif defined(__WATCOMC__) +# if defined(_M_X64) +# define __PTW32_ARCH "x64 (Watcom)" +# else +# define __PTW32_ARCH "x86 (Watcom)" +# endif +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadWC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "WATCOM C " __PTW32_ARCH "\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadWCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "WATCOM C++ " __PTW32_ARCH "\0" +# else +# error Resource compiler doesn't know which cleanup style you're using - see version.rc +# endif +#else +# error Resource compiler doesn't know which compiler you're using - see version.rc +#endif + + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __PTW32_VERSION + PRODUCTVERSION __PTW32_VERSION + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "ProductName", "POSIX Threads for Windows\0" + VALUE "ProductVersion", __PTW32_VERSION_STRING + VALUE "FileVersion", __PTW32_VERSION_STRING + VALUE "FileDescription", __PTW32_VERSIONINFO_DESCRIPTION + VALUE "InternalName", __PTW32_VERSIONINFO_NAME + VALUE "OriginalFilename", __PTW32_VERSIONINFO_NAME + VALUE "CompanyName", "Open Source Software community\0" + VALUE "LegalCopyright", "Copyright - Project contributors 1999-2018\0" + VALUE "Comments", "https://sourceforge.net/p/pthreads4w/wiki/Contributors/\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +/* +VERSIONINFO Resource + +The VERSIONINFO resource-definition statement creates a version-information +resource. The resource contains such information about the file as its +version number, its intended operating system, and its original filename. +The resource is intended to be used with the Version Information functions. + +versionID VERSIONINFO fixed-info { block-statement...} + +versionID + Version-information resource identifier. This value must be 1. + +fixed-info + Version information, such as the file version and the intended operating + system. This parameter consists of the following statements. + + + Statement Description + -------------------------------------------------------------------------- + FILEVERSION + version Binary version number for the file. The version + consists of two 32-bit integers, defined by four + 16-bit integers. For example, "FILEVERSION 3,10,0,61" + is translated into two doublewords: 0x0003000a and + 0x0000003d, in that order. Therefore, if version is + defined by the DWORD values dw1 and dw2, they need + to appear in the FILEVERSION statement as follows: + HIWORD(dw1), LOWORD(dw1), HIWORD(dw2), LOWORD(dw2). + PRODUCTVERSION + version Binary version number for the product with which the + file is distributed. The version parameter is two + 32-bit integers, defined by four 16-bit integers. + For more information about version, see the + FILEVERSION description. + FILEFLAGSMASK + fileflagsmask Bits in the FILEFLAGS statement are valid. If a bit + is set, the corresponding bit in FILEFLAGS is valid. + FILEFLAGSfileflags Attributes of the file. The fileflags parameter must + be the combination of all the file flags that are + valid at compile time. For 16-bit Windows, this + value is 0x3f. + FILEOSfileos Operating system for which this file was designed. + The fileos parameter can be one of the operating + system values given in the Remarks section. + FILETYPEfiletype General type of file. The filetype parameter can be + one of the file type values listed in the Remarks + section. + FILESUBTYPE + subtype Function of the file. The subtype parameter is zero + unless the type parameter in the FILETYPE statement + is VFT_DRV, VFT_FONT, or VFT_VXD. For a list of file + subtype values, see the Remarks section. + +block-statement + Specifies one or more version-information blocks. A block can contain + string information or variable information. For more information, see + StringFileInfo Block or VarFileInfo Block. + +Remarks + +To use the constants specified with the VERSIONINFO statement, you must +include the Winver.h or Windows.h header file in the resource-definition file. + +The following list describes the parameters used in the VERSIONINFO statement: + +fileflags + A combination of the following values. + + Value Description + + VS_FF_DEBUG File contains debugging information or is compiled + with debugging features enabled. + VS_FF_PATCHED File has been modified and is not identical to the + original shipping file of the same version number. + VS_FF_PRERELEASE File is a development version, not a commercially + released product. + VS_FF_PRIVATEBUILD File was not built using standard release procedures. + If this value is given, the StringFileInfo block must + contain a PrivateBuild string. + VS_FF_SPECIALBUILD File was built by the original company using standard + release procedures but is a variation of the standard + file of the same version number. If this value is + given, the StringFileInfo block must contain a + SpecialBuild string. + +fileos + One of the following values. + + Value Description + + VOS_UNKNOWN The operating system for which the file was designed + is unknown. + VOS_DOS File was designed for MS-DOS. + VOS_NT File was designed for Windows Server 2003 family, + Windows XP, Windows 2000, or Windows NT. + VOS__WINDOWS16 File was designed for 16-bit Windows. + VOS__WINDOWS32 File was designed for 32-bit Windows. + VOS_DOS_WINDOWS16 File was designed for 16-bit Windows running with + MS-DOS. + VOS_DOS_WINDOWS32 File was designed for 32-bit Windows running with + MS-DOS. + VOS_NT_WINDOWS32 File was designed for Windows Server 2003 family, + Windows XP, Windows 2000, or Windows NT. + + The values 0x00002L, 0x00003L, 0x20000L and 0x30000L are reserved. + +filetype + One of the following values. + + Value Description + + VFT_UNKNOWN File type is unknown. + VFT_APP File contains an application. + VFT_DLL File contains a dynamic-link library (DLL). + VFT_DRV File contains a device driver. If filetype is + VFT_DRV, subtype contains a more specific + description of the driver. + VFT_FONT File contains a font. If filetype is VFT_FONT, + subtype contains a more specific description of the + font. + VFT_VXD File contains a virtual device. + VFT_STATIC_LIB File contains a static-link library. + + All other values are reserved for use by Microsoft. + +subtype + Additional information about the file type. + + If filetype specifies VFT_DRV, this parameter can be one of the + following values. + + Value Description + + VFT2_UNKNOWN Driver type is unknown. + VFT2_DRV_COMM File contains a communications driver. + VFT2_DRV_PRINTER File contains a printer driver. + VFT2_DRV_KEYBOARD File contains a keyboard driver. + VFT2_DRV_LANGUAGE File contains a language driver. + VFT2_DRV_DISPLAY File contains a display driver. + VFT2_DRV_MOUSE File contains a mouse driver. + VFT2_DRV_NETWORK File contains a network driver. + VFT2_DRV_SYSTEM File contains a system driver. + VFT2_DRV_INSTALLABLE File contains an installable driver. + VFT2_DRV_SOUND File contains a sound driver. + VFT2_DRV_VERSIONED_PRINTER File contains a versioned printer driver. + + If filetype specifies VFT_FONT, this parameter can be one of the + following values. + + Value Description + + VFT2_UNKNOWN Font type is unknown. + VFT2_FONT_RASTER File contains a raster font. + VFT2_FONT_VECTOR File contains a vector font. + VFT2_FONT_TRUETYPE File contains a TrueType font. + + If filetype specifies VFT_VXD, this parameter must be the virtual-device + identifier included in the virtual-device control block. + + All subtype values not listed here are reserved for use by Microsoft. + +langID + One of the following language codes. + + Code Language Code Language + + 0x0401 Arabic 0x0415 Polish + 0x0402 Bulgarian 0x0416 Portuguese (Brazil) + 0x0403 Catalan 0x0417 Rhaeto-Romanic + 0x0404 Traditional Chinese 0x0418 Romanian + 0x0405 Czech 0x0419 Russian + 0x0406 Danish 0x041A Croato-Serbian (Latin) + 0x0407 German 0x041B Slovak + 0x0408 Greek 0x041C Albanian + 0x0409 U.S. English 0x041D Swedish + 0x040A Castilian Spanish 0x041E Thai + 0x040B Finnish 0x041F Turkish + 0x040C French 0x0420 Urdu + 0x040D Hebrew 0x0421 Bahasa + 0x040E Hungarian 0x0804 Simplified Chinese + 0x040F Icelandic 0x0807 Swiss German + 0x0410 Italian 0x0809 U.K. English + 0x0411 Japanese 0x080A Mexican Spanish + 0x0412 Korean 0x080C Belgian French + 0x0413 Dutch 0x0C0C Canadian French + 0x0414 Norwegian ā€“ Bokmal 0x100C Swiss French + 0x0810 Swiss Italian 0x0816 Portuguese (Portugal) + 0x0813 Belgian Dutch 0x081A Serbo-Croatian (Cyrillic) + 0x0814 Norwegian ā€“ Nynorsk + +charsetID + One of the following character-set identifiers. + + Identifier Character Set + + 0 7-bit ASCII + 932 Japan (Shift %Gā€“%@ JIS X-0208) + 949 Korea (Shift %Gā€“%@ KSC 5601) + 950 Taiwan (Big5) + 1200 Unicode + 1250 Latin-2 (Eastern European) + 1251 Cyrillic + 1252 Multilingual + 1253 Greek + 1254 Turkish + 1255 Hebrew + 1256 Arabic + +string-name + One of the following predefined names. + + Name Description + + Comments Additional information that should be displayed for + diagnostic purposes. + CompanyName Company that produced the file%Gā€”%@for example, + "Microsoft Corporation" or "Standard Microsystems + Corporation, Inc." This string is required. + FileDescription File description to be presented to users. This + string may be displayed in a list box when the user + is choosing files to install%Gā€”%@for example, + "Keyboard Driver for AT-Style Keyboards". This + string is required. + FileVersion Version number of the file%Gā€”%@for example, + "3.10" or "5.00.RC2". This string is required. + InternalName Internal name of the file, if one exists ā€” for + example, a module name if the file is a dynamic-link + library. If the file has no internal name, this + string should be the original filename, without + extension. This string is required. + LegalCopyright Copyright notices that apply to the file. This + should include the full text of all notices, legal + symbols, copyright dates, and so on ā€” for example, + "Copyright (C) Microsoft Corporation 1990ā€“1999". + This string is optional. + LegalTrademarks Trademarks and registered trademarks that apply to + the file. This should include the full text of all + notices, legal symbols, trademark numbers, and so on. + This string is optional. + OriginalFilename Original name of the file, not including a path. + This information enables an application to determine + whether a file has been renamed by a user. The + format of the name depends on the file system for + which the file was created. This string is required. + PrivateBuild Information about a private version of the file ā€” for + example, "Built by TESTER1 on \TESTBED". This string + should be present only if VS_FF_PRIVATEBUILD is + specified in the fileflags parameter of the root + block. + ProductName Name of the product with which the file is + distributed. This string is required. + ProductVersion Version of the product with which the file is + distributed ā€” for example, "3.10" or "5.00.RC2". + This string is required. + SpecialBuild Text that indicates how this version of the file + differs from the standard version ā€” for example, + "Private build for TESTER1 solving mouse problems + on M250 and M250E computers". This string should be + present only if VS_FF_SPECIALBUILD is specified in + the fileflags parameter of the root block. + */ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..7d39d60 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,77 @@ + +include (CTest) + +include_directories(..) + +set(XXLIBS ws2_32.lib) + +set(VCEFLAGS "${VCEFLAGS} -D__PtW32NoCatchWarn") + +macro(add_testcase test type def) + + set(lib_test test-${test}${type}${PTW32_VER}) + set(dll_test test-dll-${test}${type}${PTW32_VER}) + + set(lib_lib libpthread${type}${PTW32_VER}) + set(dll_lib pthread${type}${PTW32_VER}) + + set(extra "") + if(${test} MATCHES "benchtest") + set(c_dep "benchlib.c") + elseif(${test} MATCHES "openmp1") + if(MSVC) + set(extra "/openmp -D_OPENMP") + endif() + endif() + + add_executable(${lib_test} ${test}.c ${c_dep}) + target_link_libraries(${lib_test} ${lib_lib}${targ_suffix}.lib ${XXLIBS}) + target_compile_definitions(${lib_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") + add_dependencies(${lib_test} ${lib_lib}) + + add_executable(${dll_test} ${test}.c ${c_dep}) + target_link_libraries(${dll_test} ${dll_lib}${targ_suffix}.lib ${XXLIBS}) + target_compile_definitions(${dll_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") + add_dependencies(${dll_test} ${dll_lib}) + + if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/tests/${lib_test}.exe DESTINATION ${TESTDEST}) + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/tests/${dll_test}.exe DESTINATION ${TESTDEST}) + else() + install(FILES ${CMAKE_BINARY_DIR}/tests/${lib_test}.exe DESTINATION ${TESTDEST}) + install(FILES ${CMAKE_BINARY_DIR}/tests/${dll_test}.exe DESTINATION ${TESTDEST}) + endif() + + if(${type} MATCHES "VCE") + set_target_properties(${lib_test} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + set_target_properties(${dll_test} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + endif() + + add_test(NAME ${lib_test} COMMAND ${lib_test}) + add_test(NAME ${dll_test} COMMAND ${dll_test}) + +endmacro() + + +file(GLOB TESTS *.c) + +foreach(t ${TESTS}) + + get_filename_component(test ${t} NAME) + string(REPLACE ".c" "" test "${test}") + + # exclusions + if(${test} STREQUAL "benchlib") + list(REMOVE_ITEM TESTS ${t}) + continue() + elseif(${test} STREQUAL "context2") # SEGFAULT + continue() + elseif(${test} STREQUAL "tryentercs2") # SEGFAULT + continue() + endif() + + add_testcase(${test} VCE __PTW32_CLEANUP_CXX ) + add_testcase(${test} VSE __PTW32_CLEANUP_SEH ) + add_testcase(${test} VC __PTW32_CLEANUP_C ) + +endforeach(t) From 6579208c1f074e12d73e8fa5c7dacd550a425c73 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 12:15:21 -0700 Subject: [PATCH 03/95] extra build logging, remove unused --- CMakeLists.txt | 6 +- cmake/common.cmake | 150 --------------------------------------------- 2 files changed, 5 insertions(+), 151 deletions(-) delete mode 100644 cmake/common.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 73af7de..8882323 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ include (get_version) message(STATUS "Generator ......... ${CMAKE_GENERATOR}") message(STATUS "Build Type ........ ${CMAKE_BUILD_TYPE}") message(STATUS "Version ........... ${PTHREADS4W_VERSION}") +message(STATUS "Host .............. ${CMAKE_HOST_SYSTEM_PROCESSOR}") project(pthreads4w VERSION ${PTHREADS4W_VERSION} LANGUAGES C) @@ -21,7 +22,6 @@ set(CMAKE_DEBUG_POSTFIX d) # Uncomment this if config.h defines RETAIN_WSALASTERROR #set(XLIBS wsock32.lib) -include (common) include_directories(.) @@ -43,6 +43,10 @@ elseif(${TARGET_ARCH} STREQUAL "x64") else() MESSAGE(ERROR "\"${TARGET_ARCH}\" not supported in version.rc") endif() +message(STATUS "Target ............ ${TARGET_ARCH}") +if(MSVC) + message(STATUS "MSVC Version ...... ${MSVC_VERSION}") +endif() ################################# # Install Path # diff --git a/cmake/common.cmake b/cmake/common.cmake deleted file mode 100644 index 70ead8a..0000000 --- a/cmake/common.cmake +++ /dev/null @@ -1,150 +0,0 @@ - -set(PTHREAD_SRCS - ptw32_MCS_lock.c - ptw32_is_attr.c - ptw32_processInitialize.c - ptw32_processTerminate.c - ptw32_threadStart.c - ptw32_threadDestroy.c - ptw32_tkAssocCreate.c - ptw32_tkAssocDestroy.c - ptw32_callUserDestroyRoutines.c - ptw32_semwait.c - ptw32_timespec.c - ptw32_throw.c - ptw32_getprocessors.c - ptw32_calloc.c - ptw32_new.c - ptw32_reuse.c - ptw32_relmillisecs.c - ptw32_cond_check_need_init.c - ptw32_mutex_check_need_init.c - ptw32_rwlock_check_need_init.c - ptw32_rwlock_cancelwrwait.c - ptw32_spinlock_check_need_init.c - pthread_attr_init.c - pthread_attr_destroy.c - pthread_attr_getaffinity_np.c - pthread_attr_setaffinity_np.c - pthread_attr_getdetachstate.c - pthread_attr_setdetachstate.c - pthread_attr_getname_np.c - pthread_attr_setname_np.c - pthread_attr_getscope.c - pthread_attr_setscope.c - pthread_attr_getstackaddr.c - pthread_attr_setstackaddr.c - pthread_attr_getstacksize.c - pthread_attr_setstacksize.c - pthread_barrier_init.c - pthread_barrier_destroy.c - pthread_barrier_wait.c - pthread_barrierattr_init.c - pthread_barrierattr_destroy.c - pthread_barrierattr_setpshared.c - pthread_barrierattr_getpshared.c - pthread_setcancelstate.c - pthread_setcanceltype.c - pthread_testcancel.c - pthread_cancel.c - pthread_condattr_destroy.c - pthread_condattr_getpshared.c - pthread_condattr_init.c - pthread_condattr_setpshared.c - pthread_cond_destroy.c - pthread_cond_init.c - pthread_cond_signal.c - pthread_cond_wait.c - create.c - cleanup.c - dll.c - errno.c - pthread_exit.c - global.c - pthread_equal.c - pthread_getconcurrency.c - pthread_kill.c - pthread_once.c - pthread_self.c - pthread_setconcurrency.c - w32_CancelableWait.c - pthread_mutex_init.c - pthread_mutex_destroy.c - pthread_mutexattr_init.c - pthread_mutexattr_destroy.c - pthread_mutexattr_getpshared.c - pthread_mutexattr_setpshared.c - pthread_mutexattr_settype.c - pthread_mutexattr_gettype.c - pthread_mutexattr_setrobust.c - pthread_mutexattr_getrobust.c - pthread_mutex_lock.c - pthread_mutex_timedlock.c - pthread_mutex_unlock.c - pthread_mutex_trylock.c - pthread_mutex_consistent.c - pthread_mutexattr_setkind_np.c - pthread_mutexattr_getkind_np.c - pthread_getw32threadhandle_np.c - pthread_getunique_np.c - pthread_timedjoin_np.c - pthread_tryjoin_np.c - pthread_setaffinity.c - pthread_delay_np.c - pthread_num_processors_np.c - pthread_win32_attach_detach_np.c - pthread_timechange_handler_np.c - pthread_rwlock_init.c - pthread_rwlock_destroy.c - pthread_rwlockattr_init.c - pthread_rwlockattr_destroy.c - pthread_rwlockattr_getpshared.c - pthread_rwlockattr_setpshared.c - pthread_rwlock_rdlock.c - pthread_rwlock_timedrdlock.c - pthread_rwlock_wrlock.c - pthread_rwlock_timedwrlock.c - pthread_rwlock_unlock.c - pthread_rwlock_tryrdlock.c - pthread_rwlock_trywrlock.c - pthread_attr_setschedpolicy.c - pthread_attr_getschedpolicy.c - pthread_attr_setschedparam.c - pthread_attr_getschedparam.c - pthread_attr_setinheritsched.c - pthread_attr_getinheritsched.c - pthread_setschedparam.c - pthread_getschedparam.c - sched_get_priority_max.c - sched_get_priority_min.c - sched_setscheduler.c - sched_getscheduler.c - sched_yield.c - sched_setaffinity.c - sem_init.c - sem_destroy.c - sem_trywait.c - sem_timedwait.c - sem_wait.c - sem_post.c - sem_post_multiple.c - sem_getvalue.c - sem_open.c - sem_close.c - sem_unlink.c - pthread_spin_init.c - pthread_spin_destroy.c - pthread_spin_lock.c - pthread_spin_unlock.c - pthread_spin_trylock.c - pthread_detach.c - pthread_join.c - pthread_timedjoin_np.c - pthread_tryjoin_np.c - pthread_key_create.c - pthread_key_delete.c - pthread_getname_np.c - pthread_setname_np.c - pthread_setspecific.c - pthread_getspecific.c -) From 32f8350d3320cfd6c3d6baddde67bddbde7e7173 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 12:37:29 -0700 Subject: [PATCH 04/95] expand build matrix --- CMakeLists.txt | 3 +- appveyor.yml | 92 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 88 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8882323..f2d42dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,6 @@ include (get_version) message(STATUS "Generator ......... ${CMAKE_GENERATOR}") message(STATUS "Build Type ........ ${CMAKE_BUILD_TYPE}") message(STATUS "Version ........... ${PTHREADS4W_VERSION}") -message(STATUS "Host .............. ${CMAKE_HOST_SYSTEM_PROCESSOR}") project(pthreads4w VERSION ${PTHREADS4W_VERSION} LANGUAGES C) @@ -44,6 +43,8 @@ else() MESSAGE(ERROR "\"${TARGET_ARCH}\" not supported in version.rc") endif() message(STATUS "Target ............ ${TARGET_ARCH}") + +message(STATUS "Host .............. ${CMAKE_HOST_SYSTEM_PROCESSOR}") if(MSVC) message(STATUS "MSVC Version ...... ${MSVC_VERSION}") endif() diff --git a/appveyor.yml b/appveyor.yml index 1f5700f..7008ad0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,30 +20,109 @@ environment: CMAKE_DIST_DIR: C:/projects/pthreads4w/dist NINJA_DIR: C:\Tools\ninja matrix: + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2010' + PLATFORM: x86 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat' + ARCHITECTURE: + ARCHIVE: VS2010_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: ON + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2010' + PLATFORM: x64 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat' + ARCHITECTURE: + ARCHIVE: VS2010_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: ON + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2010' + PLATFORM: ARM + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat' + ARCHITECTURE: + ARCHIVE: VS2010_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: OFF + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2012' + PLATFORM: x86 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat' + ARCHITECTURE: + ARCHIVE: VS2012_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: ON + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2012' + PLATFORM: x64 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat' + ARCHITECTURE: + ARCHIVE: VS2012_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: ON + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2012' + PLATFORM: ARM + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\bin\amd64_arm\vcvarsamd64_arm.bat' + ARCHITECTURE: + ARCHIVE: VS2012_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: OFF + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' + PLATFORM: x86 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat' + ARCHITECTURE: + ARCHIVE: VS2013_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: ON + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' + PLATFORM: x64 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat' + ARCHITECTURE: + ARCHIVE: VS2013_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: ON + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' + PLATFORM: ARM + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\vcvarsamd64_arm.bat' + ARCHITECTURE: + ARCHIVE: VS2013_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' - ARCHITECTURE: x86_amd64 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat' + ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' - ARCHITECTURE: x86 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat' + ARCHITECTURE: + ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: ON + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + PLATFORM: ARM + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_arm\vcvarsx86_arm.bat' + ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja + TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' ARCHITECTURE: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"' ARCHITECTURE: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja + TESTING: ON init: - echo BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% @@ -57,6 +136,7 @@ install: - set PATH=%NINJA_DIR%;%PATH% # CMake - cmake --version + - cmake -G -? build: parallel: true @@ -88,6 +168,6 @@ before_test: - set PATH=%APPVEYOR_BUILD_FOLDER%\build;%PATH% test_script: - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ cd %APPVEYOR_BUILD_FOLDER%\build\tests - - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% + - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -v after_test: - # TODO process CTest output \ No newline at end of file + # TODO process CTest output From fcc843eb198459b29891ffc80ee464ecff68b280 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 12:44:57 -0700 Subject: [PATCH 05/95] build matrix --- CMakeLists.txt | 1 - appveyor.yml | 27 ++++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2d42dc..3d0e4d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,6 @@ else() endif() message(STATUS "Target ............ ${TARGET_ARCH}") -message(STATUS "Host .............. ${CMAKE_HOST_SYSTEM_PROCESSOR}") if(MSVC) message(STATUS "MSVC Version ...... ${MSVC_VERSION}") endif() diff --git a/appveyor.yml b/appveyor.yml index 7008ad0..2a905f4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,15 +12,14 @@ branches: configuration: - MinSizeRel -- Release -- Debug +#- Release +#- Debug environment: DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' CMAKE_DIST_DIR: C:/projects/pthreads4w/dist NINJA_DIR: C:\Tools\ninja matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2010' PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat' @@ -42,7 +41,6 @@ environment: ARCHIVE: VS2010_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2012' PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat' @@ -64,7 +62,6 @@ environment: ARCHIVE: VS2012_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat' @@ -86,7 +83,6 @@ environment: ARCHIVE: VS2013_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat' @@ -108,7 +104,6 @@ environment: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' @@ -118,11 +113,25 @@ environment: TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"' ARCHITECTURE: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: ON + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + PLATFORM: ARM + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat"' + ARCHITECTURE: + ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + PLATFORM: ARM64 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"' + ARCHITECTURE: + ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja + TESTING: OFF init: - echo BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% @@ -150,7 +159,7 @@ build_script: -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% -DDIST_ROOT="%CMAKE_DIST_DIR%/%APPVEYOR_BUILD_WORKER_IMAGE%" - -DENABLE_TESTS=ON + -DENABLE_TESTS=%TESTING% .. - cmake --build . --config %CONFIGURATION% --target install From 40bc4b96517c80d7a895eb993a09c128e1e30c03 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 12:48:01 -0700 Subject: [PATCH 06/95] limit build matrix to supported images --- appveyor.yml | 63 ---------------------------------------------------- 1 file changed, 63 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2a905f4..134f0da 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,69 +20,6 @@ environment: CMAKE_DIST_DIR: C:/projects/pthreads4w/dist NINJA_DIR: C:\Tools\ninja matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2010' - PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat' - ARCHITECTURE: - ARCHIVE: VS2010_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: ON - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2010' - PLATFORM: x64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat' - ARCHITECTURE: - ARCHIVE: VS2010_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: ON - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2010' - PLATFORM: ARM - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat' - ARCHITECTURE: - ARCHIVE: VS2010_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2012' - PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat' - ARCHITECTURE: - ARCHIVE: VS2012_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: ON - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2012' - PLATFORM: x64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat' - ARCHITECTURE: - ARCHIVE: VS2012_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: ON - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2012' - PLATFORM: ARM - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\bin\amd64_arm\vcvarsamd64_arm.bat' - ARCHITECTURE: - ARCHIVE: VS2012_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' - PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat' - ARCHITECTURE: - ARCHIVE: VS2013_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: ON - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' - PLATFORM: x64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat' - ARCHITECTURE: - ARCHIVE: VS2013_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: ON - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013' - PLATFORM: ARM - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\vcvarsamd64_arm.bat' - ARCHITECTURE: - ARCHIVE: VS2013_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat' From 8fe81fc4cea5ab4c1e5a8b542175ce9a1bbbff46 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 12:50:03 -0700 Subject: [PATCH 07/95] remove generator listing --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 134f0da..f349e00 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -82,7 +82,6 @@ install: - set PATH=%NINJA_DIR%;%PATH% # CMake - cmake --version - - cmake -G -? build: parallel: true From 4d1c92725b6aa337fee58ec2eb0bb3d73bfa8488 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 14:23:52 -0700 Subject: [PATCH 08/95] arm fix --- appveyor.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f349e00..4875637 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,35 +37,35 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: ARM VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_arm\vcvarsx86_arm.bat' - ARCHITECTURE: + ARCHITECTURE: store ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' - ARCHITECTURE: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' + ARCHITECTURE: x64 ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"' - ARCHITECTURE: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' + ARCHITECTURE: amd64_x86 ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat"' - ARCHITECTURE: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' + ARCHITECTURE: 'amd64_arm store' ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"' - ARCHITECTURE: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' + ARCHITECTURE: 'amd64_arm64 store' ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF From 8194a63b666487c030e53dd975763bf1f50f53b4 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 14:27:08 -0700 Subject: [PATCH 09/95] limit build matrix --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4875637..9dc7051 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,14 +26,14 @@ environment: ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat' ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: ARM VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_arm\vcvarsx86_arm.bat' @@ -47,14 +47,14 @@ environment: ARCHITECTURE: x64 ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' ARCHITECTURE: amd64_x86 ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' From cf892bf2397df75df975faa9c41a23eac14f8b4c Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 14:32:56 -0700 Subject: [PATCH 10/95] nmake, remove vs2015 arm --- appveyor.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9dc7051..fa85924 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,22 +25,22 @@ environment: VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat' ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat' ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - PLATFORM: ARM - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_arm\vcvarsx86_arm.bat' - ARCHITECTURE: store - ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF + #- APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + #PLATFORM: ARM + #VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_arm\vcvarsx86_arm.bat' + #ARCHITECTURE: store + #ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + #GENERATOR: 'NMake Makefiles' + #TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' From 0393575cfcdbbe6517b55c1b15b8fdc8561ae7ae Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 14:43:33 -0700 Subject: [PATCH 11/95] arm store debug --- CMakeLists.txt | 4 ++++ appveyor.yml | 25 ++++++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d0e4d7..475ebe6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,10 @@ get_target_arch(TARGET_ARCH) if(${TARGET_ARCH} STREQUAL "ARM") add_definitions(-D__PTW32_ARCHARM) + link_libraries(runtimeobject.lib) +elseif(${TARGET_ARCH} STREQUAL "ARM64") + add_definitions(-D__PTW32_ARCHARM64) + link_libraries(runtimeobject.lib) elseif(${TARGET_ARCH} STREQUAL "x86_64") add_definitions(-D__PTW32_ARCHAMD64) elseif(${TARGET_ARCH} STREQUAL "x86") diff --git a/appveyor.yml b/appveyor.yml index fa85924..f379c66 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,24 +34,24 @@ environment: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' TESTING: OFF - #- APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - #PLATFORM: ARM - #VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_arm\vcvarsx86_arm.bat' - #ARCHITECTURE: store - #ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - #GENERATOR: 'NMake Makefiles' - #TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + PLATFORM: ARM + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_arm\vcvarsx86_arm.bat' + ARCHITECTURE: store + ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' - ARCHITECTURE: x64 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' + ARCHITECTURE: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' - ARCHITECTURE: amd64_x86 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"' + ARCHITECTURE: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: OFF @@ -83,6 +83,9 @@ install: # CMake - cmake --version + - dir /s '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\' + - type '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + build: parallel: true From 086fb5ad2e3a11789da191dbaa2f698c5f99d024 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 14:45:04 -0700 Subject: [PATCH 12/95] arm store debug --- appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f379c66..62eb1a9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -83,8 +83,9 @@ install: # CMake - cmake --version - - dir /s '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\' - - type '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + - cd "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\" + - dir /s + - type vcvarsall.bat build: parallel: true From 2f19b1651713235c4a98e28f5aad4ca5c10e1cd6 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 14:51:08 -0700 Subject: [PATCH 13/95] arm store debug --- appveyor.yml | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 62eb1a9..ba55870 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: 3.0.1.{build} -cache: - - C:\Tools\ninja\ninja.exe +#cache: + #- C:\Tools\ninja\ninja.exe shallow_clone: true clone_depth: 1 @@ -18,56 +18,57 @@ configuration: environment: DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' CMAKE_DIST_DIR: C:/projects/pthreads4w/dist - NINJA_DIR: C:\Tools\ninja + #NINJA_DIR: C:\Tools\ninja matrix: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat' - ARCHITECTURE: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + ARCHITECTURE: amd64 ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat' + PLATFORM: amd64_x86 + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: ARM - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\bin\x86_arm\vcvarsx86_arm.bat' - ARCHITECTURE: store + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + ARCHITECTURE: 'amd64_arm store' ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' ARCHITECTURE: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"' ARCHITECTURE: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' ARCHITECTURE: 'amd64_arm store' ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' ARCHITECTURE: 'amd64_arm64 store' ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF init: @@ -75,17 +76,17 @@ init: install: # Ninja - - if not exist %NINJA_DIR%\ mkdir %NINJA_DIR% - - cd %NINJA_DIR% - - if not exist ninja.exe appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip - - if not exist ninja.exe 7z x ninja-win.zip - - set PATH=%NINJA_DIR%;%PATH% + #- if not exist %NINJA_DIR%\ mkdir %NINJA_DIR% + #- cd %NINJA_DIR% + #- if not exist ninja.exe appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip + #- if not exist ninja.exe 7z x ninja-win.zip + #- set PATH=%NINJA_DIR%;%PATH% # CMake - cmake --version - - cd "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\" - - dir /s - - type vcvarsall.bat + #- cd "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\" + #- dir /s + #- type vcvarsall.bat build: parallel: true From f854c99521624cd28170bcd7dec2e668bdec7c5e Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 14:57:07 -0700 Subject: [PATCH 14/95] arm store debug --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 475ebe6..eb97cc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,10 +33,10 @@ get_target_arch(TARGET_ARCH) if(${TARGET_ARCH} STREQUAL "ARM") add_definitions(-D__PTW32_ARCHARM) - link_libraries(runtimeobject.lib) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} runtimeobject.lib") elseif(${TARGET_ARCH} STREQUAL "ARM64") add_definitions(-D__PTW32_ARCHARM64) - link_libraries(runtimeobject.lib) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} runtimeobject.lib") elseif(${TARGET_ARCH} STREQUAL "x86_64") add_definitions(-D__PTW32_ARCHAMD64) elseif(${TARGET_ARCH} STREQUAL "x86") From 6306c1669aad33de8e5ff6434538f767336689e2 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 15:11:54 -0700 Subject: [PATCH 15/95] arm store debug --- appveyor.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ba55870..505ec09 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,10 +36,9 @@ environment: TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: ARM - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' - ARCHITECTURE: 'amd64_arm store' + VCVARSALL: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'NMake Makefiles' + GENERATOR: 'Visual Studio 14 2015 ARM' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' @@ -58,17 +57,9 @@ environment: TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' - ARCHITECTURE: 'amd64_arm store' + VCVARSALL: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'NMake Makefiles' - TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - PLATFORM: ARM64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\vcvarsall.bat"' - ARCHITECTURE: 'amd64_arm64 store' - ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'NMake Makefiles' + GENERATOR: 'Visual Studio 15 2017 ARM' TESTING: OFF init: @@ -84,15 +75,12 @@ install: # CMake - cmake --version - #- cd "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\" - #- dir /s - #- type vcvarsall.bat - build: parallel: true build_script: - - call "%VCVARSALL%" %ARCHITECTURE% + - if exist "%VCVARSALL%" call "%VCVARSALL%" %ARCHITECTURE% + - cd %APPVEYOR_BUILD_FOLDER% - mkdir build - cd build From 617d64bd164797aa82b8997c772fd1b3fa64f2cc Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 15:23:24 -0700 Subject: [PATCH 16/95] arm store debug --- CMakeLists.txt | 2 -- appveyor.yml | 30 +++++++++++++++++------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb97cc4..debca71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,10 +33,8 @@ get_target_arch(TARGET_ARCH) if(${TARGET_ARCH} STREQUAL "ARM") add_definitions(-D__PTW32_ARCHARM) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} runtimeobject.lib") elseif(${TARGET_ARCH} STREQUAL "ARM64") add_definitions(-D__PTW32_ARCHARM64) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} runtimeobject.lib") elseif(${TARGET_ARCH} STREQUAL "x86_64") add_definitions(-D__PTW32_ARCHAMD64) elseif(${TARGET_ARCH} STREQUAL "x86") diff --git a/appveyor.yml b/appveyor.yml index 505ec09..7d8726b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,20 +20,23 @@ environment: CMAKE_DIST_DIR: C:/projects/pthreads4w/dist #NINJA_DIR: C:\Tools\ninja matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - PLATFORM: x64 + PLATFORM: amd64_x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' - ARCHITECTURE: amd64 + ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - PLATFORM: amd64_x86 + PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' - ARCHITECTURE: + ARCHITECTURE: amd64 ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: ARM VCVARSALL: @@ -41,20 +44,21 @@ environment: GENERATOR: 'Visual Studio 14 2015 ARM' TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - PLATFORM: x64 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' - ARCHITECTURE: + PLATFORM: x86 + VCVARSALL: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'NMake Makefiles' + GENERATOR: 'Visual Studio 15 2017' TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - PLATFORM: x86 - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"' - ARCHITECTURE: + PLATFORM: x64 + VCVARSALL: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'NMake Makefiles' + GENERATOR: 'Visual Studio 15 2017 Win64' TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM VCVARSALL: @@ -106,6 +110,6 @@ before_test: - set PATH=%APPVEYOR_BUILD_FOLDER%\build;%PATH% test_script: - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ cd %APPVEYOR_BUILD_FOLDER%\build\tests - - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -v + - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -V after_test: # TODO process CTest output From e39b8e3aae66d2cd252fbd422d78659687bdfbe3 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 15:29:41 -0700 Subject: [PATCH 17/95] enable full build matrix --- appveyor.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7d8726b..00250ce 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,5 @@ version: 3.0.1.{build} -#cache: - #- C:\Tools\ninja\ninja.exe - shallow_clone: true clone_depth: 1 @@ -12,13 +9,12 @@ branches: configuration: - MinSizeRel -#- Release -#- Debug +- Release +- Debug environment: DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' CMAKE_DIST_DIR: C:/projects/pthreads4w/dist - #NINJA_DIR: C:\Tools\ninja matrix: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' @@ -27,7 +23,7 @@ environment: ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' - TESTING: OFF + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x64 @@ -35,7 +31,7 @@ environment: ARCHITECTURE: amd64 ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' - TESTING: OFF + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: ARM @@ -50,14 +46,14 @@ environment: VCVARSALL: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'Visual Studio 15 2017' - TESTING: OFF + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 VCVARSALL: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'Visual Studio 15 2017 Win64' - TESTING: OFF + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM @@ -70,13 +66,6 @@ init: - echo BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% install: - # Ninja - #- if not exist %NINJA_DIR%\ mkdir %NINJA_DIR% - #- cd %NINJA_DIR% - #- if not exist ninja.exe appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip - #- if not exist ninja.exe 7z x ninja-win.zip - #- set PATH=%NINJA_DIR%;%PATH% - # CMake - cmake --version build: From 0a5d64a1b6c6ff9528d4afe4eb47bd2930b4400b Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 15:39:47 -0700 Subject: [PATCH 18/95] test fix --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7d39d60..eed50b8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,12 +25,12 @@ macro(add_testcase test type def) endif() add_executable(${lib_test} ${test}.c ${c_dep}) - target_link_libraries(${lib_test} ${lib_lib}${targ_suffix}.lib ${XXLIBS}) + target_link_libraries(${lib_test} ${${lib_lib}${targ_suffix}} ${XXLIBS}) target_compile_definitions(${lib_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") add_dependencies(${lib_test} ${lib_lib}) add_executable(${dll_test} ${test}.c ${c_dep}) - target_link_libraries(${dll_test} ${dll_lib}${targ_suffix}.lib ${XXLIBS}) + target_link_libraries(${dll_test} ${${dll_lib}${targ_suffix}} ${XXLIBS}) target_compile_definitions(${dll_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") add_dependencies(${dll_test} ${dll_lib}) From 7d9a9ff51fc9f96ebc503127ecf7526638d9315b Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 15:42:44 -0700 Subject: [PATCH 19/95] test fix --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index eed50b8..a5a772f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,12 +25,12 @@ macro(add_testcase test type def) endif() add_executable(${lib_test} ${test}.c ${c_dep}) - target_link_libraries(${lib_test} ${${lib_lib}${targ_suffix}} ${XXLIBS}) + target_link_libraries(${lib_test} ${lib_lib} ${XXLIBS}) target_compile_definitions(${lib_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") add_dependencies(${lib_test} ${lib_lib}) add_executable(${dll_test} ${test}.c ${c_dep}) - target_link_libraries(${dll_test} ${${dll_lib}${targ_suffix}} ${XXLIBS}) + target_link_libraries(${dll_test} ${dll_lib} ${XXLIBS}) target_compile_definitions(${dll_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") add_dependencies(${dll_test} ${dll_lib}) From 12466209ac15424e19fe88797e42ca77c32b6cda Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 15:54:32 -0700 Subject: [PATCH 20/95] depot_tools --- appveyor.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 00250ce..97f880e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,6 +15,8 @@ configuration: environment: DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' CMAKE_DIST_DIR: C:/projects/pthreads4w/dist + TOOLS_DIR: C:\Tools + DEPOT_TOOLS_DIR: C:\Tools\depot_tools matrix: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' @@ -23,15 +25,15 @@ environment: ARCHITECTURE: ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' ARCHITECTURE: amd64 ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'NMake Makefiles' - TESTING: ON + GENERATOR: Ninja + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: ARM @@ -46,14 +48,14 @@ environment: VCVARSALL: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'Visual Studio 15 2017' - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 VCVARSALL: ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'Visual Studio 15 2017 Win64' - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM @@ -66,6 +68,14 @@ init: - echo BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% install: + # Depot Tools + - if not exist %TOOLS_DIR%\ mkdir %TOOLS_DIR% + - appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip + - 7z x depot_tools.zip + - dir /s + - set PATH=%DEPOT_TOOLS_DIR%;%PATH% + + # CMake - cmake --version build: From 60c7cbf88c1709a051d2709b0e1d6832f7b6e0b9 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 15:59:51 -0700 Subject: [PATCH 21/95] depot_tools --- appveyor.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 97f880e..654fd46 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,8 @@ version: 3.0.1.{build} +cache: + - '%TOOLS_DIR%\depot_tools.zip' + shallow_clone: true clone_depth: 1 @@ -70,11 +73,13 @@ init: install: # Depot Tools - if not exist %TOOLS_DIR%\ mkdir %TOOLS_DIR% - - appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip + - cd %TOOLS_DIR% + - dir + - if not exist .\depot_tools.zip appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip - 7z x depot_tools.zip - - dir /s + - dir - set PATH=%DEPOT_TOOLS_DIR%;%PATH% - + # CMake - cmake --version From 6842538c3878ed25a3ce78352e51bf9afff6cb03 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 16:03:09 -0700 Subject: [PATCH 22/95] depot_tools --- appveyor.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 654fd46..5f867d2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: 3.0.1.{build} cache: - - '%TOOLS_DIR%\depot_tools.zip' + - '%DEPOT_TOOLS_DIR%\depot_tools.zip' shallow_clone: true clone_depth: 1 @@ -18,7 +18,6 @@ configuration: environment: DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' CMAKE_DIST_DIR: C:/projects/pthreads4w/dist - TOOLS_DIR: C:\Tools DEPOT_TOOLS_DIR: C:\Tools\depot_tools matrix: @@ -72,10 +71,10 @@ init: install: # Depot Tools - - if not exist %TOOLS_DIR%\ mkdir %TOOLS_DIR% - - cd %TOOLS_DIR% + - if not exist %DEPOT_TOOLS_DIR%\ mkdir %DEPOT_TOOLS_DIR% + - cd %DEPOT_TOOLS_DIR% - dir - - if not exist .\depot_tools.zip appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip + - if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip - 7z x depot_tools.zip - dir - set PATH=%DEPOT_TOOLS_DIR%;%PATH% From d1527f90bcee9798b107199d5bf5b30e4316c1a7 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 16:18:37 -0700 Subject: [PATCH 23/95] optimize --- appveyor.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5f867d2..0a9f1d1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: 3.0.1.{build} cache: - - '%DEPOT_TOOLS_DIR%\depot_tools.zip' + - C:\Tools\depot_tools\depot_tools.zip shallow_clone: true clone_depth: 1 @@ -47,16 +47,16 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x86 - VCVARSALL: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat' ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'Visual Studio 15 2017' + GENERATOR: Ninja TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 - VCVARSALL: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'Visual Studio 15 2017 Win64' + GENERATOR: Ninja TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' @@ -72,14 +72,13 @@ init: install: # Depot Tools - if not exist %DEPOT_TOOLS_DIR%\ mkdir %DEPOT_TOOLS_DIR% + - cd %DEPOT_TOOLS_DIR% - - dir - if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip - 7z x depot_tools.zip - - dir - set PATH=%DEPOT_TOOLS_DIR%;%PATH% - # CMake + # CMake - cmake --version build: @@ -97,7 +96,9 @@ build_script: -DDIST_ROOT="%CMAKE_DIST_DIR%/%APPVEYOR_BUILD_WORKER_IMAGE%" -DENABLE_TESTS=%TESTING% .. - - cmake --build . --config %CONFIGURATION% --target install + + - if "%GENERATOR%"" == "Ninja" ( autoninja install ) + else ( cmake --build . --config %CONFIGURATION% --target install ) after_build: - cd %DIST_DIR% From 20bf5d4c00154837070cf5166fafe055457ff8e9 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 16:21:07 -0700 Subject: [PATCH 24/95] optimize --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0a9f1d1..471fc35 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -74,7 +74,7 @@ install: - if not exist %DEPOT_TOOLS_DIR%\ mkdir %DEPOT_TOOLS_DIR% - cd %DEPOT_TOOLS_DIR% - - if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip + - if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip ) - 7z x depot_tools.zip - set PATH=%DEPOT_TOOLS_DIR%;%PATH% @@ -97,7 +97,7 @@ build_script: -DENABLE_TESTS=%TESTING% .. - - if "%GENERATOR%"" == "Ninja" ( autoninja install ) + - if "%GENERATOR%" == "Ninja" ( autoninja install ) else ( cmake --build . --config %CONFIGURATION% --target install ) after_build: From 431c69d9f67eb9c58b68a142feffc3eaa91c4d2a Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 16:37:06 -0700 Subject: [PATCH 25/95] optimize --- appveyor.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 471fc35..13c3b84 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,12 +22,12 @@ environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - PLATFORM: amd64_x86 + PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' - ARCHITECTURE: + ARCHITECTURE: amd64_x86 ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' - TESTING: OFF + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: x64 @@ -35,7 +35,7 @@ environment: ARCHITECTURE: amd64 ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: OFF + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' PLATFORM: ARM @@ -50,14 +50,14 @@ environment: VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat' ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: OFF + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: OFF + TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' PLATFORM: ARM @@ -71,12 +71,14 @@ init: install: # Depot Tools - - if not exist %DEPOT_TOOLS_DIR%\ mkdir %DEPOT_TOOLS_DIR% + - if "%GENERATOR%"=="Ninja" ( + if not exist %DEPOT_TOOLS_DIR%\ mkdir %DEPOT_TOOLS_DIR% - - cd %DEPOT_TOOLS_DIR% - - if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip ) - - 7z x depot_tools.zip - - set PATH=%DEPOT_TOOLS_DIR%;%PATH% + cd %DEPOT_TOOLS_DIR% + if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip ) + 7z x depot_tools.zip + set PATH=%DEPOT_TOOLS_DIR%;%PATH% + ) # CMake - cmake --version @@ -85,7 +87,7 @@ build: parallel: true build_script: - - if exist "%VCVARSALL%" call "%VCVARSALL%" %ARCHITECTURE% + - if exist "%VCVARSALL%" ( call "%VCVARSALL%" %ARCHITECTURE% ) - cd %APPVEYOR_BUILD_FOLDER% - mkdir build @@ -97,7 +99,7 @@ build_script: -DENABLE_TESTS=%TESTING% .. - - if "%GENERATOR%" == "Ninja" ( autoninja install ) + - if "%GENERATOR%" == "Ninja" ( autoninja install ) else ( cmake --build . --config %CONFIGURATION% --target install ) after_build: From 4482a508de38f53036911aca737ed2beff71836f Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 16:38:49 -0700 Subject: [PATCH 26/95] optimize --- appveyor.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 13c3b84..0bfaab2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -71,14 +71,11 @@ init: install: # Depot Tools - - if "%GENERATOR%"=="Ninja" ( - if not exist %DEPOT_TOOLS_DIR%\ mkdir %DEPOT_TOOLS_DIR% - - cd %DEPOT_TOOLS_DIR% - if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip ) - 7z x depot_tools.zip - set PATH=%DEPOT_TOOLS_DIR%;%PATH% - ) + - if "%GENERATOR%"=="Ninja" ( if not exist %DEPOT_TOOLS_DIR%\ ( mkdir %DEPOT_TOOLS_DIR% )) + - if "%GENERATOR%"=="Ninja" ( cd %DEPOT_TOOLS_DIR% ) + - if "%GENERATOR%"=="Ninja" ( if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip )) + - if "%GENERATOR%"=="Ninja" ( 7z x depot_tools.zip ) + - if "%GENERATOR%"=="Ninja" ( set PATH=%DEPOT_TOOLS_DIR%;%PATH% ) # CMake - cmake --version From 1a72e838cc06825c4296e24981e80640b5f8ffed Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 16:42:18 -0700 Subject: [PATCH 27/95] optimize --- appveyor.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0bfaab2..26e049a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -71,11 +71,11 @@ init: install: # Depot Tools - - if "%GENERATOR%"=="Ninja" ( if not exist %DEPOT_TOOLS_DIR%\ ( mkdir %DEPOT_TOOLS_DIR% )) - - if "%GENERATOR%"=="Ninja" ( cd %DEPOT_TOOLS_DIR% ) - - if "%GENERATOR%"=="Ninja" ( if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip )) - - if "%GENERATOR%"=="Ninja" ( 7z x depot_tools.zip ) - - if "%GENERATOR%"=="Ninja" ( set PATH=%DEPOT_TOOLS_DIR%;%PATH% ) + - if not exist %DEPOT_TOOLS_DIR%\ ( mkdir %DEPOT_TOOLS_DIR% ) + - cd %DEPOT_TOOLS_DIR% + - if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip ) + - 7z x depot_tools.zip + - set PATH=%DEPOT_TOOLS_DIR%;%PATH% # CMake - cmake --version From 95e03e39fc50d6b5ab4dd32689aacafec304c97b Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 16:45:02 -0700 Subject: [PATCH 28/95] optimize --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 26e049a..4547a5a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -113,6 +113,6 @@ before_test: - set PATH=%APPVEYOR_BUILD_FOLDER%\build;%PATH% test_script: - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ cd %APPVEYOR_BUILD_FOLDER%\build\tests - - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -V + #- if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -V after_test: # TODO process CTest output From 9e84b533eaa48e88d2a9fde024c9bd0a597627c6 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 17:06:57 -0700 Subject: [PATCH 29/95] optimize --- appveyor.yml | 20 +++++++------------- tests/CMakeLists.txt | 7 +++++-- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4547a5a..5dc08fa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,47 +22,41 @@ environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' ARCHITECTURE: amd64_x86 - ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' ARCHITECTURE: amd64 - ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + ARCHIVE: VS2015_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - PLATFORM: ARM VCVARSALL: - ARCHIVE: VS2015_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + ARCHIVE: VS2015_%CONFIGURATION%_ARM_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'Visual Studio 14 2015 ARM' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - PLATFORM: x86 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat' - ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + ARCHIVE: VS2017_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - PLATFORM: x64 VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' - ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + ARCHIVE: VS2017_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja TESTING: ON - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - PLATFORM: ARM VCVARSALL: - ARCHIVE: VS2017_%CONFIGURATION%_%PLATFORM%_%APPVEYOR_BUILD_NUMBER% + ARCHIVE: VS2017_%CONFIGURATION%_ARM_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'Visual Studio 15 2017 ARM' TESTING: OFF @@ -113,6 +107,6 @@ before_test: - set PATH=%APPVEYOR_BUILD_FOLDER%\build;%PATH% test_script: - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ cd %APPVEYOR_BUILD_FOLDER%\build\tests - #- if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -V + - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -V after_test: # TODO process CTest output diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a5a772f..fc8e7fd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,10 +15,13 @@ macro(add_testcase test type def) set(lib_lib libpthread${type}${PTW32_VER}) set(dll_lib pthread${type}${PTW32_VER}) - set(extra "") + set(c_dep "") if(${test} MATCHES "benchtest") set(c_dep "benchlib.c") - elseif(${test} MATCHES "openmp1") + endif() + + set(extra "") + if(${test} MATCHES "openmp1") if(MSVC) set(extra "/openmp -D_OPENMP") endif() From a28f657f8760805610157ac35fde507872945ef9 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 19:49:17 -0700 Subject: [PATCH 30/95] remove vs solution --- appveyor.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5dc08fa..28a3381 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,19 +26,20 @@ environment: ARCHITECTURE: amd64_x86 ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% GENERATOR: 'NMake Makefiles' - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' ARCHITECTURE: amd64 ARCHIVE: VS2015_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' - VCVARSALL: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + ARCHITECTURE: amd64_arm ARCHIVE: VS2015_%CONFIGURATION%_ARM_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'Visual Studio 14 2015 ARM' + GENERATOR: Ninja TESTING: OFF @@ -46,18 +47,24 @@ environment: VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat' ARCHIVE: VS2017_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' ARCHIVE: VS2017_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% GENERATOR: Ninja - TESTING: ON + TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - VCVARSALL: + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat' ARCHIVE: VS2017_%CONFIGURATION%_ARM_%APPVEYOR_BUILD_NUMBER% - GENERATOR: 'Visual Studio 15 2017 ARM' + GENERATOR: Ninja + TESTING: OFF + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat' + ARCHIVE: VS2017_%CONFIGURATION%_ARM64_%APPVEYOR_BUILD_NUMBER% + GENERATOR: Ninja TESTING: OFF init: From f2e6418bada9d4cd7266e62cefce73561fbf59a9 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 19:51:31 -0700 Subject: [PATCH 31/95] flags for arm cmd line --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index debca71..4e794ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,9 +32,9 @@ include (target_arch) get_target_arch(TARGET_ARCH) if(${TARGET_ARCH} STREQUAL "ARM") - add_definitions(-D__PTW32_ARCHARM) + add_definitions(-D__PTW32_ARCHARM -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) elseif(${TARGET_ARCH} STREQUAL "ARM64") - add_definitions(-D__PTW32_ARCHARM64) + add_definitions(-D__PTW32_ARCHARM64 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) elseif(${TARGET_ARCH} STREQUAL "x86_64") add_definitions(-D__PTW32_ARCHAMD64) elseif(${TARGET_ARCH} STREQUAL "x86") From 6b68925f8367c6ee4b0c80d4108ca3a0d7ce6fe3 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 20:11:43 -0700 Subject: [PATCH 32/95] save build cache on fail --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 28a3381..c538eec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: 3.0.1.{build} cache: - - C:\Tools\depot_tools\depot_tools.zip + - C:\Tools\depot_tools -> appveyor.yml shallow_clone: true clone_depth: 1 @@ -19,6 +19,8 @@ environment: DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' CMAKE_DIST_DIR: C:/projects/pthreads4w/dist DEPOT_TOOLS_DIR: C:\Tools\depot_tools + APPVEYOR_SAVE_CACHE_ON_ERROR: true + matrix: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' From 0c040bc2deccd91f680fa7b66fb26334aca2c676 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 20:16:45 -0700 Subject: [PATCH 33/95] version info for ARM64 --- appveyor.yml | 2 +- cmake/version.rc.in | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index c538eec..a40c5f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -76,7 +76,7 @@ install: # Depot Tools - if not exist %DEPOT_TOOLS_DIR%\ ( mkdir %DEPOT_TOOLS_DIR% ) - cd %DEPOT_TOOLS_DIR% - - if not exist %DEPOT_TOOLS_DIR%\depot_tools.zip ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip ) + - if not exist %DEPOT_TOOLS_DIR%\autoninja.bat ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip ) - 7z x depot_tools.zip - set PATH=%DEPOT_TOOLS_DIR%;%PATH% diff --git a/cmake/version.rc.in b/cmake/version.rc.in index 0afaa8d..0e41fcb 100644 --- a/cmake/version.rc.in +++ b/cmake/version.rc.in @@ -74,6 +74,17 @@ # define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" # define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH ARM\0" # endif +# elif defined (__PTW32_ARCHARM64) || defined (__PTW32_ARCHARM64) +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadVC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C ARM64\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadVCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ ARM64\0" +# elif defined(__PTW32_CLEANUP_SEH) +# define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH ARM64\0" +# endif # endif #elif defined(__GNUC__) # if defined(_M_X64) From a538ba3b739ad8651afe687bae3d3c71bde5c6b2 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 9 Oct 2018 20:37:18 -0700 Subject: [PATCH 34/95] final matrix --- appveyor.yml | 45 +++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a40c5f1..2810968 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,5 @@ version: 3.0.1.{build} -cache: - - C:\Tools\depot_tools -> appveyor.yml - shallow_clone: true clone_depth: 1 @@ -18,7 +15,6 @@ configuration: environment: DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' CMAKE_DIST_DIR: C:/projects/pthreads4w/dist - DEPOT_TOOLS_DIR: C:\Tools\depot_tools APPVEYOR_SAVE_CACHE_ON_ERROR: true matrix: @@ -34,51 +30,45 @@ environment: VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' ARCHITECTURE: amd64 ARCHIVE: VS2015_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' ARCHITECTURE: amd64_arm ARCHIVE: VS2015_%CONFIGURATION%_ARM_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: OFF - - - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat' - ARCHIVE: VS2017_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF - - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' - VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' - ARCHIVE: VS2017_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja - TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat' ARCHIVE: VS2017_%CONFIGURATION%_ARM_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat' ARCHIVE: VS2017_%CONFIGURATION%_ARM64_%APPVEYOR_BUILD_NUMBER% - GENERATOR: Ninja + GENERATOR: 'NMake Makefiles' TESTING: OFF + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat' + ARCHIVE: VS2017_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: ON + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' + ARCHIVE: VS2017_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: ON + init: - echo BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% install: - # Depot Tools - - if not exist %DEPOT_TOOLS_DIR%\ ( mkdir %DEPOT_TOOLS_DIR% ) - - cd %DEPOT_TOOLS_DIR% - - if not exist %DEPOT_TOOLS_DIR%\autoninja.bat ( appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip ) - - 7z x depot_tools.zip - - set PATH=%DEPOT_TOOLS_DIR%;%PATH% # CMake - cmake --version @@ -99,8 +89,7 @@ build_script: -DENABLE_TESTS=%TESTING% .. - - if "%GENERATOR%" == "Ninja" ( autoninja install ) - else ( cmake --build . --config %CONFIGURATION% --target install ) + cmake --build . --config %CONFIGURATION% --target install after_build: - cd %DIST_DIR% From aa300b8c83e47a67684ed748dd3875688c397add Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:00:44 -0700 Subject: [PATCH 35/95] travis-ci --- .travis.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8cefbb2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,42 @@ +language: c + +os: + - windows + +env: + - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat" TESTING=OFF + - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat" TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat TESTING=OFF + + - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF + - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat TESTING=OFF + + - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" TESTING=OFF + - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat TESTING=OFF + + - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF + - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat TESTING=OFF + +before_script: + - cmake --version + - call ${VCVARSALL} + - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build + - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + -DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} + -DDIST_ROOT="${TRAVIS_BUILD_DIR}/build/dist" + -DENABLE_TESTS=${TESTING} + .. +script: + - cmake --build . --config ${BUILD_TYPE} --target install + +addons: + coverity_scan: + project: + name: ā€œjwinarske/pthreads4w" + notification_email: joel.winarske@gmail.com + build_command_prepend: "mkdir build && cd build && cmake -DCMAKE_VERBOSE_MAKEFILE=TRUE -DDCMAKE_INSTALL_PREFIX=`pwd`/dist .." + build_command: "cmake --build . --target install" + branch_pattern: coverity_scan From ebc98dbe90661bf60dd4e582cbc3586be50a48cc Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:04:59 -0700 Subject: [PATCH 36/95] travis1 --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8cefbb2..d63430c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ -language: c +language: shell -os: - - windows +os: windows env: - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat" TESTING=OFF From ae72139a1ca9892841585328ddfbbcfbffa6e6ad Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:11:49 -0700 Subject: [PATCH 37/95] travis2 --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index d63430c..1ad24f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,16 @@ env: - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat TESTING=OFF +install: + - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" + - mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && pwd + - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip +# - echo "96d67e21f0983ebf0fffc5b106ec338c *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt +# - md5sum -c cmake_md5.txt + - tar -xvf cmake-3.11.0-win64-x64.zip > /dev/null + - mv cmake-3.11.0-win64-x64 cmake-install + - PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH + before_script: - cmake --version - call ${VCVARSALL} From 204badfeb4626973bdfca107ed74e07f28fb1902 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:16:50 -0700 Subject: [PATCH 38/95] travis3 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ad24f6..72e989b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,8 @@ install: - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip # - echo "96d67e21f0983ebf0fffc5b106ec338c *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt # - md5sum -c cmake_md5.txt - - tar -xvf cmake-3.11.0-win64-x64.zip > /dev/null - - mv cmake-3.11.0-win64-x64 cmake-install + - 7z x -y -ocmake-install + - ls cmake-install - PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH before_script: From b00bd3c93375b5b39493fa4ce2f530955ff61a62 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:19:31 -0700 Subject: [PATCH 39/95] travis4 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 72e989b..acbfec1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ install: - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip # - echo "96d67e21f0983ebf0fffc5b106ec338c *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt # - md5sum -c cmake_md5.txt - - 7z x -y -ocmake-install + - 7z x -y cmake-3.11.0-win64-x64.zip -o"cmake-install" - ls cmake-install - PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH From 21a878bbc9024b5a6b8eea18e757f16b78fdf063 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:23:12 -0700 Subject: [PATCH 40/95] travis5 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index acbfec1..c51fbed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,9 +25,9 @@ install: - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip # - echo "96d67e21f0983ebf0fffc5b106ec338c *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt # - md5sum -c cmake_md5.txt - - 7z x -y cmake-3.11.0-win64-x64.zip -o"cmake-install" - - ls cmake-install - - PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH + - 7z x -y cmake-3.11.0-win64-x64.zip + - ls cmake-3.11.0-win64-x64 + - PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH before_script: - cmake --version From 2fcd1e20c3cd1ab9d46f56eea76b42b649feda51 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:27:54 -0700 Subject: [PATCH 41/95] travis6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c51fbed..ce6c313 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ install: before_script: - cmake --version - - call ${VCVARSALL} + - ${VCVARSALL} - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} From 65ab7338ffd084a16f2fbf9e03e300939b09756f Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:31:16 -0700 Subject: [PATCH 42/95] travis7 --- .travis.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce6c313..d1eb29f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,17 +7,17 @@ env: - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat" TESTING=OFF - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat TESTING=OFF - - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF - - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat TESTING=OFF +# - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF +# - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF +# - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat TESTING=OFF - - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" TESTING=OFF - - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat TESTING=OFF +# - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" TESTING=OFF +# - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" TESTING=OFF +# - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat TESTING=OFF - - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF - - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat TESTING=OFF +# - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF +# - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF +# - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat TESTING=OFF install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" @@ -26,12 +26,11 @@ install: # - echo "96d67e21f0983ebf0fffc5b106ec338c *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt # - md5sum -c cmake_md5.txt - 7z x -y cmake-3.11.0-win64-x64.zip - - ls cmake-3.11.0-win64-x64 - PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH before_script: - cmake --version - - ${VCVARSALL} + #- ${VCVARSALL} - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} From 0a1e821ab927c856f1028673f4245e3ade2e2183 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sun, 14 Oct 2018 22:33:18 -0700 Subject: [PATCH 43/95] travis8 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d1eb29f..26a437e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,8 +29,9 @@ install: - PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH before_script: + - start clean - cmake --version - #- ${VCVARSALL} + - call ${VCVARSALL} - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} From 09ff86a2a6f71edfe4a42cba0a19b6556b88b50e Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 09:11:34 -0700 Subject: [PATCH 44/95] power shell --- .travis.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26a437e..dad368b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ language: shell os: windows env: - - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat" TESTING=OFF - - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat" TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat TESTING=OFF + - BUILD_TYPE=Debug VCVARS="vcvarsamd64_arm" TESTING=OFF + - BUILD_TYPE=Release VCVARS="vcvarsamd64_arm" TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARS="vcvarsamd64_arm TESTING=OFF # - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF # - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF @@ -23,15 +23,27 @@ install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && pwd - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip -# - echo "96d67e21f0983ebf0fffc5b106ec338c *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt -# - md5sum -c cmake_md5.txt + - if ($(CertUtil -hashfile cmake-3.11.0-win64-x64.zip MD5)[1] -replace " ","" -ne "615dfb0813443c1ff56ae0e9d6dbfc61") { throw "MD5 Mis-Match!" } - 7z x -y cmake-3.11.0-win64-x64.zip - PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH before_script: - - start clean + + # document the version - cmake --version - - call ${VCVARSALL} + + # set enviromental variables + - pushd ${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build + - cmd /c "${VCVARS}.bat&set" | + - foreach { + - if ($_ -match "=") { + - $v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" + - } + - } + - popd + - Write-Host "`nVisual Studio 2017 (${VCVARS}) Command Prompt variables set." -ForegroundColor Yellow + + # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} From fd2f8d45464a14e1dd922974d096bb64f937e044 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 09:15:59 -0700 Subject: [PATCH 45/95] power shell --- .travis.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index dad368b..d75675c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,14 +34,9 @@ before_script: # set enviromental variables - pushd ${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build - - cmd /c "${VCVARS}.bat&set" | - - foreach { - - if ($_ -match "=") { - - $v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" - - } - - } + - cmd /c "${VCVARS}.bat&set" | foreach { if ($_ -match "=") { $v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" } } - popd - - Write-Host "`nVisual Studio 2017 (${VCVARS}) Command Prompt variables set." -ForegroundColor Yellow + - Write-Host "Visual Studio 2017 (${VCVARS}) Command Prompt variables set." -ForegroundColor Yellow # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 5653ba83589b58b8a0771ab78dfe8e540e76b9fd Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 09:27:28 -0700 Subject: [PATCH 46/95] power shell --- .travis.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index d75675c..c333e80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -language: shell +language: generic os: windows @@ -23,30 +23,30 @@ install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && pwd - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip - - if ($(CertUtil -hashfile cmake-3.11.0-win64-x64.zip MD5)[1] -replace " ","" -ne "615dfb0813443c1ff56ae0e9d6dbfc61") { throw "MD5 Mis-Match!" } - - 7z x -y cmake-3.11.0-win64-x64.zip - - PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH + - PowerShell -Command { if ($(CertUtil -hashfile cmake-3.11.0-win64-x64.zip MD5)[1] -replace " ","" -ne "615dfb0813443c1ff56ae0e9d6dbfc61") { throw "MD5 Mis-Match!" } } + - PowerShell -Command { 7z x -y cmake-3.11.0-win64-x64.zip } + - PowerShell -Command { PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH } before_script: # document the version - - cmake --version + - PowerShell -Command { cmake --version } # set enviromental variables - - pushd ${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build - - cmd /c "${VCVARS}.bat&set" | foreach { if ($_ -match "=") { $v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" } } - - popd - - Write-Host "Visual Studio 2017 (${VCVARS}) Command Prompt variables set." -ForegroundColor Yellow + - PowerShell -Command { pushd ${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build } + - PowerShell -Command { cmd /c "${VCVARS}.bat&set" | foreach { if ($_ -match "=") { $v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" } } } + - PowerShell -Command { popd } + - PowerShell -Command { Write-Host "Visual Studio 2017 (${VCVARS}) Command Prompt variables set." -ForegroundColor Yellow } # generate the build files - - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build - - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + - PowerShell -Command { cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build } + - PowerShell -Command { cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} -DDIST_ROOT="${TRAVIS_BUILD_DIR}/build/dist" -DENABLE_TESTS=${TESTING} - .. + .. } script: - - cmake --build . --config ${BUILD_TYPE} --target install + - PowerShell -Command { cmake --build . --config ${BUILD_TYPE} --target install } addons: coverity_scan: From 292acb644ba464e8315f8eea889ab29d68a01210 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 10:35:34 -0700 Subject: [PATCH 47/95] test --- .travis.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index c333e80..9110726 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,30 +23,27 @@ install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && pwd - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip - - PowerShell -Command { if ($(CertUtil -hashfile cmake-3.11.0-win64-x64.zip MD5)[1] -replace " ","" -ne "615dfb0813443c1ff56ae0e9d6dbfc61") { throw "MD5 Mis-Match!" } } - - PowerShell -Command { 7z x -y cmake-3.11.0-win64-x64.zip } - - PowerShell -Command { PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH } + #- PowerShell -Command { if ($(CertUtil -hashfile cmake-3.11.0-win64-x64.zip MD5)[1] -replace " ","" -ne "615dfb0813443c1ff56ae0e9d6dbfc61") { throw "MD5 Mis-Match!" } } + - 7z x -y cmake-3.11.0-win64-x64.zip + - PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH before_script: # document the version - - PowerShell -Command { cmake --version } + - cmake --version # set enviromental variables - - PowerShell -Command { pushd ${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build } - - PowerShell -Command { cmd /c "${VCVARS}.bat&set" | foreach { if ($_ -match "=") { $v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" } } } - - PowerShell -Command { popd } - - PowerShell -Command { Write-Host "Visual Studio 2017 (${VCVARS}) Command Prompt variables set." -ForegroundColor Yellow } + - "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" # generate the build files - - PowerShell -Command { cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build } - - PowerShell -Command { cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build + - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} -DDIST_ROOT="${TRAVIS_BUILD_DIR}/build/dist" -DENABLE_TESTS=${TESTING} - .. } + .. script: - - PowerShell -Command { cmake --build . --config ${BUILD_TYPE} --target install } + - cmake --build . --config ${BUILD_TYPE} --target install addons: coverity_scan: From 7def33e6e029b1af8c3412bb9775b71c1c99c48f Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 11:19:13 -0700 Subject: [PATCH 48/95] travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9110726..c32a625 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -language: generic +language: shell os: windows From 55b9ad23737edc7b6de99f9ccf34b7fee7499346 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 11:26:11 -0700 Subject: [PATCH 49/95] travis1 --- .travis.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index c32a625..d6b9f58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,27 +3,28 @@ language: shell os: windows env: - - BUILD_TYPE=Debug VCVARS="vcvarsamd64_arm" TESTING=OFF - - BUILD_TYPE=Release VCVARS="vcvarsamd64_arm" TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARS="vcvarsamd64_arm TESTING=OFF + - BUILD_TYPE=Debug VCVARS=vcvarsamd64_arm TESTING=OFF + - BUILD_TYPE=Release VCVARS=vcvarsamd64_arm TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARS=vcvarsamd64_arm TESTING=OFF -# - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF -# - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" TESTING=OFF -# - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat TESTING=OFF + - BUILD_TYPE=Debug VCVARS=vcvarsamd64_arm64 TESTING=OFF + - BUILD_TYPE=Release VCVARS=vcvarsamd64_arm64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARS=vcvarsamd64_arm64 TESTING=OFF -# - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" TESTING=OFF -# - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" TESTING=OFF -# - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat TESTING=OFF + - BUILD_TYPE=Debug VCVARS=vcvars32 TESTING=OFF + - BUILD_TYPE=Release VCVARS=vcvars32 TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARS=vcvars32 TESTING=OFF -# - BUILD_TYPE=Debug VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF -# - BUILD_TYPE=Release VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" TESTING=OFF -# - BUILD_TYPE=MinSizeRel VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat TESTING=OFF + - BUILD_TYPE=Debug VCVARS=vcvars64 TESTING=OFF + - BUILD_TYPE=Release VCVARS=vcvars64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VCVARS=vcvars64 TESTING=OFF install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && pwd - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip - #- PowerShell -Command { if ($(CertUtil -hashfile cmake-3.11.0-win64-x64.zip MD5)[1] -replace " ","" -ne "615dfb0813443c1ff56ae0e9d6dbfc61") { throw "MD5 Mis-Match!" } } + - echo "615dfb0813443c1ff56ae0e9d6dbfc61 *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt + - md5sum -c cmake_md5.txt - 7z x -y cmake-3.11.0-win64-x64.zip - PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH From ca31685d345ac85833e2a37211b5755d58871a4e Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 11:37:20 -0700 Subject: [PATCH 50/95] travis2 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index d6b9f58..a57fb29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,8 @@ before_script: - cmake --version # set enviromental variables + - ls /c + - ls /c/Progra~2 - "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" # generate the build files From 928a30d157a4a2ac5a78213a4bc521c4bc38bec9 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 11:43:40 -0700 Subject: [PATCH 51/95] travis2 --- .travis.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a57fb29..3c5d215 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,8 +35,16 @@ before_script: # set enviromental variables - ls /c - - ls /c/Progra~2 - - "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" + - echo "1" + - ls "/c/Progra~2/Microsoft\ Visual\ Studio" > null + - echo "2" + - ls "/c/Progra~2/Microsoft\ Visual\ Studio\ 14.0" > null + - echo "3" + - ls "/c/Progra~2/Microsoft Visual Studio" > null + - echo "4" + - ls "/c/Progra~2/Microsoft Visual Studio 14.0" > null + + - "/c/Progra~2/Microsoft\ Visual\ Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 9cdbacfc44d6a9b82337db26f9908e78f9053963 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 11:49:24 -0700 Subject: [PATCH 52/95] travis3 --- .travis.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c5d215..140661c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,15 +35,17 @@ before_script: # set enviromental variables - ls /c + - echo "1" - - ls "/c/Progra~2/Microsoft\ Visual\ Studio" > null + - ls "/c/Progra~2/Microsoft\ Visual\ Studio" + - echo "2" - - ls "/c/Progra~2/Microsoft\ Visual\ Studio\ 14.0" > null - - echo "3" - - ls "/c/Progra~2/Microsoft Visual Studio" > null - - echo "4" - - ls "/c/Progra~2/Microsoft Visual Studio 14.0" > null + - ls "/c/Progra~2/Microsoft\ Visual\ Studio/2017" + - echo "3" + - ls "/c/Progra~2/Microsoft\ Visual\ Studio/2017/Community/VC/Auxiliary/Build" + + - echo "${VCVARS}" - "/c/Progra~2/Microsoft\ Visual\ Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" # generate the build files From c876bd27f8c858bf0b518c375cd5f608ec9cec6e Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 11:54:01 -0700 Subject: [PATCH 53/95] trav --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 140661c..63b24bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,16 +37,16 @@ before_script: - ls /c - echo "1" - - ls "/c/Progra~2/Microsoft\ Visual\ Studio" + - ls "/c/Progra~2" - echo "2" - - ls "/c/Progra~2/Microsoft\ Visual\ Studio/2017" + - ls "/c/Progra~2/Microsoft Visual Studio" - echo "3" - - ls "/c/Progra~2/Microsoft\ Visual\ Studio/2017/Community/VC/Auxiliary/Build" + - ls "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build" - echo "${VCVARS}" - - "/c/Progra~2/Microsoft\ Visual\ Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" + - "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From ac78f95a2cbe5eb4d015e9bbf86a6b267df06777 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:00:30 -0700 Subject: [PATCH 54/95] trav1 --- .travis.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 63b24bc..8c191be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,17 +36,13 @@ before_script: # set enviromental variables - ls /c - - echo "1" - - ls "/c/Progra~2" + - ls "/c/Progra~2/Microsoft Visual Studio 14.0" + - ls "/c/Progra~2/Microsoft Visual Studio/2017" - - echo "2" - - ls "/c/Progra~2/Microsoft Visual Studio" + - tree "/c/Progra~2/Microsoft Visual Studio 14.0" + - tree "/c/Progra~2/Microsoft Visual Studio/2017" - - echo "3" - - ls "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build" - - - echo "${VCVARS}" - - "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" + #- "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From dc20c2bdd4b6ada6814ab152bdd09b28e71b10b2 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:05:25 -0700 Subject: [PATCH 55/95] trav2 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c191be..2d9ab00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,11 +36,11 @@ before_script: # set enviromental variables - ls /c - - ls "/c/Progra~2/Microsoft Visual Studio 14.0" - ls "/c/Progra~2/Microsoft Visual Studio/2017" + - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools" - - tree "/c/Progra~2/Microsoft Visual Studio 14.0" - - tree "/c/Progra~2/Microsoft Visual Studio/2017" + - ls "/c/Progra~2/Microsoft Visual Studio 14.0" + - ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC" #- "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" From a6b031b3a41be89441d9d0ec740f51b39afd463d Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:10:48 -0700 Subject: [PATCH 56/95] trav3 --- .travis.yml | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d9ab00..087d34b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,21 +3,17 @@ language: shell os: windows env: - - BUILD_TYPE=Debug VCVARS=vcvarsamd64_arm TESTING=OFF - - BUILD_TYPE=Release VCVARS=vcvarsamd64_arm TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARS=vcvarsamd64_arm TESTING=OFF + - BUILD_TYPE=Debug ARCH=amd64_x86 TESTING=OFF + - BUILD_TYPE=Release ARCH=amd64_x86 TESTING=OFF + - BUILD_TYPE=MinSizeRel ARCH=amd64_x86 TESTING=OFF - - BUILD_TYPE=Debug VCVARS=vcvarsamd64_arm64 TESTING=OFF - - BUILD_TYPE=Release VCVARS=vcvarsamd64_arm64 TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARS=vcvarsamd64_arm64 TESTING=OFF + - BUILD_TYPE=Debug ARCH=amd64 TESTING=OFF + - BUILD_TYPE=Release ARCH=amd64 TESTING=OFF + - BUILD_TYPE=MinSizeRel ARCH=amd64 TESTING=OFF - - BUILD_TYPE=Debug VCVARS=vcvars32 TESTING=OFF - - BUILD_TYPE=Release VCVARS=vcvars32 TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARS=vcvars32 TESTING=OFF - - - BUILD_TYPE=Debug VCVARS=vcvars64 TESTING=OFF - - BUILD_TYPE=Release VCVARS=vcvars64 TESTING=OFF - - BUILD_TYPE=MinSizeRel VCVARS=vcvars64 TESTING=OFF + - BUILD_TYPE=Debug ARCH=amd64_arm TESTING=OFF + - BUILD_TYPE=Release ARCH=amd64_arm TESTING=OFF + - BUILD_TYPE=MinSizeRel ARCH=amd64_arm TESTING=OFF install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" @@ -34,15 +30,8 @@ before_script: - cmake --version # set enviromental variables - - ls /c - - - ls "/c/Progra~2/Microsoft Visual Studio/2017" - - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools" - - - ls "/c/Progra~2/Microsoft Visual Studio 14.0" - - ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC" - - #- "/c/Progra~2/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/${VCVARS}.bat" + - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC" + - "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat ${ARCH}.bat" # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 3a1170aacb7a659aae5fadccb226daf2e621f00c Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:16:15 -0700 Subject: [PATCH 57/95] trav4 --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 087d34b..26451ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,9 @@ before_script: # set enviromental variables - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC" - - "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat ${ARCH}.bat" + + # Visual Studio 2015 + - "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat ${ARCH}" # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 4b435d668b87fae93596c533b96193eb7df6db5c Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:28:06 -0700 Subject: [PATCH 58/95] trav5 --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26451ba..0f8161b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,17 @@ language: shell os: windows env: - - BUILD_TYPE=Debug ARCH=amd64_x86 TESTING=OFF - - BUILD_TYPE=Release ARCH=amd64_x86 TESTING=OFF - - BUILD_TYPE=MinSizeRel ARCH=amd64_x86 TESTING=OFF + #- BUILD_TYPE=Debug ARCH=amd64_x86 TESTING=OFF + #- BUILD_TYPE=Release ARCH=amd64_x86 TESTING=OFF + #- BUILD_TYPE=MinSizeRel ARCH=amd64_x86 TESTING=OFF - BUILD_TYPE=Debug ARCH=amd64 TESTING=OFF - BUILD_TYPE=Release ARCH=amd64 TESTING=OFF - BUILD_TYPE=MinSizeRel ARCH=amd64 TESTING=OFF - - BUILD_TYPE=Debug ARCH=amd64_arm TESTING=OFF - - BUILD_TYPE=Release ARCH=amd64_arm TESTING=OFF - - BUILD_TYPE=MinSizeRel ARCH=amd64_arm TESTING=OFF + #- BUILD_TYPE=Debug ARCH=amd64_arm TESTING=OFF + #- BUILD_TYPE=Release ARCH=amd64_arm TESTING=OFF + #- BUILD_TYPE=MinSizeRel ARCH=amd64_arm TESTING=OFF install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" @@ -31,9 +31,9 @@ before_script: # set enviromental variables - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC" - + # Visual Studio 2015 - - "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat ${ARCH}" + - "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat amd64" # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 0adff244a0140def882139d7e3679b7fed254c28 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:38:52 -0700 Subject: [PATCH 59/95] trav6 --- .travis.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0f8161b..bcca7b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,15 @@ language: shell os: windows env: + - BUILD_TYPE=Debug VS2017=amd64_x86 ARCH=amd64 TESTING=OFF + - BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF + #- BUILD_TYPE=Debug ARCH=amd64_x86 TESTING=OFF #- BUILD_TYPE=Release ARCH=amd64_x86 TESTING=OFF #- BUILD_TYPE=MinSizeRel ARCH=amd64_x86 TESTING=OFF - - BUILD_TYPE=Debug ARCH=amd64 TESTING=OFF - - BUILD_TYPE=Release ARCH=amd64 TESTING=OFF - - BUILD_TYPE=MinSizeRel ARCH=amd64 TESTING=OFF - #- BUILD_TYPE=Debug ARCH=amd64_arm TESTING=OFF #- BUILD_TYPE=Release ARCH=amd64_arm TESTING=OFF #- BUILD_TYPE=MinSizeRel ARCH=amd64_arm TESTING=OFF @@ -30,10 +31,11 @@ before_script: - cmake --version # set enviromental variables - - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC" + - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/" + - "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/${VS2017}.bat" # Visual Studio 2015 - - "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat amd64" + #- "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat amd64" # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 6dc64aedaa5049812a84a6c75b91212913caf550 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:45:59 -0700 Subject: [PATCH 60/95] trav7 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bcca7b2..81bb257 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,10 +32,11 @@ before_script: # set enviromental variables - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/" - - "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/${VS2017}.bat" + - "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars${VS2017}.bat" # Visual Studio 2015 - #- "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat amd64" + - ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC/" + - "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" amd64 # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 4bbd6f15c05c4129caea68a297d31a9ae83c6644 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:48:09 -0700 Subject: [PATCH 61/95] trav8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 81bb257..b22c4d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ before_script: # Visual Studio 2015 - ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC/" - - "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" amd64 + #- "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" amd64 # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 3d35ec831f6ff15dad540e93429b7c13e8b61d14 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:53:28 -0700 Subject: [PATCH 62/95] trav9 --- .travis.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b22c4d1..8f67e44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,22 @@ before_script: # set enviromental variables - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/" - - "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars${VS2017}.bat" + #vcvars32.bat + #vcvars64.bat + #vcvarsall.bat + #vcvarsamd64_arm.bat + #vcvarsamd64_arm64.bat + #vcvarsamd64_x86.bat + #vcvarsx86_amd64.bat + #vcvarsx86_arm.bat + #vcvarsx86_arm64.bat + + #vcvars64.bat + #vcvarsamd64_x86.bat + #vcvarsamd64_arm.bat + #vcvarsamd64_arm64.bat + - "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars64.bat" + # Visual Studio 2015 - ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC/" From b0726e481bd53059ecda0f537dd5779cb9c1948e Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 12:57:10 -0700 Subject: [PATCH 63/95] trav10 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8f67e44..7beb2a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ before_script: #vcvarsamd64_x86.bat #vcvarsamd64_arm.bat #vcvarsamd64_arm64.bat - - "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars64.bat" + - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars64.bat # Visual Studio 2015 From 1eddb6fc7435edd3e1b8a5f44e51dd13ed55e70c Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 13:09:27 -0700 Subject: [PATCH 64/95] trav11 --- .travis.yml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7beb2a7..5f43193 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,18 +3,25 @@ language: shell os: windows env: - - BUILD_TYPE=Debug VS2017=amd64_x86 ARCH=amd64 TESTING=OFF + - BUILD_TYPE=Debug VS2017=64 TESTING=OFF + - BUILD_TYPE=Release VS2017=64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=64 TESTING=OFF + + - BUILD_TYPE=Debug VS2017=amd64_x86 TESTING=OFF - BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF - #- BUILD_TYPE=Debug ARCH=amd64_x86 TESTING=OFF - #- BUILD_TYPE=Release ARCH=amd64_x86 TESTING=OFF - #- BUILD_TYPE=MinSizeRel ARCH=amd64_x86 TESTING=OFF + - BUILD_TYPE=Debug VS2017=amd64_arm TESTING=OFF + - BUILD_TYPE=Release VS2017=amd64_arm TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_arm TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_arm TESTING=OFF - #- BUILD_TYPE=Debug ARCH=amd64_arm TESTING=OFF - #- BUILD_TYPE=Release ARCH=amd64_arm TESTING=OFF - #- BUILD_TYPE=MinSizeRel ARCH=amd64_arm TESTING=OFF + - BUILD_TYPE=Debug VS2017=amd64_arm64 TESTING=OFF + - BUILD_TYPE=Release VS2017=amd64_arm64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" @@ -42,16 +49,12 @@ before_script: #vcvarsx86_arm.bat #vcvarsx86_arm64.bat - #vcvars64.bat - #vcvarsamd64_x86.bat - #vcvarsamd64_arm.bat - #vcvarsamd64_arm64.bat - - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars64.bat - + - echo "Setting up VS2017 for ${VS2017}" + - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars${VS2017}.bat # Visual Studio 2015 - - ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC/" - #- "/c/Progra~2/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" amd64 + #- ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC/" + #- /c/Progra~2/Microsoft\ Visual\ Studio\ 14.0/VC/vcvarsall.bat amd64 # generate the build files - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build From 2a453a99a5254f69a5436cb0ce0afcb2849c4aa5 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 13:20:40 -0700 Subject: [PATCH 65/95] trav12 --- .travis.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f43193..211aeae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,25 +3,25 @@ language: shell os: windows env: - - BUILD_TYPE=Debug VS2017=64 TESTING=OFF - - BUILD_TYPE=Release VS2017=64 TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=64 TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=64 TESTING=OFF + - BUILD_TYPE=Debug VS2017=amd64 TESTING=OFF + - BUILD_TYPE=Release VS2017=amd64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF - - BUILD_TYPE=Debug VS2017=amd64_x86 TESTING=OFF - - BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF + #- BUILD_TYPE=Debug VS2017=amd64_x86 TESTING=OFF + #- BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF - - BUILD_TYPE=Debug VS2017=amd64_arm TESTING=OFF - - BUILD_TYPE=Release VS2017=amd64_arm TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=amd64_arm TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=amd64_arm TESTING=OFF + #- BUILD_TYPE=Debug VS2017=amd64_arm TESTING=OFF + #- BUILD_TYPE=Release VS2017=amd64_arm TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm TESTING=OFF - - BUILD_TYPE=Debug VS2017=amd64_arm64 TESTING=OFF - - BUILD_TYPE=Release VS2017=amd64_arm64 TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF + #- BUILD_TYPE=Debug VS2017=amd64_arm64 TESTING=OFF + #- BUILD_TYPE=Release VS2017=amd64_arm64 TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF install: - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" @@ -49,8 +49,8 @@ before_script: #vcvarsx86_arm.bat #vcvarsx86_arm64.bat - - echo "Setting up VS2017 for ${VS2017}" - - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars${VS2017}.bat + - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} + - printenv # Visual Studio 2015 #- ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC/" From ac6ba03644fc5920b16c11fc197939fb1796d427 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 13:33:35 -0700 Subject: [PATCH 66/95] trav13 --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 211aeae..288fec5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ language: shell os: windows env: - - BUILD_TYPE=Debug VS2017=amd64 TESTING=OFF - - BUILD_TYPE=Release VS2017=amd64 TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF + - BUILD_TYPE=Debug VS2017=arm TESTING=OFF + - BUILD_TYPE=Release VS2017=arm TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=arm TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=arm TESTING=OFF #- BUILD_TYPE=Debug VS2017=amd64_x86 TESTING=OFF #- BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF @@ -36,6 +36,7 @@ before_script: # document the version - cmake --version + - cmake --help # set enviromental variables - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/" From 4ea2dbd035f25bd13459718525897d0a57a0e994 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 13:42:30 -0700 Subject: [PATCH 67/95] trav14 --- .travis.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 288fec5..227495e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ language: shell os: windows env: - - BUILD_TYPE=Debug VS2017=arm TESTING=OFF - - BUILD_TYPE=Release VS2017=arm TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=arm TESTING=OFF - - BUILD_TYPE=MinSizeRel VS2017=arm TESTING=OFF + - BUILD_TYPE=Debug VS2017=amd64 TESTING=OFF + - BUILD_TYPE=Release VS2017=amd64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF #- BUILD_TYPE=Debug VS2017=amd64_x86 TESTING=OFF #- BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF @@ -50,6 +50,16 @@ before_script: #vcvarsx86_arm.bat #vcvarsx86_arm64.bat + - echo "######################################" + - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars64.bat + - echo "######################################" + - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsamd64_x86.bat + - echo "######################################" + - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsamd64_arm.bat + - echo "######################################" + - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsamd64_arm64.bat + - echo "######################################" + - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} - printenv From 8a77703a47e940187b2dd79af09c99e47b319889 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 13:48:41 -0700 Subject: [PATCH 68/95] trav15 --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 227495e..146dfda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,13 +51,7 @@ before_script: #vcvarsx86_arm64.bat - echo "######################################" - - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars64.bat - - echo "######################################" - - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsamd64_x86.bat - - echo "######################################" - - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsamd64_arm.bat - - echo "######################################" - - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsamd64_arm64.bat + - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat - echo "######################################" - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} From 94511d4b5e8ead4cd638455f41aaae57b5cfd040 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 14:14:53 -0700 Subject: [PATCH 69/95] trav16 --- .travis.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 146dfda..b0ea1a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,27 +49,37 @@ before_script: #vcvarsx86_amd64.bat #vcvarsx86_arm.bat #vcvarsx86_arm64.bat + - printenv - - echo "######################################" - - cat /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat - - echo "######################################" + - local msenvbatch="__print_ms_env.bat" + - echo "@echo off" > "$msenvbatch" + - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msenvbatch" + - echo "set" >> "$msenvbatch" + - cmd "/C $msenvbatch" > "$msenv.tmp" + - rm -f "$msenvbatch" + - grep -E '^PATH=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' -e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' -e 's/\\/\//g' -e 's/;\//:\//g' > "$msenv" + - grep -E '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" + - rm "$msenv.tmp" + - source "$msenv" - - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} - printenv + #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} + #- printenv + # Visual Studio 2015 #- ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC/" #- /c/Progra~2/Microsoft\ Visual\ Studio\ 14.0/VC/vcvarsall.bat amd64 # generate the build files - - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build - - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - -DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} - -DDIST_ROOT="${TRAVIS_BUILD_DIR}/build/dist" - -DENABLE_TESTS=${TESTING} - .. + #- cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build + #- cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + #-DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} + #-DDIST_ROOT="${TRAVIS_BUILD_DIR}/build/dist" + #-DENABLE_TESTS=${TESTING} + #.. script: - - cmake --build . --config ${BUILD_TYPE} --target install + #- cmake --build . --config ${BUILD_TYPE} --target install addons: coverity_scan: From 3522b5bfddaa457e0b462926644838a2c57ade96 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 14:21:04 -0700 Subject: [PATCH 70/95] trav17 --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b0ea1a8..59dd764 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ before_script: #vcvarsx86_arm64.bat - printenv - - local msenvbatch="__print_ms_env.bat" + - msenvbatch="__print_ms_env.bat" - echo "@echo off" > "$msenvbatch" - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msenvbatch" - echo "set" >> "$msenvbatch" @@ -60,7 +60,9 @@ before_script: - grep -E '^PATH=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' -e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' -e 's/\\/\//g' -e 's/;\//:\//g' > "$msenv" - grep -E '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" - rm "$msenv.tmp" - - source "$msenv" + - cat "$msenv" + - export -f "$msenv" + #- source "$msenv" - printenv From fc942f28be7b843a684ac85a2f4d7dfce816cca3 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 14:27:13 -0700 Subject: [PATCH 71/95] trav18 --- .travis.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 59dd764..b2d2c3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,13 +52,27 @@ before_script: - printenv - msenvbatch="__print_ms_env.bat" - - echo "@echo off" > "$msenvbatch" + #- echo "@echo off" > "$msenvbatch" - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msenvbatch" - echo "set" >> "$msenvbatch" - cmd "/C $msenvbatch" > "$msenv.tmp" + - cat "$msenv.tmp" + - rm -f "$msenvbatch" - - grep -E '^PATH=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' -e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' -e 's/\\/\//g' -e 's/;\//:\//g' > "$msenv" - - grep -E '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" + + - grep -E '^PATH=' "$msenv.tmp" + - grep -E '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" + + - grep -E '^PATH=' "$msenv.tmp" | \ + sed \ + -e 's/\(.*\)=\(.*\)/export \1="\2"/g' \ + -e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' \ + -e 's/\\/\//g' \ + -e 's/;\//:\//g' > "$msenv" + + - grep -E '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | \ + sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" + - rm "$msenv.tmp" - cat "$msenv" - export -f "$msenv" From 5a0b9aecfcc5c3a43c1585fa2d2bed92d7dca941 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 15:12:11 -0700 Subject: [PATCH 72/95] trav19 --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2d2c3d..07ceebb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,9 +56,12 @@ before_script: - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msenvbatch" - echo "set" >> "$msenvbatch" - cmd "/C $msenvbatch" > "$msenv.tmp" - - cat "$msenv.tmp" - + - echo "#########################" + - cat "$msenvbatch" - rm -f "$msenvbatch" + - echo "#########################" + - cat "$msenv.tmp" + - echo "#########################" - grep -E '^PATH=' "$msenv.tmp" - grep -E '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" From e7c1f4f8271bdab0a2e610d1d4773144d37c8dfc Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:00:20 -0700 Subject: [PATCH 73/95] tv0 --- .travis.yml | 52 ++++++++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07ceebb..1c8220f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,20 +23,20 @@ env: #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF -install: - - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - - mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && pwd - - travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip - - echo "615dfb0813443c1ff56ae0e9d6dbfc61 *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt - - md5sum -c cmake_md5.txt - - 7z x -y cmake-3.11.0-win64-x64.zip - - PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH +#install: + #- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" + #- mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && pwd + #- travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip + #- echo "615dfb0813443c1ff56ae0e9d6dbfc61 *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt + #- md5sum -c cmake_md5.txt + #- 7z x -y cmake-3.11.0-win64-x64.zip + #- PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH before_script: # document the version - - cmake --version - - cmake --help + #- cmake --version + #- cmake --help # set enviromental variables - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/" @@ -51,35 +51,27 @@ before_script: #vcvarsx86_arm64.bat - printenv - - msenvbatch="__print_ms_env.bat" - #- echo "@echo off" > "$msenvbatch" - - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msenvbatch" - - echo "set" >> "$msenvbatch" - - cmd "/C $msenvbatch" > "$msenv.tmp" + - msvcenv="__print_ms_env.bat" + - echo "@echo on" > "$msvcenv" + - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msvcenv" + - echo "set" >> "$msvcenv" + - cmd "/V /C $msvcenv" > "$msenv.tmp" + - echo "#########################" - - cat "$msenvbatch" - - rm -f "$msenvbatch" + - cat "$msvcenv" + - rm -f "$msvcenv" - echo "#########################" - cat "$msenv.tmp" - echo "#########################" - - - grep -E '^PATH=' "$msenv.tmp" - - grep -E '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" - - - grep -E '^PATH=' "$msenv.tmp" | \ - sed \ - -e 's/\(.*\)=\(.*\)/export \1="\2"/g' \ + - grep -e '^PATH=' "$msenv.tmp" | sed \ + -e 's/\(.*\)=\(.*\)/export \1="\2:$PATH"/g' \ -e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' \ -e 's/\\/\//g' \ -e 's/;\//:\//g' > "$msenv" - - - grep -E '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | \ - sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" - + - grep -e '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" - rm "$msenv.tmp" - cat "$msenv" - - export -f "$msenv" - #- source "$msenv" + - source "$msenv" - printenv From c7855d573ab0e806058dc2c433f5190236903eac Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:06:28 -0700 Subject: [PATCH 74/95] tv1 --- .travis.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1c8220f..edc840b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,23 +52,25 @@ before_script: - printenv - msvcenv="__print_ms_env.bat" - - echo "@echo on" > "$msvcenv" + - echo "@echo off" > "$msvcenv" - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msvcenv" - echo "set" >> "$msvcenv" - - cmd "/V /C $msvcenv" > "$msenv.tmp" - - - echo "#########################" + - cmd "/C $msvcenv" > "$msenv.tmp" + - cat "$msvcenv" - rm -f "$msvcenv" - - echo "#########################" + + - printenv + - cat "$msenv.tmp" - - echo "#########################" - - grep -e '^PATH=' "$msenv.tmp" | sed \ - -e 's/\(.*\)=\(.*\)/export \1="\2:$PATH"/g' \ - -e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' \ - -e 's/\\/\//g' \ - -e 's/;\//:\//g' > "$msenv" - - grep -e '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" + + - grep -e '^PATH=' "$msenv.tmp" | \ + sed \ + -e 's/\(.*\)=\(.*\)/export \1="\2:$PATH"/g' \ + -e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' \ + -e 's/\\/\//g' -e 's/;\//:\//g' + # > "$msenv" + #- grep -e '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" - rm "$msenv.tmp" - cat "$msenv" - source "$msenv" From 213b0b807c5299f5e3b2015c6a929281e505fe0f Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:12:24 -0700 Subject: [PATCH 75/95] tv2 --- .travis.yml | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index edc840b..2201e04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,35 +49,36 @@ before_script: #vcvarsx86_amd64.bat #vcvarsx86_arm.bat #vcvarsx86_arm64.bat - - printenv + #- printenv - - msvcenv="__print_ms_env.bat" - - echo "@echo off" > "$msvcenv" - - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msvcenv" - - echo "set" >> "$msvcenv" - - cmd "/C $msvcenv" > "$msenv.tmp" + #- msvcenv="__print_ms_env.bat" + #- echo "@echo off" > "$msvcenv" + #- echo "call /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017}" >> "$msvcenv" + #- echo "set" >> "$msvcenv" + #- cmd "/C $msvcenv" > "$msenv.tmp" - - cat "$msvcenv" - - rm -f "$msvcenv" + #- cat "$msvcenv" + #- rm -f "$msvcenv" - - printenv - - - cat "$msenv.tmp" + #- printenv + + #- cat "$msenv.tmp" - - grep -e '^PATH=' "$msenv.tmp" | \ - sed \ - -e 's/\(.*\)=\(.*\)/export \1="\2:$PATH"/g' \ - -e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' \ - -e 's/\\/\//g' -e 's/;\//:\//g' + #- grep -e '^PATH=' "$msenv.tmp" | \ + #sed \ + #-e 's/\(.*\)=\(.*\)/export \1="\2:$PATH"/g' \ + #-e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' \ + #-e 's/\\/\//g' -e 's/;\//:\//g' # > "$msenv" #- grep -e '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" - - rm "$msenv.tmp" - - cat "$msenv" - - source "$msenv" + #- rm "$msenv.tmp" + #- cat "$msenv" + #- source "$msenv" - printenv - #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} + - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" + - cat "$msenv.tmp" #- printenv # Visual Studio 2015 From deb38969b488dc29b39012c437792207076051ff Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:14:32 -0700 Subject: [PATCH 76/95] tv3 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2201e04..4aea39c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,7 +77,7 @@ before_script: - printenv - - /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" + - call /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" - cat "$msenv.tmp" #- printenv From 8dab5c869e5d7df76329a5526e2e4cd56ee09098 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:20:32 -0700 Subject: [PATCH 77/95] tv4 --- .travis.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4aea39c..6c6d8bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,16 +51,17 @@ before_script: #vcvarsx86_arm64.bat #- printenv - #- msvcenv="__print_ms_env.bat" - #- echo "@echo off" > "$msvcenv" - #- echo "call /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017}" >> "$msvcenv" - #- echo "set" >> "$msvcenv" - #- cmd "/C $msvcenv" > "$msenv.tmp" + - msvcenv="__msvc.bat" + - echo "@echo off" > "$msvcenv" + - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msvcenv" + - echo "set" >> "$msvcenv" + - cmd "/K $msvcenv" + # > "$msenv.tmp" - #- cat "$msvcenv" - #- rm -f "$msvcenv" + - cat "$msvcenv" + - rm -f "$msvcenv" - #- printenv + - printenv #- cat "$msenv.tmp" @@ -75,10 +76,10 @@ before_script: #- cat "$msenv" #- source "$msenv" - - printenv + #- printenv - - call /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" - - cat "$msenv.tmp" + #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" + #- cat "$msenv.tmp" #- printenv # Visual Studio 2015 @@ -86,14 +87,14 @@ before_script: #- /c/Progra~2/Microsoft\ Visual\ Studio\ 14.0/VC/vcvarsall.bat amd64 # generate the build files - #- cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build - #- cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build + - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} #-DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} #-DDIST_ROOT="${TRAVIS_BUILD_DIR}/build/dist" #-DENABLE_TESTS=${TESTING} #.. script: - #- cmake --build . --config ${BUILD_TYPE} --target install + - cmake --build . --config ${BUILD_TYPE} --target install addons: coverity_scan: From d7270f391caf804754bcc7d033317eb41f6a02ea Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:23:10 -0700 Subject: [PATCH 78/95] tv5 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6c6d8bb..9f3b8fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ before_script: - msvcenv="__msvc.bat" - echo "@echo off" > "$msvcenv" - - echo "call C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" >> "$msvcenv" + - echo "call /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017}" >> "$msvcenv" - echo "set" >> "$msvcenv" - cmd "/K $msvcenv" # > "$msenv.tmp" From 68aa734fc53ea830f576291fa516418347a32ac7 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:28:34 -0700 Subject: [PATCH 79/95] tv6 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9f3b8fe..9a73983 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,6 +78,7 @@ before_script: #- printenv + - cmd "/K C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" #- printenv From 4fc12935fb662967896af7967dddf9189536fff7 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:30:15 -0700 Subject: [PATCH 80/95] tv7 --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9a73983..ef9f335 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,15 +51,15 @@ before_script: #vcvarsx86_arm64.bat #- printenv - - msvcenv="__msvc.bat" - - echo "@echo off" > "$msvcenv" - - echo "call /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017}" >> "$msvcenv" - - echo "set" >> "$msvcenv" - - cmd "/K $msvcenv" + #- msvcenv="__msvc.bat" + #- echo "@echo off" > "$msvcenv" + #- echo "call /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017}" >> "$msvcenv" + #- echo "set" >> "$msvcenv" + #- cmd "/K $msvcenv" # > "$msenv.tmp" - - cat "$msvcenv" - - rm -f "$msvcenv" + #- cat "$msvcenv" + #- rm -f "$msvcenv" - printenv From 6357c47c5624184f5c4461e469cd2bb993ed5a2a Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:32:43 -0700 Subject: [PATCH 81/95] tv7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ef9f335..c5e4eba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,7 @@ before_script: #- printenv - - cmd "/K C:\Progra~2\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat ${VS2017}" + - cmd "/K \"C:\\Progra~2\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat\" ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" #- printenv From 425cfb97fa95a66e2912aa0403231c506e45b657 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 16:35:08 -0700 Subject: [PATCH 82/95] tv8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c5e4eba..5469439 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,7 @@ before_script: #- printenv - - cmd "/K \"C:\\Progra~2\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat\" ${VS2017}" + - cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" #- printenv From aba5cddb304414f32fd92260aa76dc6458bb10a6 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 17:23:03 -0700 Subject: [PATCH 83/95] tv00 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5469439..8aed593 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,8 @@ before_script: #- printenv - - cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" + - cmd /K "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" + #- cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" #- printenv From 6c272f6d44b6f136262edb5cf864bdce3b1aef7f Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 17:29:54 -0700 Subject: [PATCH 84/95] tv01 --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8aed593..a0012ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,10 @@ env: - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF - #- BUILD_TYPE=Debug VS2017=amd64_x86 TESTING=OFF - #- BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF - #- BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF - #- BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=Debug VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF #- BUILD_TYPE=Debug VS2017=amd64_arm TESTING=OFF #- BUILD_TYPE=Release VS2017=amd64_arm TESTING=OFF @@ -78,7 +78,7 @@ before_script: #- printenv - - cmd /K "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" + - "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" ${VS2017} #- cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" From 676f98c243217673707e84e96943190d4ec0043f Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 17:31:03 -0700 Subject: [PATCH 85/95] tv02 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a0012ce..83aee6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,7 @@ before_script: #- printenv - - "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" ${VS2017} + - cmd /K "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" ${VS2017} #- cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" From 0df754fbfb533eacec180b903ecff254242a33a1 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 17:33:57 -0700 Subject: [PATCH 86/95] tv02 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 83aee6b..e875632 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,7 @@ before_script: #- printenv - - cmd /K "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" ${VS2017} + - "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat ${VS2017}" #- cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" From 8c2296b8be29745a4dd423f88b4acf891eeb0ff1 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 17:35:31 -0700 Subject: [PATCH 87/95] tv04 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e875632..e82e494 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,7 @@ before_script: #- printenv - - "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat ${VS2017}" + - call "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat ${VS2017}" #- cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" From 12e56d5e4d5bbbb08a197bd9dbaafd220613af44 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Mon, 15 Oct 2018 17:37:33 -0700 Subject: [PATCH 88/95] tv05 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e82e494..c4e22c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,7 @@ before_script: #- printenv - - call "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat ${VS2017}" + - call "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" ${VS2017} #- cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" #- cat "$msenv.tmp" From c892ef10d552f4a66f19d83d663a61945b4f9861 Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Wed, 7 Aug 2019 19:51:04 -0400 Subject: [PATCH 89/95] mingw gnu compiler support Add MinGW GNU compiler support. Also update CMake minimum version, since some of the newer generator features are used. --- .gitignore | 16 ++++- CMakeLists.txt | 155 ++++++++++++++++++++++++++-------------- _ptw32.h | 2 +- cmake/config_h_in.cmake | 118 ++++++++++++++++++++++++++++++ cmake/target_arch.cmake | 32 +++++---- implement.h | 6 +- ptw32_MCS_lock.c | 4 +- 7 files changed, 259 insertions(+), 74 deletions(-) create mode 100644 cmake/config_h_in.cmake diff --git a/.gitignore b/.gitignore index 7d7555e..a4b7211 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.un~ +*~ *.obj *.dll.manifest *.dll @@ -7,6 +9,10 @@ *.pdb *.ilk *.exp +config.log +config.h.in +config.status +configure version.res tests/*.pass tests/*.bench @@ -15,8 +21,12 @@ tests/sched.h tests/semaphore.h tests/benchlib.o tests/SIZES.* -tests/*.log -/.project +tests/*.log +/.project build +cmake-build +autom4te.cache PTHREADS-BUILT -.vscode \ No newline at end of file +.vscode +GNUmakefile +tests/GNUmakefile diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e794ff..3977d75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,22 +1,20 @@ -cmake_minimum_required(VERSION 3.11) - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "MinSizeRel" CACHE STRING "Choose the type of build, options are: Debug, Release, or MinSizeRel." FORCE) - message(STATUS "No build type specified, defaulting to MinSizeRel.") -endif() +cmake_minimum_required(VERSION 3.14) set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake") +include (CheckIncludeFile) +include (CheckFunctionExists) +include (CheckSymbolExists) +include (CheckTypeSize) +include (config_h_in) include (get_version) message(STATUS "Generator ......... ${CMAKE_GENERATOR}") -message(STATUS "Build Type ........ ${CMAKE_BUILD_TYPE}") message(STATUS "Version ........... ${PTHREADS4W_VERSION}") -project(pthreads4w VERSION ${PTHREADS4W_VERSION} LANGUAGES C) +project(pthreads4w VERSION ${PTHREADS4W_VERSION} LANGUAGES C CXX) set(PTW32_VER ${PROJECT_VERSION_MAJOR}${EXTRAVERSION}) -set(CMAKE_DEBUG_POSTFIX d) # Uncomment this if config.h defines RETAIN_WSALASTERROR #set(XLIBS wsock32.lib) @@ -30,49 +28,75 @@ include_directories(.) include (target_arch) get_target_arch(TARGET_ARCH) - if(${TARGET_ARCH} STREQUAL "ARM") - add_definitions(-D__PTW32_ARCHARM -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) + add_compile_definitions(__PTW32_ARCHARM _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) elseif(${TARGET_ARCH} STREQUAL "ARM64") - add_definitions(-D__PTW32_ARCHARM64 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) + add_compile_definitions(__PTW32_ARCHARM64 _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) elseif(${TARGET_ARCH} STREQUAL "x86_64") - add_definitions(-D__PTW32_ARCHAMD64) + add_compile_definitions(__PTW32_ARCHAMD64) elseif(${TARGET_ARCH} STREQUAL "x86") - add_definitions(-D__PTW32_ARCHX86) + add_compile_definitions(__PTW32_ARCHX86) elseif(${TARGET_ARCH} STREQUAL "x64") - add_definitions(-D__PTW32_ARCHX64) + add_compile_definitions(__PTW32_ARCHX64) else() MESSAGE(ERROR "\"${TARGET_ARCH}\" not supported in version.rc") endif() + message(STATUS "Target ............ ${TARGET_ARCH}") +set(CMAKE_C_LIBRARY_ARCHITECTURE ${TARGET_ARCH}) +set(CMAKE_LIBRARY_ARCHITECTURE ${TARGET_ARCH}) if(MSVC) message(STATUS "MSVC Version ...... ${MSVC_VERSION}") +else() + message(STATUS "C Compiler ID ..... ${CMAKE_C_COMPILER_ID}") endif() ################################# # Install Path # ################################# -if(DIST_ROOT) - set(CMAKE_INSTALL_PREFIX "${DIST_ROOT}") -else() - set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/PTHREADS-BUILT") +if (DIST_ROOT) + set(CMAKE_INSTALL_PREFIX "${DIST_ROOT}") +elseif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/PTHREADS-BUILT") endif() + message(STATUS "Install Path ${CMAKE_INSTALL_PREFIX}") -set(DLLDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/bin) -set(LIBDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/lib) -set(HDRDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/include) -set(TESTDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/test) +################################# +# configuration features # +################################# +if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + check_include_file(errno.h HAVE_ERRNO_H) + check_include_file(inttypes.h HAVE_INTTYPES_H) + check_include_file(memory.h HAVE_MEMORY_H) + check_include_file(signal.h HAVE_SIGNAL_H) + check_include_file(stdint.h HAVE_STDINT_H) + check_include_file(stdlib.h HAVE_STDLIB_H) + check_include_file(strings.h HAVE_STRINGS_H) + check_include_file(string.h HAVE_STRING_H) + check_include_file(sys/stat.h HAVE_SYS_STAT_H) + check_include_file(sys/types.h HAVE_SYS_TYPES_H) + check_include_file(time.h HAVE_TIME_H) + check_include_file(unistd.h HAVE_UNISTD_H) + check_function_exists(calloc HAVE_CALLOC) + check_type_size(sigset_t HAVE_SIGSET_T) + check_type_size("struct timespec" HAVE_STRUCT_TIMESPEC) + check_symbol_exists(_beginthreadex process.h HAVE__BEGINTHREADEX) + check_symbol_exists(DuplicateHandle windows.h HAVE_DUPLICATEHANDLE) + + create_config_h_in() + configure_file("${CMAKE_BINARY_DIR}/config.h.in" "${CMAKE_SOURCE_DIR}/config.h") +endif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + ################################# # Defs # ################################# -add_definitions(-D__PTW32_BUILD_INLINED) if(MSVC) - + add_compile_definitions(__PTW32_BUILD_INLINED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /errorReport:none /nologo ") # C++ Exceptions @@ -84,8 +108,9 @@ if(MSVC) set(VCEFLAGS "/EHs /TP ") endif() - add_definitions(-DHAVE_CONFIG_H -D__PTW32_RC_MSC) - + add_compile_definitions(HAVE_CONFIG_H __PTW32_RC_MSC) +elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + add_compile_definitions(__PTW32_BUILD_INLINED HAVE_CONFIG_H) endif() # Update filename with proper version info @@ -94,55 +119,77 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_BINARY_DIR}/versi ################################# # Libraries # ################################# -set(targ_suffix "") -if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") - set(targ_suffix ${CMAKE_DEBUG_POSTFIX}) -endif() macro(shared_lib type def) set(targ pthread${type}${PTW32_VER}) add_library(${targ} SHARED pthread.c ${CMAKE_BINARY_DIR}/version.rc) message(STATUS ${targ}) - target_compile_definitions(${targ} PUBLIC "-D${def}") - if(${type} STREQUAL "VCE") + target_compile_definitions(${targ} PUBLIC "${def}") + set_target_properties(${targ} PROPERTIES DEBUG_POSTFIX "d") + + if (${type} STREQUAL "VCE") set_target_properties(${targ} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) - endif() - if(${CMAKE_GENERATOR} MATCHES "Visual Studio") - install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.dll DESTINATION ${DLLDEST}) - install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) - else() - install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.dll DESTINATION ${DLLDEST}) - install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) - endif() + elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + if (${type} STREQUAL "GCE") + target_compile_options(${targ} PUBLIC "-xc++") + target_link_libraries(${targ} "-lstdc++") + endif (${type} STREQUAL "GCE") + set_target_properties(${targ} PROPERTIES COMPILE_FLAGS "${l_target_cflags}") + endif (${type} STREQUAL "VCE") + + install( + TARGETS ${targ} + ARCHIVE # DESTINATION ${TARGET_ARCH}/${CONFIG}/lib + LIBRARY # DESTINATION ${TARGET_ARCH}/${CONFIG}/lib + RUNTIME # DESTINATION ${TARGET_ARCH}/${CONFIG}/bin + ) endmacro() macro(static_lib type def) set(targ libpthread${type}${PTW32_VER}) add_library(${targ} STATIC pthread.c) message(STATUS ${targ}) - target_compile_definitions(${targ} PUBLIC "-D${def}" -D__PTW32_STATIC_LIB) + target_compile_definitions(${targ} PUBLIC "${def}" __PTW32_STATIC_LIB) + set_target_properties(${targ} PROPERTIES DEBUG_POSTFIX "d") + if(${type} STREQUAL "VCE") set_target_properties(${targ} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + if (${type} STREQUAL "GCE") + target_compile_options(${targ} PUBLIC "-xc++") + endif (${type} STREQUAL "GCE") endif() - if(${CMAKE_GENERATOR} MATCHES "Visual Studio") - install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) - else() - install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) - endif() + + install( + TARGETS ${targ} + ARCHIVE # DESTINATION ${TARGET_ARCH}/${CONFIG}/lib + LIBRARY # DESTINATION ${TARGET_ARCH}/${CONFIG}/lib + RUNTIME # DESTINATION ${TARGET_ARCH}/${CONFIG}/bin + ) endmacro() -shared_lib ( VCE __PTW32_CLEANUP_CXX ) -shared_lib ( VSE __PTW32_CLEANUP_SEH ) -shared_lib ( VC __PTW32_CLEANUP_C ) +if (MSVC) + shared_lib ( VCE __PTW32_CLEANUP_CXX ) + shared_lib ( VSE __PTW32_CLEANUP_SEH ) + shared_lib ( VC __PTW32_CLEANUP_C ) + + static_lib ( VCE __PTW32_CLEANUP_CXX ) + static_lib ( VSE __PTW32_CLEANUP_SEH ) + static_lib ( VC __PTW32_CLEANUP_C ) +elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + ## NOTE: MinGW64 does support SEH exception handling, BUT it does not yet + ## have the MSVC keywords "__try", "__except" and "__finally". + shared_lib ( GCE __PTW32_CLEANUP_CXX ) + shared_lib ( GC __PTW32_CLEANUP_C ) -static_lib ( VCE __PTW32_CLEANUP_CXX ) -static_lib ( VSE __PTW32_CLEANUP_SEH ) -static_lib ( VC __PTW32_CLEANUP_C ) + static_lib ( GCE __PTW32_CLEANUP_CXX ) + static_lib ( GC __PTW32_CLEANUP_C ) +endif (MSVC) ################################# # Install # ################################# -install(FILES _ptw32.h pthread.h sched.h semaphore.h DESTINATION ${HDRDEST}) +install(FILES _ptw32.h pthread.h sched.h semaphore.h TYPE INCLUDE) ################################# # Test # diff --git a/_ptw32.h b/_ptw32.h index e638027..4bd8d9c 100644 --- a/_ptw32.h +++ b/_ptw32.h @@ -145,7 +145,7 @@ #if defined(__BORLANDC__) # define int64_t LONGLONG # define uint64_t ULONGLONG -#elif !defined(__MINGW32__) +#elif !defined(__MINGW32__) || !defined(__x86_64__) typedef _int64 int64_t; typedef unsigned _int64 uint64_t; # if defined (__PTW32_CONFIG_MSVC6) diff --git a/cmake/config_h_in.cmake b/cmake/config_h_in.cmake new file mode 100644 index 0000000..9f9ee38 --- /dev/null +++ b/cmake/config_h_in.cmake @@ -0,0 +1,118 @@ +set(PTHREAD_CONFIG_H " +/* config.h, automagically generated by cmake. */ + +#ifndef __PTW32_CONFIG_H +#define __PTW32_CONFIG_H + +/* Define to 1 if you have the `calloc' function. */ +#cmakedefine HAVE_CALLOC 1 + +/* Define if CPU_AFFINITY is supported */ +#define HAVE_CPU_AFFINITY 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H 1 + +/* Define if your compiler knows about mode_t */ +#define HAVE_MODE_T 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SIGNAL_H 1 + +/* Define if your compiler knows about sigset_t */ +#cmakedefine HAVE_SIGSET_T 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* Define if your compiler knows about struct timespec */ +#cmakedefine HAVE_STRUCT_TIMESPEC 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `_beginthreadex' function. */ +#cmakedefine HAVE__BEGINTHREADEX 1 + +/* Define to 1 if you have the DuplicateHandle function. */ +#cmakedefine HAVE_DUPLICATEHANDLE 1 + +/* Define if you do not have calloc */ +#if !defined(HAVE_CALLOC) || !HAVE_CALLOC +#define NEED_CALLOC +#endif + +#if !defined(HAVE__BEGINTHREADEX) || !HAVE__BEGINTHREADEX +#define NEED_CREATETHREAD +#endif + +/* Define if DuplicateHandle is unsupported */ +#if !defined(HAVE_DUPLICATEHANDLE) || !HAVE_DUPLICATEHANDLE +#define NEED_DUPLICATEHANDLE +#endif + +/* Define if you do not have errno */ +/* #undef NEED_ERRNO */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT \"\" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME \"pthreads4w\" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING \"pthreads4w git\" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME \"pthreads4w\" + +/* Define to the home page for this package. */ +#define PACKAGE_URL \"\" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION \"git\" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +#define HAVE_C_INLINE 1 + +#endif +") + + +function (create_config_h_in) + file(WRITE + "${CMAKE_BINARY_DIR}/config.h.in" + "${PTHREAD_CONFIG_H}") +endfunction (create_config_h_in) diff --git a/cmake/target_arch.cmake b/cmake/target_arch.cmake index 0545044..d71a91e 100644 --- a/cmake/target_arch.cmake +++ b/cmake/target_arch.cmake @@ -1,19 +1,25 @@ set(TARGET_ARCH_DETECT_CODE " - #if defined(_M_ARM) - #error cmake_arch ARM - #elif defined(_M_ARM64) - #error cmake_arch ARM64 - #elif defined(_M_AMD64) - #error cmake_arch x86_64 - #elif defined(_M_X64) - #error cmake_arch x64 - #elif defined(_M_IX86) - #error cmake_arch x86 - #else - #error cmake_arch unknown - #endif +#if defined(_M_ARM) +# error cmake_arch ARM +#elif defined(_M_ARM64) +# error cmake_arch ARM64 +#elif defined(_M_AMD64) +# error cmake_arch x86_64 +#elif defined(_M_X64) +# error cmake_arch x64 +#elif defined(_M_IX86) +# error cmake_arch x86 +#elif defined(__MINGW64__) || defined(__x86_64__) +/* NOTE: MinGW64 gcc defined BOTH __MINGW32__ and __MINGW64__, so order + is important. */ +# error cmake_arch x64 +#elif defined(__MINGW32__) +# error cmake_arch x86 +#else +#error cmake_arch unknown +#endif ") function(get_target_arch out) diff --git a/implement.h b/implement.h index 81c5f29..fc0c889 100644 --- a/implement.h +++ b/implement.h @@ -109,7 +109,11 @@ static void __ptw32_set_errno(int err) { errno = err; SetLastError(err); } #if defined (__PTW32_BUILD_INLINED) # if defined(HAVE_C_INLINE) || defined(__cplusplus) # undef INLINE -# define INLINE inline +# if defined(__GNUC__) +# define INLINE __inline__ +# else +# define INLINE inline +# endif # endif #endif diff --git a/ptw32_MCS_lock.c b/ptw32_MCS_lock.c index 2f12107..6de1b70 100644 --- a/ptw32_MCS_lock.c +++ b/ptw32_MCS_lock.c @@ -103,7 +103,7 @@ * Set event if an event handle has been stored in the flag, and * set flag to -1 otherwise. Note that -1 cannot be a valid handle value. */ -INLINE void +static INLINE void __ptw32_mcs_flag_set (HANDLE * flag) { HANDLE e = (HANDLE) (__PTW32_INTERLOCKED_SIZE)__PTW32_INTERLOCKED_COMPARE_EXCHANGE_SIZE( @@ -133,7 +133,7 @@ __ptw32_mcs_flag_set (HANDLE * flag) * Store an event handle in the flag and wait on it if the flag has not been * set, and proceed without creating an event otherwise. */ -INLINE void +static INLINE void __ptw32_mcs_flag_wait (HANDLE * flag) { if ((__PTW32_INTERLOCKED_SIZE)0 == From 5851c7b4b00d7b42170a69d2b9feb656248fc194 Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Wed, 7 Aug 2019 21:33:35 -0400 Subject: [PATCH 90/95] fix install prefix default If CMAKE_INSTALL_PREFIX defaults (not set) on initial run, nail the prefix to ${CMAKE_SOURCE_DIR}/PTHREADS-BUILT. And make sure it persists across subsequent runs. Also found a minor cleanup when setting target compile flags. --- CMakeLists.txt | 5 ++--- appveyor.yml | 1 + tests/CMakeLists.txt | 23 +++++++++++++++++++---- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3977d75..259b0a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ endif() if (DIST_ROOT) set(CMAKE_INSTALL_PREFIX "${DIST_ROOT}") elseif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/PTHREADS-BUILT") + set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/PTHREADS-BUILT" CACHE PATH "${CMAKE_SOURCE_DIR}" FORCE) endif() message(STATUS "Install Path ${CMAKE_INSTALL_PREFIX}") @@ -134,7 +134,6 @@ macro(shared_lib type def) target_compile_options(${targ} PUBLIC "-xc++") target_link_libraries(${targ} "-lstdc++") endif (${type} STREQUAL "GCE") - set_target_properties(${targ} PROPERTIES COMPILE_FLAGS "${l_target_cflags}") endif (${type} STREQUAL "VCE") install( @@ -176,7 +175,7 @@ if (MSVC) static_lib ( VCE __PTW32_CLEANUP_CXX ) static_lib ( VSE __PTW32_CLEANUP_SEH ) static_lib ( VC __PTW32_CLEANUP_C ) -elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") +elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") ## NOTE: MinGW64 does support SEH exception handling, BUT it does not yet ## have the MSVC keywords "__try", "__except" and "__finally". shared_lib ( GCE __PTW32_CLEANUP_CXX ) diff --git a/appveyor.yml b/appveyor.yml index 2810968..d99ea25 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,6 +6,7 @@ clone_depth: 1 branches: only: - cmake + - gnu_compiler configuration: - MinSizeRel diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fc8e7fd..3e922e0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,9 +4,12 @@ include (CTest) include_directories(..) set(XXLIBS ws2_32.lib) +set(TESTPREFIX "${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}") set(VCEFLAGS "${VCEFLAGS} -D__PtW32NoCatchWarn") +message(STATUS "Test destination prefix: ${TESTPREFIX}") + macro(add_testcase test type def) set(lib_test test-${test}${type}${PTW32_VER}) @@ -38,11 +41,23 @@ macro(add_testcase test type def) add_dependencies(${dll_test} ${dll_lib}) if(${CMAKE_GENERATOR} MATCHES "Visual Studio") - install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/tests/${lib_test}.exe DESTINATION ${TESTDEST}) - install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/tests/${dll_test}.exe DESTINATION ${TESTDEST}) + install( + FILES ${CMAKE_BINARY_DIR}/$/tests/${lib_test}.exe + DESTINATION "${TESTPREFIX}/$/tests" + ) + install( + FILES ${CMAKE_BINARY_DIR}/$/tests/${dll_test}.exe + DESTINATION "${TESTPREFIX}/$/tests" + ) else() - install(FILES ${CMAKE_BINARY_DIR}/tests/${lib_test}.exe DESTINATION ${TESTDEST}) - install(FILES ${CMAKE_BINARY_DIR}/tests/${dll_test}.exe DESTINATION ${TESTDEST}) + install( + FILES ${CMAKE_BINARY_DIR}/tests/${lib_test}.exe + DESTINATION "${TESTPREFIX}/$/tests" + ) + install( + FILES ${CMAKE_BINARY_DIR}/tests/${dll_test}.exe + DESTINATION "${TESTPREFIX}/$/tests" + ) endif() if(${type} MATCHES "VCE") From a014efc79acd9e25e97a844e336eaf079d8908a6 Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Wed, 14 Aug 2019 21:06:42 -0400 Subject: [PATCH 91/95] const correctness and fix pointer-to-int casts. Fix GCC warning about "char *" used with immutable strings. It's also a bad idea to cast a pointer to int. Use ptrdiff_t instead. --- tests/benchtest1.c | 2 +- tests/benchtest2.c | 2 +- tests/benchtest3.c | 2 +- tests/benchtest4.c | 2 +- tests/benchtest5.c | 2 +- tests/exit2.c | 5 +++-- tests/exit3.c | 5 +++-- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/benchtest1.c b/tests/benchtest1.c index 23e8d72..f392ef6 100644 --- a/tests/benchtest1.c +++ b/tests/benchtest1.c @@ -74,7 +74,7 @@ int iter; void -runTest (char * testNameString, int mType) +runTest (const char * testNameString, int mType) { #ifdef __PTW32_MUTEX_TYPES assert(pthread_mutexattr_settype(&ma, mType) == 0); diff --git a/tests/benchtest2.c b/tests/benchtest2.c index e28c10e..4666d0a 100644 --- a/tests/benchtest2.c +++ b/tests/benchtest2.c @@ -138,7 +138,7 @@ CSThread(void * arg) } void -runTest (char * testNameString, int mType) +runTest (const char * testNameString, int mType) { #ifdef __PTW32_MUTEX_TYPES assert(pthread_mutexattr_settype(&ma, mType) == 0); diff --git a/tests/benchtest3.c b/tests/benchtest3.c index 1bc5a04..3dd54e3 100644 --- a/tests/benchtest3.c +++ b/tests/benchtest3.c @@ -93,7 +93,7 @@ oldTrylockThread (void * arg) void -runTest (char * testNameString, int mType) +runTest (const char * testNameString, int mType) { pthread_t t; diff --git a/tests/benchtest4.c b/tests/benchtest4.c index 51cd256..7a2b82a 100644 --- a/tests/benchtest4.c +++ b/tests/benchtest4.c @@ -77,7 +77,7 @@ oldRunTest (char * testNameString, int mType) void -runTest (char * testNameString, int mType) +runTest (const char * testNameString, int mType) { #ifdef __PTW32_MUTEX_TYPES pthread_mutexattr_settype(&ma, mType); diff --git a/tests/benchtest5.c b/tests/benchtest5.c index d4fd515..ebadde6 100644 --- a/tests/benchtest5.c +++ b/tests/benchtest5.c @@ -72,7 +72,7 @@ int zero = 0; void -reportTest (char * testNameString) +reportTest (const char * testNameString) { durationMilliSecs = GetDurationMilliSecs(currSysTimeStart, currSysTimeStop) - overHeadMilliSecs; diff --git a/tests/exit2.c b/tests/exit2.c index af25ec0..975cb8f 100644 --- a/tests/exit2.c +++ b/tests/exit2.c @@ -41,7 +41,8 @@ void * func(void * arg) { - int failed = (int) arg; + ptrdiff_t failed = (ptrdiff_t) arg; + /* int failed = (int) arg; */ pthread_exit(arg); @@ -49,7 +50,7 @@ func(void * arg) /* * Trick gcc compiler into not issuing a warning here */ - assert(failed - (int)arg); + assert(failed - (ptrdiff_t) arg); return NULL; } diff --git a/tests/exit3.c b/tests/exit3.c index a4cb122..a3f1073 100644 --- a/tests/exit3.c +++ b/tests/exit3.c @@ -34,12 +34,13 @@ * Depends on API functions: pthread_create(). */ +#include #include "test.h" void * func(void * arg) { - int failed = (int) arg; + ptrdiff_t failed = (ptrdiff_t) arg; pthread_exit(arg); @@ -47,7 +48,7 @@ func(void * arg) /* * assert(0) in a way to prevent warning or optimising away. */ - assert(failed - (int) arg); + assert(failed - (ptrdiff_t) arg); return NULL; } From bb861b7ed6dc5575090cf1199f651fee31ca76d4 Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Wed, 14 Aug 2019 21:08:14 -0400 Subject: [PATCH 92/95] Get GNU compiler tests working, fix compilation flags. Use PRIVATE for all target defines, libraries, options, etc. PUBLIC ends up adding extra flags to library dependents because it alters the INTERFACE and PRIVATE target properties at the same time. So, if libpthreadGC3 gets build with __PTW32_BUILD and that definition is added to the libpthreadGC3 target (target_compile_definitions) with PUBLIC, the test cases inherit the __PTW32_BUILD define. It's almost worse than using add_compile_definitions. Punchline: Localize target flags, definitions, options and libraries using PRIVATE. Note: 100% of the tests pass for GNU x64. Some fail for x86. This can be attributed to the difference in C++ exception handling. x64 uses SEH, x86 uses SJLJ. --- CMakeLists.txt | 44 +++++++++++++++++++------------- _ptw32.h | 2 +- appveyor.yml | 56 ++++++++++++++++++++++++++++++++++++++--- cmake/config_h_in.cmake | 5 ++++ tests/CMakeLists.txt | 56 +++++++++++++++++++++++++++++++++++------ 5 files changed, 133 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 259b0a3..97426f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,16 +28,17 @@ include_directories(.) include (target_arch) get_target_arch(TARGET_ARCH) +set(build_defines "") if(${TARGET_ARCH} STREQUAL "ARM") - add_compile_definitions(__PTW32_ARCHARM _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) + set(build_defines __PTW32_ARCHARM _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) elseif(${TARGET_ARCH} STREQUAL "ARM64") - add_compile_definitions(__PTW32_ARCHARM64 _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) + set(build_defines __PTW32_ARCHARM64 _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) elseif(${TARGET_ARCH} STREQUAL "x86_64") - add_compile_definitions(__PTW32_ARCHAMD64) + set(build_defines __PTW32_ARCHAMD64) elseif(${TARGET_ARCH} STREQUAL "x86") - add_compile_definitions(__PTW32_ARCHX86) + set(build_defines __PTW32_ARCHX86) elseif(${TARGET_ARCH} STREQUAL "x64") - add_compile_definitions(__PTW32_ARCHX64) + set(build_defines __PTW32_ARCHX64) else() MESSAGE(ERROR "\"${TARGET_ARCH}\" not supported in version.rc") endif() @@ -58,7 +59,7 @@ endif() if (DIST_ROOT) set(CMAKE_INSTALL_PREFIX "${DIST_ROOT}") elseif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/PTHREADS-BUILT" CACHE PATH "${CMAKE_SOURCE_DIR}" FORCE) + set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/PTHREADS-BUILT" CACHE PATH "Install path prefix (default)" FORCE) endif() message(STATUS "Install Path ${CMAKE_INSTALL_PREFIX}") @@ -96,7 +97,6 @@ endif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") ################################# if(MSVC) - add_compile_definitions(__PTW32_BUILD_INLINED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /errorReport:none /nologo ") # C++ Exceptions @@ -108,9 +108,9 @@ if(MSVC) set(VCEFLAGS "/EHs /TP ") endif() - add_compile_definitions(HAVE_CONFIG_H __PTW32_RC_MSC) + set(build_defines ${build_defines} HAVE_CONFIG_H) elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") - add_compile_definitions(__PTW32_BUILD_INLINED HAVE_CONFIG_H) + set(build_defines ${build_defines} HAVE_CONFIG_H) endif() # Update filename with proper version info @@ -120,19 +120,25 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_BINARY_DIR}/versi # Libraries # ################################# -macro(shared_lib type def) +function(shared_lib type def) set(targ pthread${type}${PTW32_VER}) add_library(${targ} SHARED pthread.c ${CMAKE_BINARY_DIR}/version.rc) message(STATUS ${targ}) - target_compile_definitions(${targ} PUBLIC "${def}") + target_compile_definitions(${targ} PRIVATE ${def} ${build_defines} __PTW32_BUILD_INLINED) set_target_properties(${targ} PROPERTIES DEBUG_POSTFIX "d") + if (MSVC) + # Set resource compiler definition... + target_compile_definitions(${targ} PRIVATE __PTW32_RC_MSC) + endif () if (${type} STREQUAL "VCE") set_target_properties(${targ} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + target_compile_options(${targ} PRIVATE "-mthreads") if (${type} STREQUAL "GCE") - target_compile_options(${targ} PUBLIC "-xc++") - target_link_libraries(${targ} "-lstdc++") + target_compile_options(${targ} PRIVATE "-xc++") + target_link_libraries(${targ} stdc++) + target_link_options(${targ} PRIVATE "-shared-libgcc") endif (${type} STREQUAL "GCE") endif (${type} STREQUAL "VCE") @@ -142,20 +148,22 @@ macro(shared_lib type def) LIBRARY # DESTINATION ${TARGET_ARCH}/${CONFIG}/lib RUNTIME # DESTINATION ${TARGET_ARCH}/${CONFIG}/bin ) -endmacro() +endfunction() -macro(static_lib type def) +function(static_lib type def) set(targ libpthread${type}${PTW32_VER}) add_library(${targ} STATIC pthread.c) message(STATUS ${targ}) - target_compile_definitions(${targ} PUBLIC "${def}" __PTW32_STATIC_LIB) + target_compile_definitions(${targ} PRIVATE "${def}" ${build_defines} __PTW32_STATIC_LIB __PTW32_BUILD_INLINED) set_target_properties(${targ} PROPERTIES DEBUG_POSTFIX "d") if(${type} STREQUAL "VCE") set_target_properties(${targ} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") if (${type} STREQUAL "GCE") - target_compile_options(${targ} PUBLIC "-xc++") + target_compile_options(${targ} PRIVATE "-xc++") + target_link_libraries(${targ} stdc++) + target_link_options(${targ} PRIVATE "-shared-libgcc") endif (${type} STREQUAL "GCE") endif() @@ -165,7 +173,7 @@ macro(static_lib type def) LIBRARY # DESTINATION ${TARGET_ARCH}/${CONFIG}/lib RUNTIME # DESTINATION ${TARGET_ARCH}/${CONFIG}/bin ) -endmacro() +endfunction() if (MSVC) shared_lib ( VCE __PTW32_CLEANUP_CXX ) diff --git a/_ptw32.h b/_ptw32.h index 4bd8d9c..c81fa0f 100644 --- a/_ptw32.h +++ b/_ptw32.h @@ -145,7 +145,7 @@ #if defined(__BORLANDC__) # define int64_t LONGLONG # define uint64_t ULONGLONG -#elif !defined(__MINGW32__) || !defined(__x86_64__) +#elif defined(_MSC_VER) && !defined(__x86_64__) typedef _int64 int64_t; typedef unsigned _int64 uint64_t; # if defined (__PTW32_CONFIG_MSVC6) diff --git a/appveyor.yml b/appveyor.yml index d99ea25..d7e33e4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,6 +20,7 @@ environment: matrix: + ## MSVC: - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' ARCHITECTURE: amd64_x86 @@ -66,6 +67,51 @@ environment: GENERATOR: 'NMake Makefiles' TESTING: ON + ## MinGW GNU C Compiler: + ## x86 flavor: + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + ARCHITECTURE: amd64_x86 + ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'MinGW Makefiles' + TESTING: ON + MINGW: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + ARCHITECTURE: amd64_x86 + ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'MinGW Makefiles' + TESTING: ON + MINGW: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin + + ## x64 flavor: + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + ARCHITECTURE: amd64_x86 + ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'MinGW Makefiles' + TESTING: OFF + MINGW: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + ARCHITECTURE: amd64_x86 + ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'MinGW Makefiles' + TESTING: OFF + MINGW: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + ARCHITECTURE: amd64_x86 + ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'MinGW Makefiles' + TESTING: ON + MINGW: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + ARCHITECTURE: amd64_x86 + ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'MinGW Makefiles' + TESTING: ON + MINGW: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin + init: - echo BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% @@ -83,14 +129,18 @@ build_script: - cd %APPVEYOR_BUILD_FOLDER% - mkdir build - cd build + ## Remove Git's MSYS from PATH, otherwise CMake borks. + - set PATH=%PATH:C:\Program Files (x86)\Git\bin;=% + - set PATH=%PATH:C:\Program Files\Git\bin;=% + - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% + - if defined MINGW set PATH=%MINGW%;%PATH% - cmake -G"%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% -DDIST_ROOT="%CMAKE_DIST_DIR%/%APPVEYOR_BUILD_WORKER_IMAGE%" -DENABLE_TESTS=%TESTING% .. - - cmake --build . --config %CONFIGURATION% --target install + - cmake --build . --config %CONFIGURATION% --target install after_build: - cd %DIST_DIR% @@ -106,6 +156,6 @@ before_test: - set PATH=%APPVEYOR_BUILD_FOLDER%\build;%PATH% test_script: - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ cd %APPVEYOR_BUILD_FOLDER%\build\tests - - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -V + - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -V --timeout 600 after_test: # TODO process CTest output diff --git a/cmake/config_h_in.cmake b/cmake/config_h_in.cmake index 9f9ee38..320a352 100644 --- a/cmake/config_h_in.cmake +++ b/cmake/config_h_in.cmake @@ -61,6 +61,11 @@ set(PTHREAD_CONFIG_H " /* Define to 1 if you have the DuplicateHandle function. */ #cmakedefine HAVE_DUPLICATEHANDLE 1 +/* Make sure that __PTW32_BUILD is defined. */ +#if !defined(__PTW32_BUILD) +#define __PTW32_BUILD +#endif + /* Define if you do not have calloc */ #if !defined(HAVE_CALLOC) || !HAVE_CALLOC #define NEED_CALLOC diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3e922e0..e96d10b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,10 +7,14 @@ set(XXLIBS ws2_32.lib) set(TESTPREFIX "${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}") set(VCEFLAGS "${VCEFLAGS} -D__PtW32NoCatchWarn") +# Remove "-DNDEBUG" from the compiler's list of command line defs. +# This affects the tests' use of the assert macro. This comes from +# the GNUmakefile command line for tests. +string(REPLACE "-DNDEBUG" "-UNDEBUG" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) message(STATUS "Test destination prefix: ${TESTPREFIX}") -macro(add_testcase test type def) +function(add_testcase test type def) set(lib_test test-${test}${type}${PTW32_VER}) set(dll_test test-dll-${test}${type}${PTW32_VER}) @@ -26,18 +30,49 @@ macro(add_testcase test type def) set(extra "") if(${test} MATCHES "openmp1") if(MSVC) - set(extra "/openmp -D_OPENMP") + set(extra "/openmp" "-D_OPENMP") + elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") + set(extra "-fopenmp") endif() endif() add_executable(${lib_test} ${test}.c ${c_dep}) target_link_libraries(${lib_test} ${lib_lib} ${XXLIBS}) - target_compile_definitions(${lib_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") + if(MSVC) + target_compile_options(${lib_test} PRIVATE "/nologo") + endif() + target_compile_definitions(${lib_test} PRIVATE _CONSOLE _MBCS ${def}) + target_compile_options(${lib_test} PRIVATE ${extra}) + if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") + # GNUmakefile compiles every test as C++: + target_compile_definitions(${lib_test} PRIVATE __PtW32NoCatchWarn) + target_compile_options(${lib_test} PRIVATE "-mthreads" "-xc++") + target_link_libraries(${lib_test} stdc++) + target_link_options(${lib_test} PRIVATE "-shared-libgcc") + + if (${test} MATCHES "openmp") + target_link_options(${lib_test} PRIVATE "-fopenmp") + endif () + endif () add_dependencies(${lib_test} ${lib_lib}) add_executable(${dll_test} ${test}.c ${c_dep}) target_link_libraries(${dll_test} ${dll_lib} ${XXLIBS}) - target_compile_definitions(${dll_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") + if(MSVC) + target_compile_options(${dll_test} PRIVATE "/nologo") + endif() + target_compile_definitions(${dll_test} PRIVATE _CONSOLE _MBCS ${def}) + target_compile_options(${dll_test} PRIVATE ${extra}) + if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") + # GNUmakefile compiles every test as C++: + target_compile_definitions(${dll_test} PRIVATE __PtW32NoCatchWarn) + target_compile_options(${dll_test} PRIVATE "-mthreads" "-xc++") + target_link_libraries(${dll_test} stdc++) + target_link_options(${dll_test} PRIVATE "-shared-libgcc") + if (${test} MATCHES "openmp") + target_link_options(${dll_test} PRIVATE "-fopenmp") + endif () + endif () add_dependencies(${dll_test} ${dll_lib}) if(${CMAKE_GENERATOR} MATCHES "Visual Studio") @@ -68,7 +103,7 @@ macro(add_testcase test type def) add_test(NAME ${lib_test} COMMAND ${lib_test}) add_test(NAME ${dll_test} COMMAND ${dll_test}) -endmacro() +endfunction() file(GLOB TESTS *.c) @@ -88,8 +123,13 @@ foreach(t ${TESTS}) continue() endif() - add_testcase(${test} VCE __PTW32_CLEANUP_CXX ) - add_testcase(${test} VSE __PTW32_CLEANUP_SEH ) - add_testcase(${test} VC __PTW32_CLEANUP_C ) + if (MSVC) + add_testcase(${test} VCE __PTW32_CLEANUP_CXX ) + add_testcase(${test} VSE __PTW32_CLEANUP_SEH ) + add_testcase(${test} VC __PTW32_CLEANUP_C ) + elseif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") + add_testcase (${test} GCE __PTW32_CLEANUP_CXX ) + add_testcase (${test} GC __PTW32_CLEANUP_C ) + endif (MSVC) endforeach(t) From 601e7bf05803b0ac0247078d923e22a18f115803 Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Sat, 17 Aug 2019 12:06:35 -0400 Subject: [PATCH 93/95] tweaks: ${CMAKE_BINARY_DIR}/config.h and fixed test install rule. - Generate config.h in ${CMAKE_BINARY_DIR} instead of overwriting config.h in the top-level source directory. Arrange the include directory list to ensure it gets picked up before the top-level. - Fat finger? Install tests for VC from the appropriate configuration subdirectory. --- CMakeLists.txt | 47 ++++++++++++++++++++++---------------------- tests/CMakeLists.txt | 6 +++--- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97426f1..e753104 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,9 @@ set(PTW32_VER ${PROJECT_VERSION_MAJOR}${EXTRAVERSION}) #set(XLIBS wsock32.lib) -include_directories(.) +# Initial include path set. Look in the build directory first, where the +# generated config.h resides, before looking in the source directory. +include_directories("${CMAKE_BINARY_DIR}/" "${CMAKE_SOURCE_DIR}/") ################################# # Target Arch # @@ -45,6 +47,7 @@ endif() message(STATUS "Target ............ ${TARGET_ARCH}") set(CMAKE_C_LIBRARY_ARCHITECTURE ${TARGET_ARCH}) +set(CMAKE_CXX_LIBRARY_ARCHITECTURE ${TARGET_ARCH}) set(CMAKE_LIBRARY_ARCHITECTURE ${TARGET_ARCH}) if(MSVC) @@ -68,28 +71,26 @@ message(STATUS "Install Path ${CMAKE_INSTALL_PREFIX}") ################################# # configuration features # ################################# -if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") - check_include_file(errno.h HAVE_ERRNO_H) - check_include_file(inttypes.h HAVE_INTTYPES_H) - check_include_file(memory.h HAVE_MEMORY_H) - check_include_file(signal.h HAVE_SIGNAL_H) - check_include_file(stdint.h HAVE_STDINT_H) - check_include_file(stdlib.h HAVE_STDLIB_H) - check_include_file(strings.h HAVE_STRINGS_H) - check_include_file(string.h HAVE_STRING_H) - check_include_file(sys/stat.h HAVE_SYS_STAT_H) - check_include_file(sys/types.h HAVE_SYS_TYPES_H) - check_include_file(time.h HAVE_TIME_H) - check_include_file(unistd.h HAVE_UNISTD_H) - check_function_exists(calloc HAVE_CALLOC) - check_type_size(sigset_t HAVE_SIGSET_T) - check_type_size("struct timespec" HAVE_STRUCT_TIMESPEC) - check_symbol_exists(_beginthreadex process.h HAVE__BEGINTHREADEX) - check_symbol_exists(DuplicateHandle windows.h HAVE_DUPLICATEHANDLE) - - create_config_h_in() - configure_file("${CMAKE_BINARY_DIR}/config.h.in" "${CMAKE_SOURCE_DIR}/config.h") -endif (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") +check_include_file(errno.h HAVE_ERRNO_H) +check_include_file(inttypes.h HAVE_INTTYPES_H) +check_include_file(memory.h HAVE_MEMORY_H) +check_include_file(signal.h HAVE_SIGNAL_H) +check_include_file(stdint.h HAVE_STDINT_H) +check_include_file(stdlib.h HAVE_STDLIB_H) +check_include_file(strings.h HAVE_STRINGS_H) +check_include_file(string.h HAVE_STRING_H) +check_include_file(sys/stat.h HAVE_SYS_STAT_H) +check_include_file(sys/types.h HAVE_SYS_TYPES_H) +check_include_file(time.h HAVE_TIME_H) +check_include_file(unistd.h HAVE_UNISTD_H) +check_function_exists(calloc HAVE_CALLOC) +check_type_size(sigset_t HAVE_SIGSET_T) +check_type_size("struct timespec" HAVE_STRUCT_TIMESPEC) +check_symbol_exists(_beginthreadex process.h HAVE__BEGINTHREADEX) +check_symbol_exists(DuplicateHandle windows.h HAVE_DUPLICATEHANDLE) + +create_config_h_in() +configure_file("${CMAKE_BINARY_DIR}/config.h.in" "${CMAKE_BINARY_DIR}/config.h") ################################# diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e96d10b..bb5cfff 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -75,13 +75,13 @@ function(add_testcase test type def) endif () add_dependencies(${dll_test} ${dll_lib}) - if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + if (${CMAKE_GENERATOR} MATCHES "Visual Studio") install( - FILES ${CMAKE_BINARY_DIR}/$/tests/${lib_test}.exe + FILES "${CMAKE_BINARY_DIR}/tests/$/${lib_test}.exe" DESTINATION "${TESTPREFIX}/$/tests" ) install( - FILES ${CMAKE_BINARY_DIR}/$/tests/${dll_test}.exe + FILES "${CMAKE_BINARY_DIR}/tests/$/${dll_test}.exe" DESTINATION "${TESTPREFIX}/$/tests" ) else() From ded980fc6a54dc767e00d49010ba207475d5cd20 Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Tue, 26 Nov 2019 09:14:06 -0800 Subject: [PATCH 94/95] CMake support and Travis CI job --- .gitignore | 3 + .travis.yml | 108 ++++++++ CMakeLists.txt | 155 +++++++++++ ChangeLog | 5 + NOTICE | 24 +- _ptw32.h | 6 +- appveyor.yml | 110 ++++++++ cmake/get_version.cmake | 21 ++ cmake/target_arch.cmake | 36 +++ cmake/version.rc.in | 429 +++++++++++++++++++++++++++++ tests/CMakeLists.txt | 80 ++++++ tests/ChangeLog | 8 + tests/common.mk | 2 +- tests/openmp1.c | 6 +- tests/runorder.mk | 12 +- tests/rwlock7.c | 199 -------------- tests/rwlock7_1.c | 222 --------------- tests/rwlock8.c | 205 -------------- tests/rwlock8_1.c | 228 ---------------- tests/threestage.c | 583 ---------------------------------------- tests/tryentercs.c | 2 +- tests/tryentercs2.c | 2 +- 22 files changed, 970 insertions(+), 1476 deletions(-) create mode 100644 .travis.yml create mode 100644 CMakeLists.txt create mode 100644 appveyor.yml create mode 100644 cmake/get_version.cmake create mode 100644 cmake/target_arch.cmake create mode 100644 cmake/version.rc.in create mode 100644 tests/CMakeLists.txt delete mode 100644 tests/rwlock7.c delete mode 100644 tests/rwlock7_1.c delete mode 100644 tests/rwlock8.c delete mode 100644 tests/rwlock8_1.c delete mode 100644 tests/threestage.c diff --git a/.gitignore b/.gitignore index 0fa70b6..7d7555e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ tests/benchlib.o tests/SIZES.* tests/*.log /.project +build +PTHREADS-BUILT +.vscode \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c4e22c7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,108 @@ +language: shell + +os: windows + +env: + - BUILD_TYPE=Debug VS2017=amd64 TESTING=OFF + - BUILD_TYPE=Release VS2017=amd64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64 TESTING=OFF + + - BUILD_TYPE=Debug VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=Release VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF + - BUILD_TYPE=MinSizeRel VS2017=amd64_x86 TESTING=OFF + + #- BUILD_TYPE=Debug VS2017=amd64_arm TESTING=OFF + #- BUILD_TYPE=Release VS2017=amd64_arm TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm TESTING=OFF + + #- BUILD_TYPE=Debug VS2017=amd64_arm64 TESTING=OFF + #- BUILD_TYPE=Release VS2017=amd64_arm64 TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF + #- BUILD_TYPE=MinSizeRel VS2017=amd64_arm64 TESTING=OFF + +#install: + #- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" + #- mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && pwd + #- travis_retry wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.0-win64-x64.zip + #- echo "615dfb0813443c1ff56ae0e9d6dbfc61 *cmake-3.11.0-win64-x64.zip" > cmake_md5.txt + #- md5sum -c cmake_md5.txt + #- 7z x -y cmake-3.11.0-win64-x64.zip + #- PATH=${DEPS_DIR}/cmake-3.11.0-win64-x64:${DEPS_DIR}/cmake-3.11.0-win64-x64/bin:$PATH + +before_script: + + # document the version + #- cmake --version + #- cmake --help + + # set enviromental variables + - ls "/c/Progra~2/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/" + #vcvars32.bat + #vcvars64.bat + #vcvarsall.bat + #vcvarsamd64_arm.bat + #vcvarsamd64_arm64.bat + #vcvarsamd64_x86.bat + #vcvarsx86_amd64.bat + #vcvarsx86_arm.bat + #vcvarsx86_arm64.bat + #- printenv + + #- msvcenv="__msvc.bat" + #- echo "@echo off" > "$msvcenv" + #- echo "call /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017}" >> "$msvcenv" + #- echo "set" >> "$msvcenv" + #- cmd "/K $msvcenv" + # > "$msenv.tmp" + + #- cat "$msvcenv" + #- rm -f "$msvcenv" + + - printenv + + #- cat "$msenv.tmp" + + #- grep -e '^PATH=' "$msenv.tmp" | \ + #sed \ + #-e 's/\(.*\)=\(.*\)/export \1="\2:$PATH"/g' \ + #-e 's/\([a-zA-Z]\):[\\\/]/\/\1\//g' \ + #-e 's/\\/\//g' -e 's/;\//:\//g' + # > "$msenv" + #- grep -e '^(INCLUDE|LIB|LIBPATH)=' "$msenv.tmp" | sed -e 's/\(.*\)=\(.*\)/export \1="\2"/g' >> "$msenv" + #- rm "$msenv.tmp" + #- cat "$msenv" + #- source "$msenv" + + #- printenv + + - call "c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" ${VS2017} + #- cmd "/K C:\\Progra~2\\Microsoft\ Visual\ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat ${VS2017}" + #- /c/Progra~2/Microsoft\ Visual\ Studio/2017/BuildTools/VC/Auxiliary/Build/vcvarsall.bat ${VS2017} > "$msenv.tmp" + #- cat "$msenv.tmp" + #- printenv + + # Visual Studio 2015 + #- ls "/c/Progra~2/Microsoft Visual Studio 14.0/VC/" + #- /c/Progra~2/Microsoft\ Visual\ Studio\ 14.0/VC/vcvarsall.bat amd64 + + # generate the build files + - cd ${TRAVIS_BUILD_DIR} && mkdir build && cd build + - cmake -G"NMake Makefiles" -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + #-DBUILD_NUMBER=${TRAVIS_BUILD_NUMBER} + #-DDIST_ROOT="${TRAVIS_BUILD_DIR}/build/dist" + #-DENABLE_TESTS=${TESTING} + #.. +script: + - cmake --build . --config ${BUILD_TYPE} --target install + +addons: + coverity_scan: + project: + name: ā€œjwinarske/pthreads4w" + notification_email: joel.winarske@gmail.com + build_command_prepend: "mkdir build && cd build && cmake -DCMAKE_VERBOSE_MAKEFILE=TRUE -DDCMAKE_INSTALL_PREFIX=`pwd`/dist .." + build_command: "cmake --build . --target install" + branch_pattern: coverity_scan diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4e794ff --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,155 @@ +cmake_minimum_required(VERSION 3.11) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "MinSizeRel" CACHE STRING "Choose the type of build, options are: Debug, Release, or MinSizeRel." FORCE) + message(STATUS "No build type specified, defaulting to MinSizeRel.") +endif() + +set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake") + +include (get_version) + +message(STATUS "Generator ......... ${CMAKE_GENERATOR}") +message(STATUS "Build Type ........ ${CMAKE_BUILD_TYPE}") +message(STATUS "Version ........... ${PTHREADS4W_VERSION}") + +project(pthreads4w VERSION ${PTHREADS4W_VERSION} LANGUAGES C) + +set(PTW32_VER ${PROJECT_VERSION_MAJOR}${EXTRAVERSION}) +set(CMAKE_DEBUG_POSTFIX d) + +# Uncomment this if config.h defines RETAIN_WSALASTERROR +#set(XLIBS wsock32.lib) + + +include_directories(.) + +################################# +# Target Arch # +################################# +include (target_arch) + +get_target_arch(TARGET_ARCH) + +if(${TARGET_ARCH} STREQUAL "ARM") + add_definitions(-D__PTW32_ARCHARM -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) +elseif(${TARGET_ARCH} STREQUAL "ARM64") + add_definitions(-D__PTW32_ARCHARM64 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1) +elseif(${TARGET_ARCH} STREQUAL "x86_64") + add_definitions(-D__PTW32_ARCHAMD64) +elseif(${TARGET_ARCH} STREQUAL "x86") + add_definitions(-D__PTW32_ARCHX86) +elseif(${TARGET_ARCH} STREQUAL "x64") + add_definitions(-D__PTW32_ARCHX64) +else() + MESSAGE(ERROR "\"${TARGET_ARCH}\" not supported in version.rc") +endif() +message(STATUS "Target ............ ${TARGET_ARCH}") + +if(MSVC) + message(STATUS "MSVC Version ...... ${MSVC_VERSION}") +endif() + +################################# +# Install Path # +################################# +if(DIST_ROOT) + set(CMAKE_INSTALL_PREFIX "${DIST_ROOT}") +else() + set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/PTHREADS-BUILT") +endif() +message(STATUS "Install Path ${CMAKE_INSTALL_PREFIX}") + + +set(DLLDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/bin) +set(LIBDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/lib) +set(HDRDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/include) +set(TESTDEST ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${CMAKE_BUILD_TYPE}/test) + +################################# +# Defs # +################################# +add_definitions(-D__PTW32_BUILD_INLINED) + +if(MSVC) + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /errorReport:none /nologo ") + + # C++ Exceptions + # (Note: If you are using Microsoft VC++6.0, the library needs to be built + # with /EHa instead of /EHs or else cancellation won't work properly.) + if(MSVC_VERSION EQUAL 1200) + set(VCEFLAGS "/EHa /TP ") + else() + set(VCEFLAGS "/EHs /TP ") + endif() + + add_definitions(-DHAVE_CONFIG_H -D__PTW32_RC_MSC) + +endif() + +# Update filename with proper version info +configure_file(${CMAKE_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_BINARY_DIR}/version.rc @ONLY) + +################################# +# Libraries # +################################# +set(targ_suffix "") +if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(targ_suffix ${CMAKE_DEBUG_POSTFIX}) +endif() + +macro(shared_lib type def) + set(targ pthread${type}${PTW32_VER}) + add_library(${targ} SHARED pthread.c ${CMAKE_BINARY_DIR}/version.rc) + message(STATUS ${targ}) + target_compile_definitions(${targ} PUBLIC "-D${def}") + if(${type} STREQUAL "VCE") + set_target_properties(${targ} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + endif() + if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.dll DESTINATION ${DLLDEST}) + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) + else() + install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.dll DESTINATION ${DLLDEST}) + install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) + endif() +endmacro() + +macro(static_lib type def) + set(targ libpthread${type}${PTW32_VER}) + add_library(${targ} STATIC pthread.c) + message(STATUS ${targ}) + target_compile_definitions(${targ} PUBLIC "-D${def}" -D__PTW32_STATIC_LIB) + if(${type} STREQUAL "VCE") + set_target_properties(${targ} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + endif() + if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) + else() + install(FILES ${CMAKE_BINARY_DIR}/${targ}${targ_suffix}.lib DESTINATION ${LIBDEST}) + endif() +endmacro() + +shared_lib ( VCE __PTW32_CLEANUP_CXX ) +shared_lib ( VSE __PTW32_CLEANUP_SEH ) +shared_lib ( VC __PTW32_CLEANUP_C ) + +static_lib ( VCE __PTW32_CLEANUP_CXX ) +static_lib ( VSE __PTW32_CLEANUP_SEH ) +static_lib ( VC __PTW32_CLEANUP_C ) + +################################# +# Install # +################################# +install(FILES _ptw32.h pthread.h sched.h semaphore.h DESTINATION ${HDRDEST}) + +################################# +# Test # +################################# +option(ENABLE_TESTS "Enable Test code build" FALSE) + +#TODO determine if cross compile... +if(ENABLE_TESTS) + add_subdirectory(tests) +endif() diff --git a/ChangeLog b/ChangeLog index 6f0913e..d37c9b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-11-03 Ross Johnson + + * NOTICE: Remove third party code acknowledgments because files have been + removed from distro. + 2018-08-19 Ross Johnson * context.h (__PTW32_PROCPTR): Added missing '__' prefix for v3. diff --git a/NOTICE b/NOTICE index d73542d..3b99d7b 100644 --- a/NOTICE +++ b/NOTICE @@ -4,26 +4,4 @@ Copyright 1999-2018, Pthreads4w contributors This product includes software developed through the colaborative effort of several individuals, each of whom is listed in the file -CONTRIBUTORS included with this software. - -The following files are not covered under the Copyrights -listed above: - - [1] tests/rwlock7.c - [1] tests/rwlock7_1.c - [1] tests/rwlock8.c - [1] tests/rwlock8_1.c - [2] tests/threestage.c - -[1] The file tests/rwlock7.c and those similarly named are derived from -code written by Dave Butenhof for his book 'Programming With POSIX(R) -Threads'. The original code was obtained by free download from his -website http://home.earthlink.net/~anneart/family/Threads/source.html - -[2] The file tests/threestage.c is taken directly from examples in the -book "Windows System Programming, Edition 4" by Johnson (John) Hart -Session 6, Chapter 10. ThreeStage.c -Several required additional header and source files from the -book examples have been included inline to simplify compilation. -The only modification to the code has been to provide default -values when run without arguments. +CONTRIBUTORS included with this software. \ No newline at end of file diff --git a/_ptw32.h b/_ptw32.h index e638027..5821f94 100644 --- a/_ptw32.h +++ b/_ptw32.h @@ -43,10 +43,10 @@ */ #define __PTW32_VERSION_MAJOR 3 #define __PTW32_VERSION_MINOR 0 -#define __PTW32_VERSION_MICRO 1 +#define __PTW32_VERSION_MICRO 2 #define __PTW32_VERION_BUILD 0 -#define __PTW32_VERSION 3,0,0,1 -#define __PTW32_VERSION_STRING "3, 0, 1, 0\0" +#define __PTW32_VERSION 3,0,2,0 +#define __PTW32_VERSION_STRING "3, 0, 2, 0\0" #if defined(__GNUC__) # pragma GCC system_header diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..2810968 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,110 @@ +version: 3.0.1.{build} + +shallow_clone: true +clone_depth: 1 + +branches: + only: + - cmake + +configuration: +- MinSizeRel +- Release +- Debug + +environment: + DIST_DIR: '%APPVEYOR_BUILD_FOLDER%\dist' + CMAKE_DIST_DIR: C:/projects/pthreads4w/dist + APPVEYOR_SAVE_CACHE_ON_ERROR: true + + matrix: + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + ARCHITECTURE: amd64_x86 + ARCHIVE: VS2015_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: OFF + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + ARCHITECTURE: amd64 + ARCHIVE: VS2015_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: OFF + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' + ARCHITECTURE: amd64_arm + ARCHIVE: VS2015_%CONFIGURATION%_ARM_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: OFF + + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat' + ARCHIVE: VS2017_%CONFIGURATION%_ARM_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: OFF + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat' + ARCHIVE: VS2017_%CONFIGURATION%_ARM64_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: OFF + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat' + ARCHIVE: VS2017_%CONFIGURATION%_x86_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: ON + + - APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' + VCVARSALL: '%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' + ARCHIVE: VS2017_%CONFIGURATION%_x64_%APPVEYOR_BUILD_NUMBER% + GENERATOR: 'NMake Makefiles' + TESTING: ON + +init: + - echo BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% + +install: + + # CMake + - cmake --version + +build: + parallel: true + +build_script: + - if exist "%VCVARSALL%" ( call "%VCVARSALL%" %ARCHITECTURE% ) + + - cd %APPVEYOR_BUILD_FOLDER% + - mkdir build + - cd build + - cmake -G"%GENERATOR%" + -DCMAKE_BUILD_TYPE=%CONFIGURATION% + -DBUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% + -DDIST_ROOT="%CMAKE_DIST_DIR%/%APPVEYOR_BUILD_WORKER_IMAGE%" + -DENABLE_TESTS=%TESTING% + .. + + cmake --build . --config %CONFIGURATION% --target install + +after_build: + - cd %DIST_DIR% + - 7z a -tzip %ARCHIVE%.zip "%APPVEYOR_BUILD_WORKER_IMAGE%" + - certutil -hashfile %ARCHIVE%.zip MD5 > %ARCHIVE%.md5 + +artifacts: + - path: dist\$(ARCHIVE).zip + - path: dist\$(ARCHIVE).md5 + +test: +before_test: + - set PATH=%APPVEYOR_BUILD_FOLDER%\build;%PATH% +test_script: + - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ cd %APPVEYOR_BUILD_FOLDER%\build\tests + - if exist %APPVEYOR_BUILD_FOLDER%\build\tests\ ctest -C %CONFIGURATION% -V +after_test: + # TODO process CTest output diff --git a/cmake/get_version.cmake b/cmake/get_version.cmake new file mode 100644 index 0000000..82e92c7 --- /dev/null +++ b/cmake/get_version.cmake @@ -0,0 +1,21 @@ + +file(READ ${CMAKE_SOURCE_DIR}/_ptw32.h _PTW32_H_CONTENTS) + +string(REGEX MATCH "#define __PTW32_VERSION_MAJOR ([a-zA-Z0-9_]+)" PTW32_VERSION_MAJOR "${_PTW32_H_CONTENTS}") +string(REPLACE "#define __PTW32_VERSION_MAJOR " "" PTW32_VERSION_MAJOR "${PTW32_VERSION_MAJOR}") + +string(REGEX MATCH "#define __PTW32_VERSION_MINOR ([a-zA-Z0-9_]+)" PTW32_VERSION_MINOR "${_PTW32_H_CONTENTS}") +string(REPLACE "#define __PTW32_VERSION_MINOR " "" PTW32_VERSION_MINOR "${PTW32_VERSION_MINOR}") + +string(REGEX MATCH "#define __PTW32_VERSION_MICRO ([a-zA-Z0-9_]+)" PTW32_VERSION_MICRO "${_PTW32_H_CONTENTS}") +string(REPLACE "#define __PTW32_VERSION_MICRO " "" PTW32_VERSION_MICRO "${PTW32_VERSION_MICRO}") + +string(REGEX MATCH "#define __PTW32_VERION_BUILD ([a-zA-Z0-9_]+)" PTW32_VERSION_BUILD "${_PTW32_H_CONTENTS}") +string(REPLACE "#define __PTW32_VERION_BUILD " "" PTW32_VERSION_BUILD "${PTW32_VERSION_BUILD}") + +if(BUILD_NUMBER) + set(PTW32_VERSION_BUILD ${BUILD_NUMBER}) +endif() + +set(PTHREADS4W_VERSION ${PTW32_VERSION_MAJOR}.${PTW32_VERSION_MINOR}.${PTW32_VERSION_MICRO}.${PTW32_VERSION_BUILD}) + diff --git a/cmake/target_arch.cmake b/cmake/target_arch.cmake new file mode 100644 index 0000000..0545044 --- /dev/null +++ b/cmake/target_arch.cmake @@ -0,0 +1,36 @@ + +set(TARGET_ARCH_DETECT_CODE " + + #if defined(_M_ARM) + #error cmake_arch ARM + #elif defined(_M_ARM64) + #error cmake_arch ARM64 + #elif defined(_M_AMD64) + #error cmake_arch x86_64 + #elif defined(_M_X64) + #error cmake_arch x64 + #elif defined(_M_IX86) + #error cmake_arch x86 + #else + #error cmake_arch unknown + #endif +") + +function(get_target_arch out) + + file(WRITE + "${CMAKE_BINARY_DIR}/target_arch_detect.c" + "${TARGET_ARCH_DETECT_CODE}") + + try_run( + run_result_unused compile_result_unused + "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/target_arch_detect.c" + COMPILE_OUTPUT_VARIABLE TARGET_ARCH) + + # parse compiler output + string(REGEX MATCH "cmake_arch ([a-zA-Z0-9_]+)" TARGET_ARCH "${TARGET_ARCH}") + string(REPLACE "cmake_arch " "" TARGET_ARCH "${TARGET_ARCH}") + + set(${out} "${TARGET_ARCH}" PARENT_SCOPE) + +endfunction() diff --git a/cmake/version.rc.in b/cmake/version.rc.in new file mode 100644 index 0000000..0e41fcb --- /dev/null +++ b/cmake/version.rc.in @@ -0,0 +1,429 @@ +/* This is an implementation of the threads API of POSIX 1003.1-2001. + * + * -------------------------------------------------------------------------- + * + * Pthreads4w - POSIX Threads for Windows + * Copyright 1998 John E. Bossom + * Copyright 1999-2018, Pthreads4w contributors + * + * Homepage: https://sourceforge.net/projects/pthreads4w/ + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * + * https://sourceforge.net/p/pthreads4w/wiki/Contributors/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "pthread.h" + +/* + * Note: the correct __PTW32_CLEANUP_* macro must be defined corresponding to + * the definition used for the object file builds. This is done in the + * relevent makefiles for the command line builds, but users should ensure + * that their resource compiler knows what it is too. + * If using the default (no __PTW32_CLEANUP_* defined), pthread.h will define it + * as __PTW32_CLEANUP_C. + */ + +#if defined (__PTW32_RC_MSC) +# if defined (__PTW32_ARCHx64) || defined (__PTW32_ARCHX64) || defined (__PTW32_ARCHAMD64) +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadVC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C x64\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadVCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ x64\0" +# elif defined(__PTW32_CLEANUP_SEH) +# define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH x64\0" +# endif +# elif defined (__PTW32_ARCHx86) || defined (__PTW32_ARCHX86) +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadVC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C x86\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadVCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ x86\0" +# elif defined(__PTW32_CLEANUP_SEH) +# define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH x86\0" +# endif +# elif defined (__PTW32_ARCHARM) || defined (__PTW32_ARCHARM) +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadVC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C ARM\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadVCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ ARM\0" +# elif defined(__PTW32_CLEANUP_SEH) +# define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH ARM\0" +# endif +# elif defined (__PTW32_ARCHARM64) || defined (__PTW32_ARCHARM64) +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadVC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C ARM64\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadVCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C++ ARM64\0" +# elif defined(__PTW32_CLEANUP_SEH) +# define __PTW32_VERSIONINFO_NAME "pthreadVSE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "MS C SEH ARM64\0" +# endif +# endif +#elif defined(__GNUC__) +# if defined(_M_X64) +# define __PTW32_ARCH "x64 (mingw64)" +# else +# define __PTW32_ARCH "x86 (mingw32)" +# endif +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadGC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "GNU C " __PTW32_ARCH "\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadGCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "GNU C++ " __PTW32_ARCH "\0" +# else +# error Resource compiler doesn't know which cleanup style you're using - see version.rc +# endif +#elif defined(__BORLANDC__) +# if defined(_M_X64) +# define __PTW32_ARCH "x64 (Borland)" +# else +# define __PTW32_ARCH "x86 (Borland)" +# endif +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadBC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "BORLAND C " __PTW32_ARCH "\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadBCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "BORLAND C++ " __PTW32_ARCH "\0" +# else +# error Resource compiler doesn't know which cleanup style you're using - see version.rc +# endif +#elif defined(__WATCOMC__) +# if defined(_M_X64) +# define __PTW32_ARCH "x64 (Watcom)" +# else +# define __PTW32_ARCH "x86 (Watcom)" +# endif +# if defined(__PTW32_CLEANUP_C) +# define __PTW32_VERSIONINFO_NAME "pthreadWC@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "WATCOM C " __PTW32_ARCH "\0" +# elif defined(__PTW32_CLEANUP_CXX) +# define __PTW32_VERSIONINFO_NAME "pthreadWCE@PTW32_VER@.DLL\0" +# define __PTW32_VERSIONINFO_DESCRIPTION "WATCOM C++ " __PTW32_ARCH "\0" +# else +# error Resource compiler doesn't know which cleanup style you're using - see version.rc +# endif +#else +# error Resource compiler doesn't know which compiler you're using - see version.rc +#endif + + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __PTW32_VERSION + PRODUCTVERSION __PTW32_VERSION + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "ProductName", "POSIX Threads for Windows\0" + VALUE "ProductVersion", __PTW32_VERSION_STRING + VALUE "FileVersion", __PTW32_VERSION_STRING + VALUE "FileDescription", __PTW32_VERSIONINFO_DESCRIPTION + VALUE "InternalName", __PTW32_VERSIONINFO_NAME + VALUE "OriginalFilename", __PTW32_VERSIONINFO_NAME + VALUE "CompanyName", "Open Source Software community\0" + VALUE "LegalCopyright", "Copyright - Project contributors 1999-2018\0" + VALUE "Comments", "https://sourceforge.net/p/pthreads4w/wiki/Contributors/\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +/* +VERSIONINFO Resource + +The VERSIONINFO resource-definition statement creates a version-information +resource. The resource contains such information about the file as its +version number, its intended operating system, and its original filename. +The resource is intended to be used with the Version Information functions. + +versionID VERSIONINFO fixed-info { block-statement...} + +versionID + Version-information resource identifier. This value must be 1. + +fixed-info + Version information, such as the file version and the intended operating + system. This parameter consists of the following statements. + + + Statement Description + -------------------------------------------------------------------------- + FILEVERSION + version Binary version number for the file. The version + consists of two 32-bit integers, defined by four + 16-bit integers. For example, "FILEVERSION 3,10,0,61" + is translated into two doublewords: 0x0003000a and + 0x0000003d, in that order. Therefore, if version is + defined by the DWORD values dw1 and dw2, they need + to appear in the FILEVERSION statement as follows: + HIWORD(dw1), LOWORD(dw1), HIWORD(dw2), LOWORD(dw2). + PRODUCTVERSION + version Binary version number for the product with which the + file is distributed. The version parameter is two + 32-bit integers, defined by four 16-bit integers. + For more information about version, see the + FILEVERSION description. + FILEFLAGSMASK + fileflagsmask Bits in the FILEFLAGS statement are valid. If a bit + is set, the corresponding bit in FILEFLAGS is valid. + FILEFLAGSfileflags Attributes of the file. The fileflags parameter must + be the combination of all the file flags that are + valid at compile time. For 16-bit Windows, this + value is 0x3f. + FILEOSfileos Operating system for which this file was designed. + The fileos parameter can be one of the operating + system values given in the Remarks section. + FILETYPEfiletype General type of file. The filetype parameter can be + one of the file type values listed in the Remarks + section. + FILESUBTYPE + subtype Function of the file. The subtype parameter is zero + unless the type parameter in the FILETYPE statement + is VFT_DRV, VFT_FONT, or VFT_VXD. For a list of file + subtype values, see the Remarks section. + +block-statement + Specifies one or more version-information blocks. A block can contain + string information or variable information. For more information, see + StringFileInfo Block or VarFileInfo Block. + +Remarks + +To use the constants specified with the VERSIONINFO statement, you must +include the Winver.h or Windows.h header file in the resource-definition file. + +The following list describes the parameters used in the VERSIONINFO statement: + +fileflags + A combination of the following values. + + Value Description + + VS_FF_DEBUG File contains debugging information or is compiled + with debugging features enabled. + VS_FF_PATCHED File has been modified and is not identical to the + original shipping file of the same version number. + VS_FF_PRERELEASE File is a development version, not a commercially + released product. + VS_FF_PRIVATEBUILD File was not built using standard release procedures. + If this value is given, the StringFileInfo block must + contain a PrivateBuild string. + VS_FF_SPECIALBUILD File was built by the original company using standard + release procedures but is a variation of the standard + file of the same version number. If this value is + given, the StringFileInfo block must contain a + SpecialBuild string. + +fileos + One of the following values. + + Value Description + + VOS_UNKNOWN The operating system for which the file was designed + is unknown. + VOS_DOS File was designed for MS-DOS. + VOS_NT File was designed for Windows Server 2003 family, + Windows XP, Windows 2000, or Windows NT. + VOS__WINDOWS16 File was designed for 16-bit Windows. + VOS__WINDOWS32 File was designed for 32-bit Windows. + VOS_DOS_WINDOWS16 File was designed for 16-bit Windows running with + MS-DOS. + VOS_DOS_WINDOWS32 File was designed for 32-bit Windows running with + MS-DOS. + VOS_NT_WINDOWS32 File was designed for Windows Server 2003 family, + Windows XP, Windows 2000, or Windows NT. + + The values 0x00002L, 0x00003L, 0x20000L and 0x30000L are reserved. + +filetype + One of the following values. + + Value Description + + VFT_UNKNOWN File type is unknown. + VFT_APP File contains an application. + VFT_DLL File contains a dynamic-link library (DLL). + VFT_DRV File contains a device driver. If filetype is + VFT_DRV, subtype contains a more specific + description of the driver. + VFT_FONT File contains a font. If filetype is VFT_FONT, + subtype contains a more specific description of the + font. + VFT_VXD File contains a virtual device. + VFT_STATIC_LIB File contains a static-link library. + + All other values are reserved for use by Microsoft. + +subtype + Additional information about the file type. + + If filetype specifies VFT_DRV, this parameter can be one of the + following values. + + Value Description + + VFT2_UNKNOWN Driver type is unknown. + VFT2_DRV_COMM File contains a communications driver. + VFT2_DRV_PRINTER File contains a printer driver. + VFT2_DRV_KEYBOARD File contains a keyboard driver. + VFT2_DRV_LANGUAGE File contains a language driver. + VFT2_DRV_DISPLAY File contains a display driver. + VFT2_DRV_MOUSE File contains a mouse driver. + VFT2_DRV_NETWORK File contains a network driver. + VFT2_DRV_SYSTEM File contains a system driver. + VFT2_DRV_INSTALLABLE File contains an installable driver. + VFT2_DRV_SOUND File contains a sound driver. + VFT2_DRV_VERSIONED_PRINTER File contains a versioned printer driver. + + If filetype specifies VFT_FONT, this parameter can be one of the + following values. + + Value Description + + VFT2_UNKNOWN Font type is unknown. + VFT2_FONT_RASTER File contains a raster font. + VFT2_FONT_VECTOR File contains a vector font. + VFT2_FONT_TRUETYPE File contains a TrueType font. + + If filetype specifies VFT_VXD, this parameter must be the virtual-device + identifier included in the virtual-device control block. + + All subtype values not listed here are reserved for use by Microsoft. + +langID + One of the following language codes. + + Code Language Code Language + + 0x0401 Arabic 0x0415 Polish + 0x0402 Bulgarian 0x0416 Portuguese (Brazil) + 0x0403 Catalan 0x0417 Rhaeto-Romanic + 0x0404 Traditional Chinese 0x0418 Romanian + 0x0405 Czech 0x0419 Russian + 0x0406 Danish 0x041A Croato-Serbian (Latin) + 0x0407 German 0x041B Slovak + 0x0408 Greek 0x041C Albanian + 0x0409 U.S. English 0x041D Swedish + 0x040A Castilian Spanish 0x041E Thai + 0x040B Finnish 0x041F Turkish + 0x040C French 0x0420 Urdu + 0x040D Hebrew 0x0421 Bahasa + 0x040E Hungarian 0x0804 Simplified Chinese + 0x040F Icelandic 0x0807 Swiss German + 0x0410 Italian 0x0809 U.K. English + 0x0411 Japanese 0x080A Mexican Spanish + 0x0412 Korean 0x080C Belgian French + 0x0413 Dutch 0x0C0C Canadian French + 0x0414 Norwegian ā€“ Bokmal 0x100C Swiss French + 0x0810 Swiss Italian 0x0816 Portuguese (Portugal) + 0x0813 Belgian Dutch 0x081A Serbo-Croatian (Cyrillic) + 0x0814 Norwegian ā€“ Nynorsk + +charsetID + One of the following character-set identifiers. + + Identifier Character Set + + 0 7-bit ASCII + 932 Japan (Shift %Gā€“%@ JIS X-0208) + 949 Korea (Shift %Gā€“%@ KSC 5601) + 950 Taiwan (Big5) + 1200 Unicode + 1250 Latin-2 (Eastern European) + 1251 Cyrillic + 1252 Multilingual + 1253 Greek + 1254 Turkish + 1255 Hebrew + 1256 Arabic + +string-name + One of the following predefined names. + + Name Description + + Comments Additional information that should be displayed for + diagnostic purposes. + CompanyName Company that produced the file%Gā€”%@for example, + "Microsoft Corporation" or "Standard Microsystems + Corporation, Inc." This string is required. + FileDescription File description to be presented to users. This + string may be displayed in a list box when the user + is choosing files to install%Gā€”%@for example, + "Keyboard Driver for AT-Style Keyboards". This + string is required. + FileVersion Version number of the file%Gā€”%@for example, + "3.10" or "5.00.RC2". This string is required. + InternalName Internal name of the file, if one exists ā€” for + example, a module name if the file is a dynamic-link + library. If the file has no internal name, this + string should be the original filename, without + extension. This string is required. + LegalCopyright Copyright notices that apply to the file. This + should include the full text of all notices, legal + symbols, copyright dates, and so on ā€” for example, + "Copyright (C) Microsoft Corporation 1990ā€“1999". + This string is optional. + LegalTrademarks Trademarks and registered trademarks that apply to + the file. This should include the full text of all + notices, legal symbols, trademark numbers, and so on. + This string is optional. + OriginalFilename Original name of the file, not including a path. + This information enables an application to determine + whether a file has been renamed by a user. The + format of the name depends on the file system for + which the file was created. This string is required. + PrivateBuild Information about a private version of the file ā€” for + example, "Built by TESTER1 on \TESTBED". This string + should be present only if VS_FF_PRIVATEBUILD is + specified in the fileflags parameter of the root + block. + ProductName Name of the product with which the file is + distributed. This string is required. + ProductVersion Version of the product with which the file is + distributed ā€” for example, "3.10" or "5.00.RC2". + This string is required. + SpecialBuild Text that indicates how this version of the file + differs from the standard version ā€” for example, + "Private build for TESTER1 solving mouse problems + on M250 and M250E computers". This string should be + present only if VS_FF_SPECIALBUILD is specified in + the fileflags parameter of the root block. + */ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..fc8e7fd --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,80 @@ + +include (CTest) + +include_directories(..) + +set(XXLIBS ws2_32.lib) + +set(VCEFLAGS "${VCEFLAGS} -D__PtW32NoCatchWarn") + +macro(add_testcase test type def) + + set(lib_test test-${test}${type}${PTW32_VER}) + set(dll_test test-dll-${test}${type}${PTW32_VER}) + + set(lib_lib libpthread${type}${PTW32_VER}) + set(dll_lib pthread${type}${PTW32_VER}) + + set(c_dep "") + if(${test} MATCHES "benchtest") + set(c_dep "benchlib.c") + endif() + + set(extra "") + if(${test} MATCHES "openmp1") + if(MSVC) + set(extra "/openmp -D_OPENMP") + endif() + endif() + + add_executable(${lib_test} ${test}.c ${c_dep}) + target_link_libraries(${lib_test} ${lib_lib} ${XXLIBS}) + target_compile_definitions(${lib_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") + add_dependencies(${lib_test} ${lib_lib}) + + add_executable(${dll_test} ${test}.c ${c_dep}) + target_link_libraries(${dll_test} ${dll_lib} ${XXLIBS}) + target_compile_definitions(${dll_test} PUBLIC "/nologo -D_CONSOLE -D_MBCS -D${def} ${extra}") + add_dependencies(${dll_test} ${dll_lib}) + + if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/tests/${lib_test}.exe DESTINATION ${TESTDEST}) + install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/tests/${dll_test}.exe DESTINATION ${TESTDEST}) + else() + install(FILES ${CMAKE_BINARY_DIR}/tests/${lib_test}.exe DESTINATION ${TESTDEST}) + install(FILES ${CMAKE_BINARY_DIR}/tests/${dll_test}.exe DESTINATION ${TESTDEST}) + endif() + + if(${type} MATCHES "VCE") + set_target_properties(${lib_test} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + set_target_properties(${dll_test} PROPERTIES COMPILE_FLAGS ${VCEFLAGS}) + endif() + + add_test(NAME ${lib_test} COMMAND ${lib_test}) + add_test(NAME ${dll_test} COMMAND ${dll_test}) + +endmacro() + + +file(GLOB TESTS *.c) + +foreach(t ${TESTS}) + + get_filename_component(test ${t} NAME) + string(REPLACE ".c" "" test "${test}") + + # exclusions + if(${test} STREQUAL "benchlib") + list(REMOVE_ITEM TESTS ${t}) + continue() + elseif(${test} STREQUAL "context2") # SEGFAULT + continue() + elseif(${test} STREQUAL "tryentercs2") # SEGFAULT + continue() + endif() + + add_testcase(${test} VCE __PTW32_CLEANUP_CXX ) + add_testcase(${test} VSE __PTW32_CLEANUP_SEH ) + add_testcase(${test} VC __PTW32_CLEANUP_C ) + +endforeach(t) diff --git a/tests/ChangeLog b/tests/ChangeLog index c4895d0..beda9e3 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2018-08-19 Ross Johnson + + * threestage.c: Delete. + * rwlock7.c: Delete. + * rwlock8.c: Delete. + * rwlock7_1.c: Delete. + * rwlock8_1.c: Delete. + 2018-08-10 Ross Johnson * Makefile (clean): remove *.idb files. diff --git a/tests/common.mk b/tests/common.mk index f6cf9d1..731713d 100644 --- a/tests/common.mk +++ b/tests/common.mk @@ -40,7 +40,7 @@ ALL_KNOWN_TESTS = \ robust1 robust2 robust3 robust4 robust5 \ rwlock1 rwlock2 rwlock3 rwlock4 \ rwlock2_t rwlock3_t rwlock4_t rwlock5_t rwlock6_t rwlock6_t2 \ - rwlock5 rwlock6 rwlock7 rwlock7_1 rwlock8 rwlock8_1 \ + rwlock5 rwlock6 \ self1 self2 \ semaphore1 semaphore2 semaphore3 \ semaphore4 semaphore4t semaphore5 \ diff --git a/tests/openmp1.c b/tests/openmp1.c index b5791e2..30adb33 100755 --- a/tests/openmp1.c +++ b/tests/openmp1.c @@ -88,9 +88,6 @@ int main(int argc, char *argv[]) { pthread_t b_thr; int status; - printf("%s:%d - %s - a_thr:%p - b_thr:%p\n", - __FILE__,__LINE__,__FUNCTION__,a_thr.p,b_thr.p); - status = pthread_create(&a_thr, NULL, _thread, (void*) 1 ); if ( status != 0 ) { printf("Failed to create thread 1\n"); @@ -103,6 +100,9 @@ int main(int argc, char *argv[]) { return (-1); } + printf("%s:%d - %s - a_thr:%p - b_thr:%p\n", + __FILE__,__LINE__,__FUNCTION__,a_thr.p,b_thr.p); + status = pthread_join(a_thr, NULL); if ( status != 0 ) { printf("Failed to join thread 1\n"); diff --git a/tests/runorder.mk b/tests/runorder.mk index 215d7e7..63a428b 100644 --- a/tests/runorder.mk +++ b/tests/runorder.mk @@ -113,7 +113,7 @@ once3.pass: once2.pass once4.pass: once3.pass priority1.pass: join1.pass priority2.pass: priority1.pass barrier3.pass -reinit1.pass: rwlock7.pass +reinit1.pass: rwlock6.pass reuse1.pass: create3.pass reuse2.pass: reuse1.pass robust1.pass: mutex8r.pass @@ -127,13 +127,11 @@ rwlock3.pass: rwlock2.pass join2.pass rwlock4.pass: rwlock3.pass rwlock5.pass: rwlock4.pass rwlock6.pass: rwlock5.pass -rwlock7.pass: rwlock6.pass -rwlock8.pass: rwlock7.pass rwlock2_t.pass: rwlock2.pass -rwlock3_t.pass: rwlock2_t.pass -rwlock4_t.pass: rwlock3_t.pass -rwlock5_t.pass: rwlock4_t.pass -rwlock6_t.pass: rwlock5_t.pass +rwlock3_t.pass: rwlock3.pass rwlock2_t.pass +rwlock4_t.pass: rwlock4.pass rwlock3_t.pass +rwlock5_t.pass: rwlock5.pass rwlock4_t.pass +rwlock6_t.pass: rwlock6.pass rwlock5_t.pass rwlock6_t2.pass: rwlock6_t.pass self1.pass: sizes.pass self2.pass: self1.pass equal1.pass create1.pass diff --git a/tests/rwlock7.c b/tests/rwlock7.c deleted file mode 100644 index 9d58f6e..0000000 --- a/tests/rwlock7.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * rwlock7.c - * - * Hammer on a bunch of rwlocks to test robustness and fairness. - * Printed stats should be roughly even for each thread. - */ - -#include "test.h" -#include - -#ifdef __GNUC__ -#include -#endif - -#define THREADS 5 -#define DATASIZE 7 -#define ITERATIONS 1000000 - -/* - * Keep statistics for each thread. - */ -typedef struct thread_tag { - int thread_num; - pthread_t thread_id; - int updates; - int reads; - int changed; - int seed; -} thread_t; - -/* - * Read-write lock and shared data - */ -typedef struct data_tag { - pthread_rwlock_t lock; - int data; - int updates; -} data_t; - -static thread_t threads[THREADS]; -static data_t data[DATASIZE]; - -/* - * Thread start routine that uses read-write locks - */ -void *thread_routine (void *arg) -{ - thread_t *self = (thread_t*)arg; - int iteration; - int element = 0; - int seed = self->seed; - int interval = 1 + rand_r (&seed) % 71; - - self->changed = 0; - - for (iteration = 0; iteration < ITERATIONS; iteration++) - { - if (iteration % (ITERATIONS / 10) == 0) - { - putchar('.'); - fflush(stdout); - } - /* - * Each "self->interval" iterations, perform an - * update operation (write lock instead of read - * lock). - */ - if ((iteration % interval) == 0) - { - assert(pthread_rwlock_wrlock (&data[element].lock) == 0); - data[element].data = self->thread_num; - data[element].updates++; - self->updates++; - interval = 1 + rand_r (&seed) % 71; - assert(pthread_rwlock_unlock (&data[element].lock) == 0); - } else { - /* - * Look at the current data element to see whether - * the current thread last updated it. Count the - * times, to report later. - */ - assert(pthread_rwlock_rdlock (&data[element].lock) == 0); - - self->reads++; - - if (data[element].data != self->thread_num) - { - self->changed++; - interval = 1 + self->changed % 71; - } - - assert(pthread_rwlock_unlock (&data[element].lock) == 0); - } - - element = (element + 1) % DATASIZE; - - } - - return NULL; -} - -int -main (int argc, char *argv[]) -{ - int count; - int data_count; - int thread_updates = 0; - int data_updates = 0; - int seed = 1; - - __PTW32_STRUCT_TIMEB currSysTime1; - __PTW32_STRUCT_TIMEB currSysTime2; - - /* - * Initialize the shared data. - */ - for (data_count = 0; data_count < DATASIZE; data_count++) - { - data[data_count].data = 0; - data[data_count].updates = 0; - - assert(pthread_rwlock_init (&data[data_count].lock, NULL) == 0); - } - - __PTW32_FTIME(&currSysTime1); - - /* - * Create THREADS threads to access shared data. - */ - for (count = 0; count < THREADS; count++) - { - threads[count].thread_num = count; - threads[count].updates = 0; - threads[count].reads = 0; - threads[count].seed = 1 + rand_r (&seed) % 71; - - assert(pthread_create (&threads[count].thread_id, - NULL, thread_routine, (void*)(size_t)&threads[count]) == 0); - } - - /* - * Wait for all threads to complete, and collect - * statistics. - */ - for (count = 0; count < THREADS; count++) - { - assert(pthread_join (threads[count].thread_id, NULL) == 0); - } - - putchar('\n'); - fflush(stdout); - - for (count = 0; count < THREADS; count++) - { - if (threads[count].changed > 0) - { - printf ("Thread %d found changed elements %d times\n", - count, threads[count].changed); - } - } - - putchar('\n'); - fflush(stdout); - - for (count = 0; count < THREADS; count++) - { - thread_updates += threads[count].updates; - printf ("%02d: seed %d, updates %d, reads %d\n", - count, threads[count].seed, - threads[count].updates, threads[count].reads); - } - - putchar('\n'); - fflush(stdout); - - /* - * Collect statistics for the data. - */ - for (data_count = 0; data_count < DATASIZE; data_count++) - { - data_updates += data[data_count].updates; - printf ("data %02d: value %d, %d updates\n", - data_count, data[data_count].data, data[data_count].updates); - assert(pthread_rwlock_destroy (&data[data_count].lock) == 0); - } - - printf ("%d thread updates, %d data updates\n", - thread_updates, data_updates); - - __PTW32_FTIME(&currSysTime2); - - printf( "\nstart: %ld/%d, stop: %ld/%d, duration:%ld\n", - (long)currSysTime1.time,currSysTime1.millitm, - (long)currSysTime2.time,currSysTime2.millitm, - ((long)((currSysTime2.time*1000+currSysTime2.millitm) - - (currSysTime1.time*1000+currSysTime1.millitm)))); - - return 0; -} diff --git a/tests/rwlock7_1.c b/tests/rwlock7_1.c deleted file mode 100644 index 4e2ea49..0000000 --- a/tests/rwlock7_1.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - * rwlock7_1.c - * - * Hammer on a bunch of rwlocks to test robustness and fairness. - * Printed stats should be roughly even for each thread. - * - * Use CPU affinity to compare against non-affinity rwlock7.c - */ - -#include "test.h" -#include - -#ifdef __GNUC__ -#include -#endif - -#define THREADS 5 -#define DATASIZE 7 -#define ITERATIONS 1000000 - -/* - * Keep statistics for each thread. - */ -typedef struct thread_tag { - int thread_num; - pthread_t thread_id; - cpu_set_t threadCpus; - int updates; - int reads; - int changed; - int seed; -} thread_t; - -/* - * Read-write lock and shared data - */ -typedef struct data_tag { - pthread_rwlock_t lock; - int data; - int updates; -} data_t; - -static thread_t threads[THREADS]; -static data_t data[DATASIZE]; -static cpu_set_t processCpus; -static int cpu_count; - -/* - * Thread start routine that uses read-write locks - */ -void *thread_routine (void *arg) -{ - thread_t *self = (thread_t*)arg; - int iteration; - int element = 0; - int seed = self->seed; - int interval = 1 + rand_r (&seed) % 71; - - /* - * Set each thread to a fixed (different if possible) cpu. - */ - CPU_ZERO(&self->threadCpus); - CPU_SET(self->thread_num%cpu_count, &self->threadCpus); - assert(pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &self->threadCpus) == 0); - - self->changed = 0; - - for (iteration = 0; iteration < ITERATIONS; iteration++) - { - if (iteration % (ITERATIONS / 10) == 0) - { - putchar('.'); - fflush(stdout); - } - /* - * Each "self->interval" iterations, perform an - * update operation (write lock instead of read - * lock). - */ - if ((iteration % interval) == 0) - { - assert(pthread_rwlock_wrlock (&data[element].lock) == 0); - data[element].data = self->thread_num; - data[element].updates++; - self->updates++; - interval = 1 + rand_r (&seed) % 71; - assert(pthread_rwlock_unlock (&data[element].lock) == 0); - } else { - /* - * Look at the current data element to see whether - * the current thread last updated it. Count the - * times, to report later. - */ - assert(pthread_rwlock_rdlock (&data[element].lock) == 0); - - self->reads++; - - if (data[element].data != self->thread_num) - { - self->changed++; - interval = 1 + self->changed % 71; - } - - assert(pthread_rwlock_unlock (&data[element].lock) == 0); - } - - element = (element + 1) % DATASIZE; - - } - - return NULL; -} - -int -main (int argc, char *argv[]) -{ - int count; - int data_count; - int thread_updates = 0; - int data_updates = 0; - int seed = 1; - pthread_t self = pthread_self(); - __PTW32_STRUCT_TIMEB currSysTime1; - __PTW32_STRUCT_TIMEB currSysTime2; - - if (pthread_getaffinity_np(self, sizeof(cpu_set_t), &processCpus) == ENOSYS) - { - printf("pthread_get/set_affinity_np API not supported for this platform: skipping test."); - return 0; - } - - assert(pthread_getaffinity_np(self, sizeof(cpu_set_t), &processCpus) == 0); - assert((cpu_count = CPU_COUNT(&processCpus)) > 0); - printf("CPUs: %d\n", cpu_count); - - /* - * Initialize the shared data. - */ - for (data_count = 0; data_count < DATASIZE; data_count++) - { - data[data_count].data = 0; - data[data_count].updates = 0; - - assert(pthread_rwlock_init (&data[data_count].lock, NULL) == 0); - } - - __PTW32_FTIME(&currSysTime1); - - /* - * Create THREADS threads to access shared data. - */ - for (count = 0; count < THREADS; count++) - { - threads[count].thread_num = count; - threads[count].updates = 0; - threads[count].reads = 0; - threads[count].seed = 1 + rand_r (&seed) % 71; - - assert(pthread_create (&threads[count].thread_id, - NULL, thread_routine, (void*)(size_t)&threads[count]) == 0); - } - - /* - * Wait for all threads to complete, and collect - * statistics. - */ - for (count = 0; count < THREADS; count++) - { - assert(pthread_join (threads[count].thread_id, NULL) == 0); - } - - putchar('\n'); - fflush(stdout); - - for (count = 0; count < THREADS; count++) - { - if (threads[count].changed > 0) - { - printf ("Thread %d found changed elements %d times\n", - count, threads[count].changed); - } - } - - putchar('\n'); - fflush(stdout); - - for (count = 0; count < THREADS; count++) - { - thread_updates += threads[count].updates; - printf ("%02d: seed %d, updates %d, reads %d, cpu %d\n", - count, threads[count].seed, - threads[count].updates, threads[count].reads, - threads[count].thread_num%cpu_count); - } - - putchar('\n'); - fflush(stdout); - - /* - * Collect statistics for the data. - */ - for (data_count = 0; data_count < DATASIZE; data_count++) - { - data_updates += data[data_count].updates; - printf ("data %02d: value %d, %d updates\n", - data_count, data[data_count].data, data[data_count].updates); - assert(pthread_rwlock_destroy (&data[data_count].lock) == 0); - } - - printf ("%d thread updates, %d data updates\n", - thread_updates, data_updates); - - __PTW32_FTIME(&currSysTime2); - - printf( "\nstart: %ld/%d, stop: %ld/%d, duration:%ld\n", - (long)currSysTime1.time,currSysTime1.millitm, - (long)currSysTime2.time,currSysTime2.millitm, - ((long)((currSysTime2.time*1000+currSysTime2.millitm) - - (currSysTime1.time*1000+currSysTime1.millitm)))); - - return 0; -} diff --git a/tests/rwlock8.c b/tests/rwlock8.c deleted file mode 100644 index 301e1ec..0000000 --- a/tests/rwlock8.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * rwlock8.c - * - * Hammer on a bunch of rwlocks to test robustness and fairness. - * Printed stats should be roughly even for each thread. - * - * Yield during each access to exercise lock contention code paths - * more than rwlock7.c does (particularly on uni-processor systems). - */ - -#include "test.h" -#include - -#ifdef __GNUC__ -#include -#endif - -#define THREADS 5 -#define DATASIZE 7 -#define ITERATIONS 100000 - -/* - * Keep statistics for each thread. - */ -typedef struct thread_tag { - int thread_num; - pthread_t thread_id; - int updates; - int reads; - int changed; - int seed; -} thread_t; - -/* - * Read-write lock and shared data - */ -typedef struct data_tag { - pthread_rwlock_t lock; - int data; - int updates; -} data_t; - -static thread_t threads[THREADS]; -static data_t data[DATASIZE]; - -/* - * Thread start routine that uses read-write locks - */ -void *thread_routine (void *arg) -{ - thread_t *self = (thread_t*)arg; - int iteration; - int element = 0; - int seed = self->seed; - int interval = 1 + rand_r (&seed) % 71; - - self->changed = 0; - - for (iteration = 0; iteration < ITERATIONS; iteration++) - { - if (iteration % (ITERATIONS / 10) == 0) - { - putchar('.'); - fflush(stdout); - } - /* - * Each "self->interval" iterations, perform an - * update operation (write lock instead of read - * lock). - */ - if ((iteration % interval) == 0) - { - assert(pthread_rwlock_wrlock (&data[element].lock) == 0); - data[element].data = self->thread_num; - data[element].updates++; - self->updates++; - interval = 1 + rand_r (&seed) % 71; - sched_yield(); - assert(pthread_rwlock_unlock (&data[element].lock) == 0); - } else { - /* - * Look at the current data element to see whether - * the current thread last updated it. Count the - * times, to report later. - */ - assert(pthread_rwlock_rdlock (&data[element].lock) == 0); - - self->reads++; - - if (data[element].data != self->thread_num) - { - self->changed++; - interval = 1 + self->changed % 71; - } - - sched_yield(); - - assert(pthread_rwlock_unlock (&data[element].lock) == 0); - } - - element = (element + 1) % DATASIZE; - - } - - return NULL; -} - -int -main (int argc, char *argv[]) -{ - int count; - int data_count; - int thread_updates = 0; - int data_updates = 0; - int seed = 1; - - __PTW32_STRUCT_TIMEB currSysTime1; - __PTW32_STRUCT_TIMEB currSysTime2; - - /* - * Initialize the shared data. - */ - for (data_count = 0; data_count < DATASIZE; data_count++) - { - data[data_count].data = 0; - data[data_count].updates = 0; - - assert(pthread_rwlock_init (&data[data_count].lock, NULL) == 0); - } - - __PTW32_FTIME(&currSysTime1); - - /* - * Create THREADS threads to access shared data. - */ - for (count = 0; count < THREADS; count++) - { - threads[count].thread_num = count; - threads[count].updates = 0; - threads[count].reads = 0; - threads[count].seed = 1 + rand_r (&seed) % 71; - - assert(pthread_create (&threads[count].thread_id, - NULL, thread_routine, (void*)(size_t)&threads[count]) == 0); - } - - /* - * Wait for all threads to complete, and collect - * statistics. - */ - for (count = 0; count < THREADS; count++) - { - assert(pthread_join (threads[count].thread_id, NULL) == 0); - } - - putchar('\n'); - fflush(stdout); - - for (count = 0; count < THREADS; count++) - { - if (threads[count].changed > 0) - { - printf ("Thread %d found changed elements %d times\n", - count, threads[count].changed); - } - } - - putchar('\n'); - fflush(stdout); - - for (count = 0; count < THREADS; count++) - { - thread_updates += threads[count].updates; - printf ("%02d: seed %d, updates %d, reads %d\n", - count, threads[count].seed, - threads[count].updates, threads[count].reads); - } - - putchar('\n'); - fflush(stdout); - - /* - * Collect statistics for the data. - */ - for (data_count = 0; data_count < DATASIZE; data_count++) - { - data_updates += data[data_count].updates; - printf ("data %02d: value %d, %d updates\n", - data_count, data[data_count].data, data[data_count].updates); - assert(pthread_rwlock_destroy (&data[data_count].lock) == 0); - } - - printf ("%d thread updates, %d data updates\n", - thread_updates, data_updates); - - __PTW32_FTIME(&currSysTime2); - - printf( "\nstart: %ld/%d, stop: %ld/%d, duration:%ld\n", - (long)currSysTime1.time,currSysTime1.millitm, - (long)currSysTime2.time,currSysTime2.millitm, - ((long)((currSysTime2.time*1000+currSysTime2.millitm) - - (currSysTime1.time*1000+currSysTime1.millitm)))); - - return 0; -} diff --git a/tests/rwlock8_1.c b/tests/rwlock8_1.c deleted file mode 100644 index a85f37f..0000000 --- a/tests/rwlock8_1.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * rwlock8.c - * - * Hammer on a bunch of rwlocks to test robustness and fairness. - * Printed stats should be roughly even for each thread. - * - * Yield during each access to exercise lock contention code paths - * more than rwlock7.c does (particularly on uni-processor systems). - * - * Use CPU affinity to compare against non-affinity rwlock8.c - */ - -#include "test.h" -#include - -#ifdef __GNUC__ -#include -#endif - -#define THREADS 5 -#define DATASIZE 7 -#define ITERATIONS 100000 - -/* - * Keep statistics for each thread. - */ -typedef struct thread_tag { - int thread_num; - pthread_t thread_id; - cpu_set_t threadCpus; - int updates; - int reads; - int changed; - int seed; -} thread_t; - -/* - * Read-write lock and shared data - */ -typedef struct data_tag { - pthread_rwlock_t lock; - int data; - int updates; -} data_t; - -static thread_t threads[THREADS]; -static data_t data[DATASIZE]; -static cpu_set_t processCpus; -static int cpu_count; - -/* - * Thread start routine that uses read-write locks - */ -void *thread_routine (void *arg) -{ - thread_t *self = (thread_t*)arg; - int iteration; - int element = 0; - int seed = self->seed; - int interval = 1 + rand_r (&seed) % 71; - - /* - * Set each thread to a fixed (different if possible) cpu. - */ - CPU_ZERO(&self->threadCpus); - CPU_SET(self->thread_num%cpu_count, &self->threadCpus); - assert(pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &self->threadCpus) == 0); - - self->changed = 0; - - for (iteration = 0; iteration < ITERATIONS; iteration++) - { - if (iteration % (ITERATIONS / 10) == 0) - { - putchar('.'); - fflush(stdout); - } - /* - * Each "self->interval" iterations, perform an - * update operation (write lock instead of read - * lock). - */ - if ((iteration % interval) == 0) - { - assert(pthread_rwlock_wrlock (&data[element].lock) == 0); - data[element].data = self->thread_num; - data[element].updates++; - self->updates++; - interval = 1 + rand_r (&seed) % 71; - sched_yield(); - assert(pthread_rwlock_unlock (&data[element].lock) == 0); - } else { - /* - * Look at the current data element to see whether - * the current thread last updated it. Count the - * times, to report later. - */ - assert(pthread_rwlock_rdlock (&data[element].lock) == 0); - - self->reads++; - - if (data[element].data != self->thread_num) - { - self->changed++; - interval = 1 + self->changed % 71; - } - - sched_yield(); - - assert(pthread_rwlock_unlock (&data[element].lock) == 0); - } - - element = (element + 1) % DATASIZE; - - } - - return NULL; -} - -int -main (int argc, char *argv[]) -{ - int count; - int data_count; - int thread_updates = 0; - int data_updates = 0; - int seed = 1; - pthread_t self = pthread_self(); - __PTW32_STRUCT_TIMEB currSysTime1; - __PTW32_STRUCT_TIMEB currSysTime2; - - if (pthread_getaffinity_np(self, sizeof(cpu_set_t), &processCpus) == ENOSYS) - { - printf("pthread_get/set_affinity_np API not supported for this platform: skipping test."); - return 0; - } - - assert(pthread_getaffinity_np(self, sizeof(cpu_set_t), &processCpus) == 0); - assert((cpu_count = CPU_COUNT(&processCpus)) > 0); - printf("CPUs: %d\n", cpu_count); - - /* - * Initialize the shared data. - */ - for (data_count = 0; data_count < DATASIZE; data_count++) - { - data[data_count].data = 0; - data[data_count].updates = 0; - - assert(pthread_rwlock_init (&data[data_count].lock, NULL) == 0); - } - - __PTW32_FTIME(&currSysTime1); - - /* - * Create THREADS threads to access shared data. - */ - for (count = 0; count < THREADS; count++) - { - threads[count].thread_num = count; - threads[count].updates = 0; - threads[count].reads = 0; - threads[count].seed = 1 + rand_r (&seed) % 71; - - assert(pthread_create (&threads[count].thread_id, - NULL, thread_routine, (void*)(size_t)&threads[count]) == 0); - } - - /* - * Wait for all threads to complete, and collect - * statistics. - */ - for (count = 0; count < THREADS; count++) - { - assert(pthread_join (threads[count].thread_id, NULL) == 0); - } - - putchar('\n'); - fflush(stdout); - - for (count = 0; count < THREADS; count++) - { - if (threads[count].changed > 0) - { - printf ("Thread %d found changed elements %d times\n", - count, threads[count].changed); - } - } - - putchar('\n'); - fflush(stdout); - - for (count = 0; count < THREADS; count++) - { - thread_updates += threads[count].updates; - printf ("%02d: seed %d, updates %d, reads %d, cpu %d\n", - count, threads[count].seed, - threads[count].updates, threads[count].reads, - threads[count].thread_num%cpu_count); - } - - putchar('\n'); - fflush(stdout); - - /* - * Collect statistics for the data. - */ - for (data_count = 0; data_count < DATASIZE; data_count++) - { - data_updates += data[data_count].updates; - printf ("data %02d: value %d, %d updates\n", - data_count, data[data_count].data, data[data_count].updates); - assert(pthread_rwlock_destroy (&data[data_count].lock) == 0); - } - - printf ("%d thread updates, %d data updates\n", - thread_updates, data_updates); - - __PTW32_FTIME(&currSysTime2); - - printf( "\nstart: %ld/%d, stop: %ld/%d, duration:%ld\n", - (long)currSysTime1.time,currSysTime1.millitm, - (long)currSysTime2.time,currSysTime2.millitm, - ((long)((currSysTime2.time*1000+currSysTime2.millitm) - - (currSysTime1.time*1000+currSysTime1.millitm)))); - - return 0; -} diff --git a/tests/threestage.c b/tests/threestage.c deleted file mode 100644 index cd607f0..0000000 --- a/tests/threestage.c +++ /dev/null @@ -1,583 +0,0 @@ -/* - This source code is taken directly from examples in the book - Windows System Programming, Edition 4 by Johnson (John) Hart - - Session 6, Chapter 10. ThreeStage.c - - Several required additional header and source files from the - book examples have been included inline to simplify building. - The only modification to the code has been to provide default - values when run without arguments. - - Three-stage Producer Consumer system - Other files required in this project, either directly or - in the form of libraries (DLLs are preferable) - QueueObj.c (inlined here) - Messages.c (inlined here) - - Usage: ThreeStage npc goal [display] - start up "npc" paired producer and consumer threads. - Display messages if "display" is non-zero - Each producer must produce a total of - "goal" messages, where each message is tagged - with the consumer that should receive it - Messages are sent to a "transmitter thread" which performs - additional processing before sending message groups to the - "receiver thread." Finally, the receiver thread sends - the messages to the consumer threads. - - Transmitter: Receive messages one at a time from producers, - create a transmission message of up to "TBLOCK_SIZE" messages - to be sent to the Receiver. (this could be a network xfer - Receiver: Take message blocks sent by the Transmitter - and send the individual messages to the designated consumer - */ - -/* Suppress warning re use of ctime() */ -#define _CRT_SECURE_NO_WARNINGS 1 - -#include "test.h" -#define sleep(i) Sleep(i*1000) -#ifndef max -#define max(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#define DATA_SIZE 256 -typedef struct msg_block_tag { /* Message block */ - pthread_mutex_t mguard; /* Mutex for the message block */ - pthread_cond_t mconsumed; /* Event: Message consumed; */ - /* Produce a new one or stop */ - pthread_cond_t mready; /* Event: Message ready */ - /* - * Note: the mutex and events are not used by some programs, such - * as Program 10-3, 4, 5 (the multi-stage pipeline) as the messages - * are part of a protected queue - */ - volatile unsigned int source; /* Creating producer identity */ - volatile unsigned int destination;/* Identity of receiving thread*/ - - volatile unsigned int f_consumed; - volatile unsigned int f_ready; - volatile unsigned int f_stop; - /* Consumed & ready state flags, stop flag */ - volatile unsigned int sequence; /* Message block sequence number */ - time_t timestamp; - unsigned int checksum; /* Message contents checksum */ - unsigned int data[DATA_SIZE]; /* Message Contents */ -} msg_block_t; - -void message_fill (msg_block_t *, unsigned int, unsigned int, unsigned int); -void message_display (msg_block_t *); - -#define CV_TIMEOUT 5 /* tunable parameter for the CV model */ - - -/* - Definitions of a synchronized, general bounded queue structure. - Queues are implemented as arrays with indices to youngest - and oldest messages, with wrap around. - Each queue also contains a guard mutex and - "not empty" and "not full" condition variables. - Finally, there is a pointer to an array of messages of - arbitrary type - */ - -typedef struct queue_tag { /* General purpose queue */ - pthread_mutex_t q_guard;/* Guard the message block */ - pthread_cond_t q_ne; /* Event: Queue is not empty */ - pthread_cond_t q_nf; /* Event: Queue is not full */ - /* These two events are manual-reset for the broadcast model - * and auto-reset for the signal model */ - volatile unsigned int q_size; /* Queue max size size */ - volatile unsigned int q_first; /* Index of oldest message */ - volatile unsigned int q_last; /* Index of youngest msg */ - volatile unsigned int q_destroyed;/* Q receiver has terminated */ - void * msg_array; /* array of q_size messages */ -} queue_t; - -/* Queue management functions */ -unsigned int q_initialize (queue_t *, unsigned int, unsigned int); -unsigned int q_destroy (queue_t *); -unsigned int q_destroyed (queue_t *); -unsigned int q_empty (queue_t *); -unsigned int q_full (queue_t *); -unsigned int q_get (queue_t *, void *, unsigned int, unsigned int); -unsigned int q_put (queue_t *, void *, unsigned int, unsigned int); -unsigned int q_remove (queue_t *, void *, unsigned int); -unsigned int q_insert (queue_t *, void *, unsigned int); - -#include -#include -#include - -#define DELAY_COUNT 1000 -#define MAX_THREADS 1024 - -/* Queue lengths and blocking factors. These numbers are arbitrary and */ -/* can be adjusted for performance tuning. The current values are */ -/* not well balanced. */ - -#define TBLOCK_SIZE 5 /* Transmitter combines this many messages at at time */ -#define Q_TIMEOUT 2000 /* Transmiter and receiver timeout (ms) waiting for messages */ -//#define Q_TIMEOUT INFINITE -#define MAX_RETRY 5 /* Number of q_get retries before quitting */ -#define P2T_QLEN 10 /* Producer to Transmitter queue length */ -#define T2R_QLEN 4 /* Transmitter to Receiver queue length */ -#define R2C_QLEN 4 /* Receiver to Consumer queue length - there is one - * such queue for each consumer */ - -void * producer (void *); -void * consumer (void *); -void * transmitter (void *); -void * receiver (void *); - - -typedef struct _THARG { - volatile unsigned int thread_number; - volatile unsigned int work_goal; /* used by producers */ - volatile unsigned int work_done; /* Used by producers and consumers */ -} THARG; - - -/* Grouped messages sent by the transmitter to receiver */ -typedef struct T2R_MSG_TYPEag { - volatile unsigned int num_msgs; /* Number of messages contained */ - msg_block_t messages [TBLOCK_SIZE]; -} T2R_MSG_TYPE; - -queue_t p2tq, t2rq, *r2cq_array; - -/* ShutDown, AllProduced are global flags to shut down the system & transmitter */ -static volatile unsigned int ShutDown = 0; -static volatile unsigned int AllProduced = 0; -static unsigned int DisplayMessages = 0; - -int main (int argc, char * argv[]) -{ - unsigned int tstatus = 0, nthread, ithread, goal, thid; - pthread_t *producer_th, *consumer_th, transmitter_th, receiver_th; - THARG *producer_arg, *consumer_arg; - - if (argc < 3) { - nthread = 32; - goal = 1000; - } else { - nthread = atoi(argv[1]); - goal = atoi(argv[2]); - if (argc >= 4) - DisplayMessages = atoi(argv[3]); - } - - srand ((int)time(NULL)); /* Seed the RN generator */ - - if (nthread > MAX_THREADS) { - printf ("Maximum number of producers or consumers is %d.\n", MAX_THREADS); - return 2; - } - producer_th = (pthread_t *) malloc (nthread * sizeof(pthread_t)); - producer_arg = (THARG *) calloc (nthread, sizeof (THARG)); - consumer_th = (pthread_t *) malloc (nthread * sizeof(pthread_t)); - consumer_arg = (THARG *) calloc (nthread, sizeof (THARG)); - - if (producer_th == NULL || producer_arg == NULL - || consumer_th == NULL || consumer_arg == NULL) - perror ("Cannot allocate working memory for threads."); - - q_initialize (&p2tq, sizeof(msg_block_t), P2T_QLEN); - q_initialize (&t2rq, sizeof(T2R_MSG_TYPE), T2R_QLEN); - /* Allocate and initialize Receiver to Consumer queue for each consumer */ - r2cq_array = (queue_t *) calloc (nthread, sizeof(queue_t)); - if (r2cq_array == NULL) perror ("Cannot allocate memory for r2c queues"); - - for (ithread = 0; ithread < nthread; ithread++) { - /* Initialize r2c queue for this consumer thread */ - q_initialize (&r2cq_array[ithread], sizeof(msg_block_t), R2C_QLEN); - /* Fill in the thread arg */ - consumer_arg[ithread].thread_number = ithread; - consumer_arg[ithread].work_goal = goal; - consumer_arg[ithread].work_done = 0; - - tstatus = pthread_create (&consumer_th[ithread], NULL, - consumer, (void *)&consumer_arg[ithread]); - if (tstatus != 0) - perror ("Cannot create consumer thread"); - - producer_arg[ithread].thread_number = ithread; - producer_arg[ithread].work_goal = goal; - producer_arg[ithread].work_done = 0; - tstatus = pthread_create (&producer_th[ithread], NULL, - producer, (void *)&producer_arg[ithread]); - if (tstatus != 0) - perror ("Cannot create producer thread"); - } - - tstatus = pthread_create (&transmitter_th, NULL, transmitter, &thid); - if (tstatus != 0) - perror ("Cannot create tranmitter thread"); - tstatus = pthread_create (&receiver_th, NULL, receiver, &thid); - if (tstatus != 0) - perror ("Cannot create receiver thread"); - - - printf ("BOSS: All threads are running\n"); - /* Wait for the producers to complete */ - /* The implementation allows too many threads for WaitForMultipleObjects */ - /* although you could call WFMO in a loop */ - for (ithread = 0; ithread < nthread; ithread++) { - tstatus = pthread_join (producer_th[ithread], NULL); - if (tstatus != 0) - perror ("Cannot wait for producer thread"); - printf ("BOSS: Producer %d produced %d work units\n", - ithread, producer_arg[ithread].work_done); - } - /* Producers have completed their work. */ - printf ("BOSS: All producers have completed their work.\n"); - AllProduced = 1; - - /* Wait for the consumers to complete */ - for (ithread = 0; ithread < nthread; ithread++) { - tstatus = pthread_join (consumer_th[ithread], NULL); - if (tstatus != 0) - perror ("Cannot wait for consumer thread"); - printf ("BOSS: consumer %d consumed %d work units\n", - ithread, consumer_arg[ithread].work_done); - } - printf ("BOSS: All consumers have completed their work.\n"); - - ShutDown = 1; /* Set a shutdown flag - All messages have been consumed */ - - /* Wait for the transmitter and receiver */ - - tstatus = pthread_join (transmitter_th, NULL); - if (tstatus != 0) - perror ("Failed waiting for transmitter"); - tstatus = pthread_join (receiver_th, NULL); - if (tstatus != 0) - perror ("Failed waiting for receiver"); - - q_destroy (&p2tq); - q_destroy (&t2rq); - for (ithread = 0; ithread < nthread; ithread++) - q_destroy (&r2cq_array[ithread]); - free (r2cq_array); - free (producer_th); - free (consumer_th); - free (producer_arg); - free(consumer_arg); - printf ("System has finished. Shutting down\n"); - return 0; -} - -void * producer (void * arg) -{ - THARG * parg; - unsigned int ithread, tstatus = 0; - msg_block_t msg; - - parg = (THARG *)arg; - ithread = parg->thread_number; - - while (parg->work_done < parg->work_goal && !ShutDown) { - /* Periodically produce work units until the goal is satisfied */ - /* messages receive a source and destination address which are */ - /* the same in this case but could, in general, be different. */ - sleep (rand()/100000000); - message_fill (&msg, ithread, ithread, parg->work_done); - - /* put the message in the queue - Use an infinite timeout to assure - * that the message is inserted, even if consumers are delayed */ - tstatus = q_put (&p2tq, &msg, sizeof(msg), INFINITE); - if (0 == tstatus) { - parg->work_done++; - } - } - - return 0; -} - -void * consumer (void * arg) -{ - THARG * carg; - unsigned int tstatus = 0, ithread, Retries = 0; - msg_block_t msg; - queue_t *pr2cq; - - carg = (THARG *) arg; - ithread = carg->thread_number; - - carg = (THARG *)arg; - pr2cq = &r2cq_array[ithread]; - - while (carg->work_done < carg->work_goal && Retries < MAX_RETRY && !ShutDown) { - /* Receive and display/process messages */ - /* Try to receive the requested number of messages, - * but allow for early system shutdown */ - - tstatus = q_get (pr2cq, &msg, sizeof(msg), Q_TIMEOUT); - if (0 == tstatus) { - if (DisplayMessages > 0) message_display (&msg); - carg->work_done++; - Retries = 0; - } else { - Retries++; - } - } - - return NULL; -} - -void * transmitter (void * arg) -{ - - /* Obtain multiple producer messages, combining into a single */ - /* compound message for the receiver */ - - unsigned int tstatus = 0, im, Retries = 0; - T2R_MSG_TYPE t2r_msg = {0}; - msg_block_t p2t_msg; - - while (!ShutDown && !AllProduced) { - t2r_msg.num_msgs = 0; - /* pack the messages for transmission to the receiver */ - im = 0; - while (im < TBLOCK_SIZE && !ShutDown && Retries < MAX_RETRY && !AllProduced) { - tstatus = q_get (&p2tq, &p2t_msg, sizeof(p2t_msg), Q_TIMEOUT); - if (0 == tstatus) { - memcpy (&t2r_msg.messages[im], &p2t_msg, sizeof(p2t_msg)); - t2r_msg.num_msgs++; - im++; - Retries = 0; - } else { /* Timed out. */ - Retries++; - } - } - tstatus = q_put (&t2rq, &t2r_msg, sizeof(t2r_msg), INFINITE); - if (tstatus != 0) return NULL; - } - return NULL; -} - - -void * receiver (void * arg) -{ - /* Obtain compound messages from the transmitter and unblock them */ - /* and transmit to the designated consumer. */ - - unsigned int tstatus = 0, im, ic, Retries = 0; - T2R_MSG_TYPE t2r_msg; - msg_block_t r2c_msg; - - while (!ShutDown && Retries < MAX_RETRY) { - tstatus = q_get (&t2rq, &t2r_msg, sizeof(t2r_msg), Q_TIMEOUT); - if (tstatus != 0) { /* Timeout - Have the producers shut down? */ - Retries++; - continue; - } - Retries = 0; - /* Distribute the packaged messages to the proper consumer */ - im = 0; - while (im < t2r_msg.num_msgs) { - memcpy (&r2c_msg, &t2r_msg.messages[im], sizeof(r2c_msg)); - ic = r2c_msg.destination; /* Destination consumer */ - tstatus = q_put (&r2cq_array[ic], &r2c_msg, sizeof(r2c_msg), INFINITE); - if (0 == tstatus) im++; - } - } - return NULL; -} - -#if (!defined INFINITE) -#define INFINITE 0xFFFFFFFF -#endif - -/* - Finite bounded queue management functions - q_get, q_put timeouts (max_wait) are in ms - convert to sec, rounding up - */ -unsigned int q_get (queue_t *q, void * msg, unsigned int msize, unsigned int MaxWait) -{ - int tstatus = 0, got_msg = 0, time_inc = (MaxWait + 999) /1000; - struct timespec timeout; - timeout.tv_nsec = 0; - - if (q_destroyed(q)) return 1; - pthread_mutex_lock (&q->q_guard); - while (q_empty (q) && 0 == tstatus) { - if (MaxWait != INFINITE) { - timeout.tv_sec = time(NULL) + time_inc; - tstatus = pthread_cond_timedwait (&q->q_ne, &q->q_guard, &timeout); - } else { - tstatus = pthread_cond_wait (&q->q_ne, &q->q_guard); - } - } - /* remove the message, if any, from the queue */ - if (0 == tstatus && !q_empty (q)) { - q_remove (q, msg, msize); - got_msg = 1; - /* Signal that the queue is not full as we've removed a message */ - pthread_cond_broadcast (&q->q_nf); - } - pthread_mutex_unlock (&q->q_guard); - return (0 == tstatus && got_msg == 1 ? 0 : max(1, tstatus)); /* 0 indicates success */ -} - -unsigned int q_put (queue_t *q, void * msg, unsigned int msize, unsigned int MaxWait) -{ - int tstatus = 0, put_msg = 0, time_inc = (MaxWait + 999) /1000; - struct timespec timeout; - timeout.tv_nsec = 0; - - if (q_destroyed(q)) return 1; - pthread_mutex_lock (&q->q_guard); - while (q_full (q) && 0 == tstatus) { - if (MaxWait != INFINITE) { - timeout.tv_sec = time(NULL) + time_inc; - tstatus = pthread_cond_timedwait (&q->q_nf, &q->q_guard, &timeout); - } else { - tstatus = pthread_cond_wait (&q->q_nf, &q->q_guard); - } - } - /* Insert the message into the queue if there's room */ - if (0 == tstatus && !q_full (q)) { - q_insert (q, msg, msize); - put_msg = 1; - /* Signal that the queue is not empty as we've inserted a message */ - pthread_cond_broadcast (&q->q_ne); - } - pthread_mutex_unlock (&q->q_guard); - return (0 == tstatus && put_msg == 1 ? 0 : max(1, tstatus)); /* 0 indictates success */ -} - -unsigned int q_initialize (queue_t *q, unsigned int msize, unsigned int nmsgs) -{ - /* Initialize queue, including its mutex and events */ - /* Allocate storage for all messages. */ - - q->q_first = q->q_last = 0; - q->q_size = nmsgs; - q->q_destroyed = 0; - - pthread_mutex_init (&q->q_guard, NULL); - pthread_cond_init (&q->q_ne, NULL); - pthread_cond_init (&q->q_nf, NULL); - - if ((q->msg_array = calloc (nmsgs, msize)) == NULL) return 1; - return 0; /* No error */ -} - -unsigned int q_destroy (queue_t *q) -{ - if (q_destroyed(q)) return 1; - /* Free all the resources created by q_initialize */ - pthread_mutex_lock (&q->q_guard); - q->q_destroyed = 1; - free (q->msg_array); - pthread_cond_destroy (&q->q_ne); - pthread_cond_destroy (&q->q_nf); - pthread_mutex_unlock (&q->q_guard); - pthread_mutex_destroy (&q->q_guard); - - return 0; -} - -unsigned int q_destroyed (queue_t *q) -{ - return (q->q_destroyed); -} - -unsigned int q_empty (queue_t *q) -{ - return (q->q_first == q->q_last); -} - -unsigned int q_full (queue_t *q) -{ - return ((q->q_first - q->q_last) == 1 || - (q->q_last == q->q_size-1 && q->q_first == 0)); -} - - -unsigned int q_remove (queue_t *q, void * msg, unsigned int msize) -{ - char *pm; - - pm = (char *)q->msg_array; - /* Remove oldest ("first") message */ - memcpy (msg, pm + (q->q_first * msize), msize); - // Invalidate the message - q->q_first = ((q->q_first + 1) % q->q_size); - return 0; /* no error */ -} - -unsigned int q_insert (queue_t *q, void * msg, unsigned int msize) -{ - char *pm; - - pm = (char *)q->msg_array; - /* Add a new youngest ("last") message */ - if (q_full(q)) return 1; /* Error - Q is full */ - memcpy (pm + (q->q_last * msize), msg, msize); - q->q_last = ((q->q_last + 1) % q->q_size); - - return 0; -} - -unsigned int compute_checksum (void * msg, unsigned int length) -{ - /* Computer an xor checksum on the entire message of "length" - * integers */ - unsigned int i, cs = 0, *pint; - - pint = (unsigned int *) msg; - for (i = 0; i < length; i++) { - cs = (cs ^ *pint); - pint++; - } - return cs; -} - -void message_fill (msg_block_t *mblock, unsigned int src, unsigned int dest, unsigned int seqno) -{ - /* Fill the message buffer, and include checksum and timestamp */ - /* This function is called from the producer thread while it */ - /* owns the message block mutex */ - - unsigned int i; - - mblock->checksum = 0; - for (i = 0; i < DATA_SIZE; i++) { - mblock->data[i] = rand(); - } - mblock->source = src; - mblock->destination = dest; - mblock->sequence = seqno; - mblock->timestamp = time(NULL); - mblock->checksum = compute_checksum (mblock, sizeof(msg_block_t)/sizeof(unsigned int)); - /* printf ("Generated message: %d %d %d %d %x %x\n", - src, dest, seqno, mblock->timestamp, - mblock->data[0], mblock->data[DATA_SIZE-1]); */ - return; -} - -void message_display (msg_block_t *mblock) -{ - /* Display message buffer and timestamp, validate checksum */ - /* This function is called from the consumer thread while it */ - /* owns the message block mutex */ - unsigned int tcheck = 0; - - tcheck = compute_checksum (mblock, sizeof(msg_block_t)/sizeof(unsigned int)); - printf ("\nMessage number %d generated at: %s", - mblock->sequence, ctime (&(mblock->timestamp))); - printf ("Source and destination: %d %d\n", - mblock->source, mblock->destination); - printf ("First and last entries: %x %x\n", - mblock->data[0], mblock->data[DATA_SIZE-1]); - if (tcheck == 0 /*mblock->checksum was 0 when CS first computed */) - printf ("GOOD ->Checksum was validated.\n"); - else - printf ("BAD ->Checksum failed. message was corrupted\n"); - - return; - -} diff --git a/tests/tryentercs.c b/tests/tryentercs.c index 51154e6..15d1420 100644 --- a/tests/tryentercs.c +++ b/tests/tryentercs.c @@ -66,7 +66,7 @@ main() */ _h_kernel32 = LoadLibrary(TEXT("KERNEL32.DLL")); _try_enter_critical_section = - (BOOL (PT_STDCALL *)(LPCRITICAL_SECTION)) + (BOOL (WINAPI *)(LPCRITICAL_SECTION)) GetProcAddress(_h_kernel32, (LPCSTR) "TryEnterCriticalSection"); diff --git a/tests/tryentercs2.c b/tests/tryentercs2.c index a747b0f..50c540a 100644 --- a/tests/tryentercs2.c +++ b/tests/tryentercs2.c @@ -65,7 +65,7 @@ main() */ _h_kernel32 = LoadLibrary(TEXT("KERNEL32.DLL")); _try_enter_critical_section = - (BOOL (PT_STDCALL *)(LPCRITICAL_SECTION)) + (BOOL (WINAPI *)(LPCRITICAL_SECTION)) GetProcAddress(_h_kernel32, (LPCSTR) "TryEnterCriticalSection"); From 67d12ad1cd3db366f61689b20c78c208dcdad94e Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Fri, 26 Jun 2020 14:09:02 -0700 Subject: [PATCH 95/95] Install MSVC PDB for Debug builds. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2edff4..ac75ed8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,6 +154,13 @@ function(shared_lib type def) LIBRARY # DESTINATION ${TARGET_ARCH}/${CONFIG}/lib RUNTIME # DESTINATION ${TARGET_ARCH}/${CONFIG}/bin ) + + install( + FILES $ + CONFIGURATION Debug + DESTINATION lib + OPTIONAL + ) endfunction() function(static_lib type def)