Skip to content

Commit

Permalink
fix: dev: cleanup desktop and ci workflows
Browse files Browse the repository at this point in the history
* msys/mingw has incomplete dirent so disable namespace
* refactor cmake config, update dirent pkg spec in conda env
* try cheap ENV hack to find dirent header in conda

Signed-off-by: Stephen L Arnold <[email protected]>
  • Loading branch information
sarnold committed Dec 3, 2023
1 parent 5c8bf28 commit 6307b35
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ target_include_directories(
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

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")
Expand Down Expand Up @@ -178,6 +174,11 @@ endif()
if(WIN32)
if(MINGW OR MSYS)
add_definitions(-DWIN32 -D__MINGW32__ -DHAVE_STRUCT_TIMESPEC)
if(DEFINED ENV{CONDA_PREFIX})
target_include_directories(abc_interface
INTERFACE $ENV{CONDA_PREFIX}/include
)
endif()
endif()
target_compile_definitions(abc_interface
INTERFACE
Expand All @@ -186,6 +187,7 @@ if(WIN32)
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:WIN32_NO_DLL>
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:ABC_NO_DYNAMIC_LINKING>
)
target_link_libraries(abc_interface INTERFACE shlwapi)
endif()

if(ABC_USE_NAMESPACE)
Expand Down
2 changes: 1 addition & 1 deletion environment.devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ dependencies:
- readline=8.1 # [unix]
- zlib
- libpng
- dirent # [win]
- dirent >=1.21,<2.0 # [win]
13 changes: 5 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down Expand Up @@ -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/*'
Expand Down

0 comments on commit 6307b35

Please sign in to comment.