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

[bug] Should set ENABLE_STRICT_TRY_COMPILE TRUE by default #158

Open
halx99 opened this issue Sep 9, 2022 · 5 comments
Open

[bug] Should set ENABLE_STRICT_TRY_COMPILE TRUE by default #158

halx99 opened this issue Sep 9, 2022 · 5 comments
Assignees
Labels

Comments

@halx99
Copy link

halx99 commented Sep 9, 2022

Describe the bug
Sets ENABLE_STRICT_TRY_COMPILE OFF default, will lead cmake generate incorrect native project for dynamic libraries.

To Reproduce
Steps to reproduce the behavior:

  1. https://github.com/axys1/axys/runs/8269974724?check_suite_focus=true

Expected behavior
Generate native project correct when build dynamic library on iOS.

Environment

  • What version of CMake did you run?
  • Your faulty CMakeLists.txt here:
git clone https://github.com/kcat/openal-soft
cd openal-soft
cmake -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=ios.cmake.toolchain -DPLATFORM=OS64
cmake --build build --target OpenAL
# will error with: ld: library not found for -latomic, because the openal-soft find non-exists library `libatomic` with this toolchain file
@halx99 halx99 added the bug label Sep 9, 2022
@halx99 halx99 changed the title [bug] Should set [bug] Should set ENABLE_STRICT_TRY_COMPILE TRUE by default Sep 9, 2022
@kambala-decapitator
Copy link

your build log doesn't contain exact linker command, you should build without -quiet.

Also, in configure step there's

-- Performing Test HAVE_LIBATOMIC - Success

@halx99
Copy link
Author

halx99 commented Sep 12, 2022

Yes, If enable strict try compile, will be

-- Performing Test HAVE_LIBATOMIC - Fail

That's correct for ios don't needs libatomic.

@kambala-decapitator
Copy link

this really depends on a concrete case. like I wrote in your PR, just pass -DENABLE_STRICT_TRY_COMPILE=ON to your configure command.

@halx99
Copy link
Author

halx99 commented Sep 12, 2022

Yes, your solution can solve the this issue, but I don't known why ios-cmake set ENABLE_STRICT_TRY_COMPILE to OFF by default.
For more detail, you can refer to: kcat/openal-soft#466

@leetal
Copy link
Owner

leetal commented Oct 18, 2022

Do your CMakeLists.txt perhaps set CMAKE_TRY_COMPILE_TARGET_TYPE (or TRY_COMPILE_TARGET_TYPE) to something else than STATIC_LIBRARY?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants