From 2c34f378283ad89437b2ae1fee89de7c767ea908 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sun, 25 Oct 2020 22:37:58 +1300 Subject: [PATCH 1/5] re-enable windows (no python) and check for toplevel Signed-off-by: Kimball Thurston --- .github/workflows/ci_workflow.yml | 165 ++++++++++++++---------------- CMakeLists.txt | 18 ++-- config/ImathSetup.cmake | 2 +- src/ImathTest/CMakeLists.txt | 2 +- 4 files changed, 90 insertions(+), 97 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index dfda3ee8..a8dcd471 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -308,52 +308,40 @@ jobs: # TODO: Determine why tests hang in Debug job. # TODO: Fix boost script to install from sourceforge. - # windows: - # name: 'Windows 2019 - # ' - # runs-on: windows-2019 - # strategy: - # matrix: - # build: [1, 3, 4] - # include: - # # C++11, Python 3.7 - # - build: 1 - # build-type: Release - # build-shared: 'ON' - # build-docs: 'ON' - # cxx-standard: 11 - # python-version: 3.7.7 - # boost-version: 1.70.0 - # zlib-version: 1.2.11 - # zlib-lib: zlib.lib - # exclude-tests: '' - # # Debug - - # # - build: 2 - # # build-type: Debug - # # build-shared: 'ON' - # # build-docs: 'OFF' - # # cxx-standard: 11 - # # python-version: 3.7.7 - # # boost-version: 1.70.0 - # # zlib-version: 1.2.11 - # # zlib-lib: zlib.lib - # # exclude-tests: '' - # # C++14 - # - build: 3 - # build-type: Release - # build-shared: 'ON' - # build-docs: 'OFF' - # cxx-standard: 14 - # python-version: 3.7.7 - # boost-version: 1.70.0 - # zlib-version: 1.2.11 - # zlib-lib: zlib.lib - # exclude-tests: '' + windows: + name: 'Windows 2019 + ' + runs-on: windows-2019 + strategy: + matrix: + build: [1, 2, 3] + include: + # C++11, Python 3.7 + - build: 1 + build-type: Release + build-shared: 'ON' + build-docs: 'ON' + cxx-standard: 11 + exclude-tests: + # Debug - + - build: 2 + build-type: Debug + build-shared: 'ON' + build-docs: 'OFF' + cxx-standard: 11 + exclude-tests: + # C++14 + - build: 3 + build-type: Release + build-shared: 'ON' + build-docs: 'OFF' + cxx-standard: 14 + exclude-tests: # # Static # - build: 4 # build-type: Release @@ -366,55 +354,56 @@ jobs: # zlib-lib: zlibstatic.lib # exclude-tests: '' - # steps: + steps: # - name: Setup Python # uses: actions/setup-python@v1 # with: # python-version: ${{ matrix.python-version }} - # - name: Checkout - # uses: actions/checkout@v2 - # - name: Create build directories - # run: | - # mkdir _install - # mkdir _build - # shell: bash + - name: Checkout + uses: actions/checkout@v2 + - name: Create build directories + run: | + mkdir _install + mkdir _build + shell: bash # - name: Install Dependences # run: | # share/ci/scripts/windows/install_python.ps1 ${{ matrix.python-version }} $HOME # share/ci/scripts/windows/install_boost.ps1 ${{ matrix.boost-version }} $HOME 3.8 # share/ci/scripts/windows/install_zlib.ps1 ${{ matrix.zlib-version }} $HOME # shell: powershell - # - name: Configure - # run: | - # cmake ../. \ - # -DCMAKE_INSTALL_PREFIX=../_install \ - # -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ - # -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ - # -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ - # -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ - # -DBOOST_ROOT:FILEPATH=$BOOST_ROOT \ - # -DZLIB_ROOT:FILEPATH="$ZLIB_ROOT" \ - # -DZLIB_LIBRARY:FILEPATH="$ZLIB_ROOT/lib/${{ matrix.zlib-lib }}" \ - # -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \ - # -DPYTHON='ON'\ - # # -DPython_EXECUTABLE:FILEPATH="$PYTHON_ROOT" \ - # # -DPython_INCLUDE_DIR:FILEPATH="$PYTHON_ROOT/include" \ - # # -DPython_LIBRARY:"$PYTHON_ROOT\libs" \ - # shell: bash - # working-directory: _build - # - name: Build - # run: | - # cmake --build . \ - # --target install \ - # --config ${{ matrix.build-type }} - # shell: bash - # working-directory: _build - # - name: Test - # run: | - # ctest -T Test ${{ matrix.exclude-tests }} \ - # -C ${{ matrix.build-type }} \ - # --timeout 7200 \ - # --output-on-failure \ - # -VV - # shell: bash - # working-directory: _build + - name: Configure + run: | + cmake ../. \ + -DCMAKE_INSTALL_PREFIX=../_install \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ + -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ + -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ + -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} + # NB: removed trailing slash from these lines + # -DBOOST_ROOT:FILEPATH=$BOOST_ROOT + # -DZLIB_ROOT:FILEPATH="$ZLIB_ROOT" + # -DZLIB_LIBRARY:FILEPATH="$ZLIB_ROOT/lib/${{ matrix.zlib-lib }}" + # -DPYTHON='ON' + # -DPython_EXECUTABLE:FILEPATH="$PYTHON_ROOT" + # -DPython_INCLUDE_DIR:FILEPATH="$PYTHON_ROOT/include" + # -DPython_LIBRARY:"$PYTHON_ROOT\libs" + shell: bash + working-directory: _build + - name: Build + run: | + cmake --build . \ + --target install \ + --config ${{ matrix.build-type }} + shell: bash + working-directory: _build + - name: Test + run: | + ctest -T Test ${{ matrix.exclude-tests }} \ + -C ${{ matrix.build-type }} \ + --timeout 7200 \ + --output-on-failure \ + -VV + shell: bash + working-directory: _build diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cf1897e..80278762 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ include(config/LibraryDefine.cmake) # Include these modules without enable/disable options add_subdirectory(src/Imath) + # Tell CMake where to find the ImathConfig.cmake file. Makes it posible to call # find_package(Imath) in downstream projects set(Imath_DIR "${CMAKE_CURRENT_BINARY_DIR}/config" CACHE PATH "" FORCE) @@ -77,14 +78,17 @@ endif() #set(CTEST_DROP_SITE "open.cdash.org") #set(CTEST_DROP_LOCATION "/submit.php?project=MyProject") #set(CTEST_DROP_SITE_CDASH TRUE) +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + include(CTest) -include(CTest) -if(BUILD_TESTING) - enable_testing() - - add_subdirectory(src/ImathTest) + if(BUILD_TESTING) + enable_testing() + add_subdirectory(src/ImathTest) + endif() endif() # Including this module will add a `clang-format` target to the build if -# the clang-format executable can be found. -include(cmake/clang-format.cmake) +# the clang-format executable can be found. Only do this if we are top level +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + include(cmake/clang-format.cmake) +endif() diff --git a/config/ImathSetup.cmake b/config/ImathSetup.cmake index f28a6e79..d7090a4e 100644 --- a/config/ImathSetup.cmake +++ b/config/ImathSetup.cmake @@ -131,6 +131,6 @@ if(NOT TARGET Threads::Threads) set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads) if(NOT Threads_FOUND) - message(FATAL_ERROR "Unable to find a threading library which is required for IlmThread") + message(FATAL_ERROR "Unable to find a threading library which is required for PyImathTask") endif() endif() diff --git a/src/ImathTest/CMakeLists.txt b/src/ImathTest/CMakeLists.txt index 547453f1..b44ac02c 100644 --- a/src/ImathTest/CMakeLists.txt +++ b/src/ImathTest/CMakeLists.txt @@ -36,7 +36,7 @@ add_executable(ImathTest testToFloat.cpp ) -target_link_libraries(ImathTest Imath) +target_link_libraries(ImathTest Imath::Imath) set_target_properties(ImathTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" ) From 9801a28df47c648c3086d0b1e3e3716182a02b6f Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sun, 25 Oct 2020 23:02:42 +1300 Subject: [PATCH 2/5] Remove unused internal config header and options Signed-off-by: Kimball Thurston --- config/CMakeLists.txt | 9 --------- config/ImathConfig.h.in | 4 ---- config/ImathConfigInternal.h.in | 11 ----------- src/Imath/ImathExport.h | 2 +- 4 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 config/ImathConfigInternal.h.in diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index 3828cbd6..d541daf6 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -23,7 +23,6 @@ if (IMATH_ENABLE_LARGE_STACK) set(IMATH_HAVE_LARGE_STACK ON) endif() configure_file(ImathConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/ImathConfig.h) -configure_file(ImathConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/ImathConfigInternal.h) add_library(ImathConfig INTERFACE) target_include_directories(ImathConfig INTERFACE @@ -49,14 +48,6 @@ if(IMATH_INSTALL_PKG_CONFIG) set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") set(LIB_SUFFIX_DASH ${IMATH_LIB_SUFFIX}) - if(TARGET Threads::Threads) - # hrm, can't use properties as they end up as generator expressions - # which don't seem to evaluate - if(THREADS_HAVE_PTHREAD_ARG) - set(PTHREAD_CFLAGS "-pthread") - endif() - set(PTHREAD_LIBS ${CMAKE_THREAD_LIBS_INIT}) - endif() string(REPLACE ".in" "" pcout ${pcinfile}) configure_file(${pcinfile} ${CMAKE_CURRENT_BINARY_DIR}/${pcout} @ONLY) install( diff --git a/config/ImathConfig.h.in b/config/ImathConfig.h.in index 71cc6bf9..f29afe56 100644 --- a/config/ImathConfig.h.in +++ b/config/ImathConfig.h.in @@ -12,10 +12,6 @@ // Options / configuration based on O.S. / compiler ///////////////////// -#cmakedefine HAVE_PTHREAD 1 -#cmakedefine HAVE_POSIX_SEMAPHORES 1 - - // // Define and set to 1 if the target system has support for large // stack sizes. diff --git a/config/ImathConfigInternal.h.in b/config/ImathConfigInternal.h.in deleted file mode 100644 index 8643d637..00000000 --- a/config/ImathConfigInternal.h.in +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// Copyright Contributors to the OpenEXR Project. - -#pragma once - -// -// Dealing with FPEs -// -#cmakedefine HAVE_UCONTEXT_H 1 -#cmakedefine IMATH_HAVE_CONTROL_REGISTER_SUPPORT 1 -#cmakedefine IMATH_HAVE_SIGCONTEXT_CONTROL_REGISTER_SUPPORT 1 diff --git a/src/Imath/ImathExport.h b/src/Imath/ImathExport.h index 3114eb84..7afe9660 100644 --- a/src/Imath/ImathExport.h +++ b/src/Imath/ImathExport.h @@ -32,7 +32,7 @@ // /////////////////////////////////////////////////////////////////////////// -#if defined(OPENEXR_DLL) +#if defined(IMATH_DLL) # if defined(IMATH_EXPORTS) # define IMATH_EXPORT __declspec(dllexport) # define IMATH_EXPORT_CONST extern __declspec(dllexport) From bbfc52229a83a0a7e1dfce21468054fe21d90951 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sun, 25 Oct 2020 23:03:07 +1300 Subject: [PATCH 3/5] Disable python for mac and windows until dependency install is fixed Signed-off-by: Kimball Thurston --- .github/workflows/ci_workflow.yml | 57 +++++++++++++------------------ 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index a8dcd471..7dda9194 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -200,74 +200,61 @@ jobs: # macOS # --------------------------------------------------------------------------- - macos: + macos_no_python: name: 'macOS 10.15 ' runs-on: macos-10.15 strategy: matrix: - build: [1, 2, 3, 4, 5] + build: [1, 2, 3, 4] include: - # C++11, Python 3.7 + # C++11 - build: 1 build-type: Release build-shared: 'ON' build-docs: 'ON' cxx-standard: 11 - python-version: 3.7 - exclude-tests: -E PyImath.*_Python3 + exclude-tests: # Debug - build: 2 build-type: Debug build-shared: 'ON' build-docs: 'OFF' cxx-standard: 11 - python-version: 3.7 - exclude-tests: -E PyImath.*_Python3 + exclude-tests: # C++14 - build: 3 build-type: Release build-shared: 'ON' build-docs: 'OFF' cxx-standard: 14 - python-version: 3.7 - exclude-tests: -E PyImath.*_Python3 + exclude-tests: # Static - build: 4 - build-type: Release + build-type: Debug build-shared: 'OFF' build-docs: 'OFF' cxx-standard: 11 - python-version: 3.7 - exclude-tests: -E "PyImath.*_Python3|PyImath.PyImathTest_Python2" - # Python 2.7 - - build: 5 - build-type: Release - build-shared: 'ON' - build-docs: 'ON' - cxx-standard: 11 - python-version: 2.7 - exclude-tests: -E PyImath.*_Python3 + exclude-tests: steps: - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} + ## - name: Setup Python + ## uses: actions/setup-python@v1 + ## with: + ## python-version: ${{ matrix.python-version }} - name: Checkout uses: actions/checkout@v2 - name: Create build directories run: | mkdir _install mkdir _build - - name: Install Dependences - run: | - share/ci/scripts/macos/install_boost.sh - shell: bash + ## - name: Install Dependences + ## run: | + ## share/ci/scripts/macos/install_boost.sh + ## shell: bash - name: Configure run: | cmake ../. \ @@ -276,10 +263,7 @@ jobs: -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ - -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \ - -DPYTHON='ON'\ - -DPYTHON_EXECUTABLE=$(which python) \ - -DBoost_NO_BOOST_CMAKE=ON + -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} working-directory: _build - name: Build run: | @@ -342,6 +326,13 @@ jobs: build-docs: 'OFF' cxx-standard: 14 exclude-tests: + # C++14, Static + - build: 3 + build-type: Release + build-shared: 'OFF' + build-docs: 'OFF' + cxx-standard: 14 + exclude-tests: # # Static # - build: 4 # build-type: Release From f92c0d3c12d6a530bff27fe6032c473cd26d70d3 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sun, 25 Oct 2020 23:13:10 +1300 Subject: [PATCH 4/5] Fix windows exports after imath / exr split, remove halfExport after directory combine Signed-off-by: Kimball Thurston --- src/Imath/CMakeLists.txt | 1 - src/Imath/ImathMatrixAlgo.cpp | 2 +- src/Imath/half.cpp | 26 +++++++++------ src/Imath/half.h | 28 ++++++++-------- src/Imath/halfExport.h | 50 ---------------------------- src/python/PyImath/PyImathExport.h | 2 +- src/python/config/ModuleDefine.cmake | 2 +- 7 files changed, 33 insertions(+), 78 deletions(-) delete mode 100644 src/Imath/halfExport.h diff --git a/src/Imath/CMakeLists.txt b/src/Imath/CMakeLists.txt index c6ce2be4..c692c67b 100644 --- a/src/Imath/CMakeLists.txt +++ b/src/Imath/CMakeLists.txt @@ -48,6 +48,5 @@ imath_define_library(Imath ImathVec.h half.h halfFunction.h - halfExport.h halfLimits.h ) diff --git a/src/Imath/ImathMatrixAlgo.cpp b/src/Imath/ImathMatrixAlgo.cpp index a57b3d42..edb8a192 100644 --- a/src/Imath/ImathMatrixAlgo.cpp +++ b/src/Imath/ImathMatrixAlgo.cpp @@ -42,7 +42,7 @@ #include #include -#if defined(OPENEXR_DLL) +#if defined(IMATH_DLL) # define EXPORT_CONST __declspec(dllexport) #else # define EXPORT_CONST const diff --git a/src/Imath/half.cpp b/src/Imath/half.cpp index 449fc667..d9d5c6d6 100644 --- a/src/Imath/half.cpp +++ b/src/Imath/half.cpp @@ -48,15 +48,21 @@ using namespace std; +#if defined(IMATH_DLL) +# define EXPORT_CONST __declspec(dllexport) +#else +# define EXPORT_CONST +#endif + //------------------------------------------------------------- // Lookup tables for half-to-float and float-to-half conversion //------------------------------------------------------------- // clang-format off -HALF_EXPORT const half::uif half::_toFloat[1 << 16] = +EXPORT_CONST const half::uif half::_toFloat[1 << 16] = #include "toFloat.h" -HALF_EXPORT const unsigned short half::_eLut[1 << 9] = +EXPORT_CONST const unsigned short half::_eLut[1 << 9] = #include "eLut.h" //----------------------------------------------- @@ -65,7 +71,7 @@ HALF_EXPORT const unsigned short half::_eLut[1 << 9] = // which may be trapped by the operating system. //----------------------------------------------- -HALF_EXPORT float +IMATH_EXPORT float half::overflow() { volatile float f = 1e10; @@ -81,7 +87,7 @@ half::overflow() // zeroes, denormalized numbers and exponent overflows. //----------------------------------------------------- -HALF_EXPORT short +IMATH_EXPORT short half::convert (int i) { // @@ -220,14 +226,14 @@ half::convert (int i) // Stream I/O operators //--------------------- -HALF_EXPORT ostream& +IMATH_EXPORT ostream& operator<< (ostream& os, half h) { os << float (h); return os; } -HALF_EXPORT istream& +IMATH_EXPORT istream& operator>> (istream& is, half& h) { float f; @@ -241,7 +247,7 @@ operator>> (istream& is, half& h) // floats and halfs, mostly for debugging //--------------------------------------- -HALF_EXPORT void +IMATH_EXPORT void printBits (ostream& os, half h) { unsigned short b = h.bits(); @@ -255,7 +261,7 @@ printBits (ostream& os, half h) } } -HALF_EXPORT void +IMATH_EXPORT void printBits (ostream& os, float f) { half::uif x; @@ -270,7 +276,7 @@ printBits (ostream& os, float f) } } -HALF_EXPORT void +IMATH_EXPORT void printBits (char c[19], half h) { unsigned short b = h.bits(); @@ -286,7 +292,7 @@ printBits (char c[19], half h) c[18] = 0; } -HALF_EXPORT void +IMATH_EXPORT void printBits (char c[35], float f) { half::uif x; diff --git a/src/Imath/half.h b/src/Imath/half.h index 3d9bd1d3..9175be22 100644 --- a/src/Imath/half.h +++ b/src/Imath/half.h @@ -85,8 +85,8 @@ #ifndef _HALF_H_ #define _HALF_H_ -#include "../Imath/ImathNamespace.h" -#include "halfExport.h" // for definition of HALF_EXPORT +#include "ImathNamespace.h" +#include "ImathExport.h" #include IMATH_INTERNAL_NAMESPACE_HEADER_ENTER @@ -197,8 +197,8 @@ class half // Access to the internal representation //-------------------------------------- - HALF_EXPORT unsigned short bits() const; - HALF_EXPORT void setBits (unsigned short bits); + IMATH_EXPORT unsigned short bits() const; + IMATH_EXPORT void setBits (unsigned short bits); public: union uif @@ -208,13 +208,13 @@ class half }; private: - HALF_EXPORT static short convert (int i); - HALF_EXPORT static float overflow(); + IMATH_EXPORT static short convert (int i); + IMATH_EXPORT static float overflow(); unsigned short _h; - HALF_EXPORT static const uif _toFloat[1 << 16]; - HALF_EXPORT static const unsigned short _eLut[1 << 9]; + IMATH_EXPORT static const uif _toFloat[1 << 16]; + IMATH_EXPORT static const unsigned short _eLut[1 << 9]; }; //------------------------------------------------------------------------- @@ -695,17 +695,17 @@ IMATH_INTERNAL_NAMESPACE_HEADER_EXIT // Stream I/O //----------- -HALF_EXPORT std::ostream& operator<< (std::ostream& os, IMATH_INTERNAL_NAMESPACE::half h); -HALF_EXPORT std::istream& operator>> (std::istream& is, IMATH_INTERNAL_NAMESPACE::half& h); +IMATH_EXPORT std::ostream& operator<< (std::ostream& os, IMATH_INTERNAL_NAMESPACE::half h); +IMATH_EXPORT std::istream& operator>> (std::istream& is, IMATH_INTERNAL_NAMESPACE::half& h); //---------- // Debugging //---------- -HALF_EXPORT void printBits (std::ostream& os, IMATH_INTERNAL_NAMESPACE::half h); -HALF_EXPORT void printBits (std::ostream& os, float f); -HALF_EXPORT void printBits (char c[19], IMATH_INTERNAL_NAMESPACE::half h); -HALF_EXPORT void printBits (char c[35], float f); +IMATH_EXPORT void printBits (std::ostream& os, IMATH_INTERNAL_NAMESPACE::half h); +IMATH_EXPORT void printBits (std::ostream& os, float f); +IMATH_EXPORT void printBits (char c[19], IMATH_INTERNAL_NAMESPACE::half h); +IMATH_EXPORT void printBits (char c[35], float f); #ifndef __CUDACC__ using half = IMATH_INTERNAL_NAMESPACE::half; diff --git a/src/Imath/halfExport.h b/src/Imath/halfExport.h deleted file mode 100644 index a6830aba..00000000 --- a/src/Imath/halfExport.h +++ /dev/null @@ -1,50 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) 2008, Industrial Light & Magic, a division of Lucas -// Digital Ltd. LLC -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Industrial Light & Magic nor the names of -// its contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////// - -#ifndef HALFEXPORT_H -#define HALFEXPORT_H - -#if defined(OPENEXR_DLL) -# if defined(HALF_EXPORTS) -# define HALF_EXPORT __declspec(dllexport) -# else -# define HALF_EXPORT __declspec(dllimport) -# endif -# define HALF_EXPORT_CONST -#else -# define HALF_EXPORT -# define HALF_EXPORT_CONST const -#endif - -#endif // #ifndef HALFEXPORT_H diff --git a/src/python/PyImath/PyImathExport.h b/src/python/PyImath/PyImathExport.h index bccb6cbf..077674b2 100644 --- a/src/python/PyImath/PyImathExport.h +++ b/src/python/PyImath/PyImathExport.h @@ -37,7 +37,7 @@ #ifndef PYIMATHEXPORT_H #define PYIMATHEXPORT_H -#if defined(OPENEXR_DLL) +#if defined(IMATH_DLL) #if defined(PLATFORM_VISIBILITY_AVAILABLE) #define PYIMATH_EXPORT __attribute__((visibility("default"))) #define PYIMATH_EXPORT __attribute__((visibility("default"))) diff --git a/src/python/config/ModuleDefine.cmake b/src/python/config/ModuleDefine.cmake index b73740d5..467ff4b5 100644 --- a/src/python/config/ModuleDefine.cmake +++ b/src/python/config/ModuleDefine.cmake @@ -28,7 +28,7 @@ function(PYIMATH_ADD_LIBRARY_PRIV libname) target_compile_definitions(${libname} PRIVATE ${PYIMATH_CURLIB_PRIV_EXPORT}) endif() if(WIN32) - target_compile_definitions(${libname} PUBLIC OPENEXR_DLL) + target_compile_definitions(${libname} PUBLIC IMATH_DLL) endif() if(PYIMATH_CURLIB_CURDIR) target_include_directories(${libname} PUBLIC $) From b12da822645ce15937a9ef8e9fd1bcaf59cfcf4b Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Mon, 26 Oct 2020 00:02:43 +1300 Subject: [PATCH 5/5] Disable debug under windows as it takes an eternity to run Signed-off-by: Kimball Thurston --- .github/workflows/ci_workflow.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 7dda9194..3bb5e58a 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -303,7 +303,7 @@ jobs: runs-on: windows-2019 strategy: matrix: - build: [1, 2, 3] + build: [1, 3, 4] include: # C++11, Python 3.7 - build: 1 @@ -313,12 +313,12 @@ jobs: cxx-standard: 11 exclude-tests: # Debug - - - build: 2 - build-type: Debug - build-shared: 'ON' - build-docs: 'OFF' - cxx-standard: 11 - exclude-tests: + ## - build: 2 + ## build-type: Debug + ## build-shared: 'ON' + ## build-docs: 'OFF' + ## cxx-standard: 11 + ## exclude-tests: # C++14 - build: 3 build-type: Release @@ -327,7 +327,7 @@ jobs: cxx-standard: 14 exclude-tests: # C++14, Static - - build: 3 + - build: 4 build-type: Release build-shared: 'OFF' build-docs: 'OFF'