Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build lib with exceptions disabled #357

Closed
alphanso opened this issue Oct 4, 2023 · 3 comments
Closed

Can't build lib with exceptions disabled #357

alphanso opened this issue Oct 4, 2023 · 3 comments

Comments

@alphanso
Copy link

alphanso commented Oct 4, 2023

Hi,

I am trying to migrate to v3.3.1. I am unable to build with exceptions disabled.

Thanks

P.S It's not happening with 2.9.0. Bug is also reproducible with 2.9.2

@odygrd
Copy link
Owner

odygrd commented Oct 31, 2023

hey sorry for the late response. What operating system is it ? And what compiler and version ?
There is a linux build with no exceptions on CI that is passes https://github.com/odygrd/quill/actions/runs/6713304824/job/18244606128

update:
I also tried on centos8 today with gcc 12.2 and -DQUILL_NO_EXCEPTIONS:BOOL=ON and I had no issues building it

@harlan-merlin
Copy link

Same issue here and can confirm 2.9.0 works. Glancing at the difference between the two, looks like check_printf_format_string(...) was added between then and now.

Pre-Build Steps:

wget https://github.com/odygrd/quill/archive/refs/tags/v3.4.0.tar.gz
tar -xvf v3.4.0.tar.gz 
mkdir build && cd build

CMake

cmake -DQUILL_NO_EXCEPTIONS:BOOL=ON -DQUILL_BUILD_EXAMPLES=OFF ..
-- The C compiler identification is AppleClang 15.0.0.15000040
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- CMAKE_BUILD_TYPE: Release
-- QUILL_VERSION: 3.4.0
-- QUILL_NO_EXCEPTIONS: ON
-- QUILL_FMT_EXTERNAL: OFF
-- QUILL_NO_THREAD_NAME_SUPPORT: OFF
-- Configuring done (0.7s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/harlan/GitHub/quill-3.4.0/build

Make

make
[  4%] Building CXX object quill/CMakeFiles/quill.dir/src/detail/backend/BackendWorker.cpp.o
In file included from /Users/harlan/GitHub/quill-3.4.0/quill/src/detail/backend/BackendWorker.cpp:1:
In file included from /Users/harlan/GitHub/quill-3.4.0/quill/include/quill/detail/backend/BackendWorker.h:10:
In file included from /Users/harlan/GitHub/quill-3.4.0/quill/include/quill/Config.h:9:
/Users/harlan/GitHub/quill-3.4.0/quill/include/quill/detail/misc/Common.h:194:5: fatal error: cannot use 'throw' with exceptions disabled
    throw std::runtime_error{
    ^
1 error generated.
make[2]: *** [quill/CMakeFiles/quill.dir/src/detail/backend/BackendWorker.cpp.o] Error 1
make[1]: *** [quill/CMakeFiles/quill.dir/all] Error 2
make: *** [all] Error 2

% clang --version
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix

@odygrd
Copy link
Owner

odygrd commented Nov 20, 2023

thanks for reporting :) that is fixed in ed934b5
Please let me know if you have any other issues

@odygrd odygrd closed this as completed Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants