From 5e021ad9e2599fe8298bc5b127818219725fb22b Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sat, 2 Dec 2023 17:21:26 -0800 Subject: [PATCH] fix: dev: cleanup desktop and ci workflows * msys/mingw has incomplete dirent so disable namespace * refactor cmake config, update dirent pkg spec in conda env Signed-off-by: Stephen L Arnold --- .github/workflows/win.yml | 1 - CMakeLists.txt | 8 +++----- environment.devenv.yml | 2 +- tox.ini | 13 +++++-------- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index 6acb67c1e3..2cbd8c0bdf 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -44,7 +44,6 @@ jobs: -Wdev -B build -DBUILD_SHARED_LIBS=ON - -DABC_USE_NAMESPACE=xxx -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_dist diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c803f9830..81cecd29cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,11 +132,7 @@ target_include_directories( $ ) -if(MINGW) - target_link_libraries(abc_interface INTERFACE ${CMAKE_DL_LIBS} shlwapi) -else() - target_link_libraries(abc_interface INTERFACE ${CMAKE_DL_LIBS}) -endif() +target_link_libraries(abc_interface INTERFACE ${CMAKE_DL_LIBS}) if(NOT ABC_USE_NO_CUDD) message(STATUS "Compiling with CUDD") @@ -186,6 +182,8 @@ if(WIN32) $<$>:WIN32_NO_DLL> $<$>:ABC_NO_DYNAMIC_LINKING> ) + + target_link_libraries(abc_interface PRIVATE shlwapi) endif() if(ABC_USE_NAMESPACE) diff --git a/environment.devenv.yml b/environment.devenv.yml index a1d25367bf..7943367fe4 100644 --- a/environment.devenv.yml +++ b/environment.devenv.yml @@ -10,4 +10,4 @@ dependencies: - readline=8.1 # [unix] - zlib - libpng - - dirent # [win] + - dirent >=1.21,<2.0 # [win] diff --git a/tox.ini b/tox.ini index 3f5c459c61..09c3cf1092 100644 --- a/tox.ini +++ b/tox.ini @@ -12,12 +12,9 @@ setenv = {base,build,clang,ctest}: ABC_USE_NAMESPACE={env:ABC_USE_NAMESPACE:xxxx} {base,build,clang,ctest}: ABC_USE_SONAME={env:ABC_USE_SONAME:ON} {base,build,clang,ctest}: ABC_USE_PIC={env:ABC_USE_PIC:ON} + BUILD_TYPE={env:BUILD_TYPE:Release} base: PREFIX={env:PREFIX:staging} build: PREFIX={env:PREFIX:../staging} - build: BUILD_TYPE={env:BUILD_TYPE:Release} - clang: BUILD_TYPE={env:BUILD_TYPE:RelWithDebInfo} - ctest: BUILD_TYPE={env:BUILD_TYPE:Release} - ctestwin: BUILD_TYPE={env:BUILD_TYPE:Debug} passenv = CC @@ -42,7 +39,7 @@ skip_install = true setenv = {abc,tests}: {[base]setenv} - {build,base}: {[base]setenv} + {base,build,clang,ctest,ctestwin}: {[base]setenv} passenv = {[base]passenv} @@ -79,15 +76,15 @@ commands = {abc,soname,tests}: bash -c 'ls -lh *abc* demo || true' base: cmake -G {posargs:"Ninja"} -DABC_USE_NAMESPACE=$ABC_USE_NAMESPACE -DCMAKE_INSTALL_PREFIX={env:PREFIX} .. base: cmake --build . --target install -j {env:CPUS} - build: cmake -G {posargs:"Unix Makefiles"} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DABC_USE_NAMESPACE=$ABC_USE_NAMESPACE -DABC_ENABLE_LTO=ON -DBUILD_SHARED_LIBS=ON -DABC_USE_SONAME=$ABC_USE_SONAME -DCMAKE_INSTALL_PREFIX={env:PREFIX} .. - clang: cmake -G {posargs:"Unix Makefiles"} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DABC_USE_NAMESPACE=$ABC_USE_NAMESPACE -DCOVERAGE_BUILD=ON -DBUILD_SHARED_LIBS=OFF .. + build: cmake -G {posargs:"Unix Makefiles"} -DCMAKE_BUILD_TYPE={env:BUILD_TYPE} -DABC_USE_NAMESPACE={env:ABC_USE_NAMESPACE} -DABC_ENABLE_LTO=ON -DBUILD_SHARED_LIBS=ON -DABC_USE_SONAME={env:ABC_USE_SONAME} -DCMAKE_INSTALL_PREFIX={env:PREFIX} .. + clang: cmake -G {posargs:"Unix Makefiles"} -DCMAKE_BUILD_TYPE={env:BUILD_TYPE} -DABC_USE_NAMESPACE={env:ABC_USE_NAMESPACE} -DCOVERAGE_BUILD=ON -DBUILD_SHARED_LIBS=OFF .. {build}: cmake --build . -j {env:CPUS} {clang}: cmake --build . --target coverage -j {env:CPUS} {build,clang}: ctest -V -C {env:BUILD_TYPE} --test-dir ./ clang: lcov_cobertura build/coverage/lcov.info --base-dir {toxinidir}/src --output coverage.xml {base,build}: cmake --build . --target install {base,build}: bash -c 'find $PREFIX/ -type f -name \*abc\* -o -name demo | xargs ls -lh' - ctest: ctest -j {env:CPUS} --build-generator {posargs:"Ninja"} --build-and-test . build --build-options -DABC_USE_NAMESPACE=$ABC_USE_NAMESPACE -DABC_SKIP_EXE=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE --test-command ctest --rerun-failed --output-on-failure -V + ctest: ctest -j {env:CPUS} --build-generator {posargs:"Ninja"} --build-and-test . build --build-options -DABC_USE_NAMESPACE={env:ABC_USE_NAMESPACE} -DABC_SKIP_EXE=ON -DCMAKE_BUILD_TYPE={env:BUILD_TYPE} --test-command ctest --rerun-failed --output-on-failure -V ctestwin: ctest --build-generator {posargs:"Visual Studio 16 2019"} --build-and-test . build --build-options -DBUILD_SHARED_LIBS=ON -DABC_USE_NO_PTHREADS=ON -DABC_USE_NO_READLINE=ON -DCMAKE_BUILD_TYPE={env:BUILD_TYPE} --test-command ctest --rerun-failed --output-on-failure -V ctest: bash -c 'ls -lh build/base_test build/libabc.* || true' lint: bash -c 'cpplint --output=gsed {toxinidir}/src/base/main/* {toxinidir}/lib/*'