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

CMAKE_INCLUDE_CURRENT_DIR is not possible to set ON #1536

Open
muscowite opened this issue Oct 23, 2024 · 0 comments
Open

CMAKE_INCLUDE_CURRENT_DIR is not possible to set ON #1536

muscowite opened this issue Oct 23, 2024 · 0 comments
Labels

Comments

@muscowite
Copy link

Summary

It is not possible to switch on CMAKE_INCLUDE_CURRENT_DIR flag

Version

oneTBB: 42b833fe used as a CMake submodule

Environment

  • OS name and version: Fedora 40
  • Compiler version: gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)
  • CMake: 3.28.2

Observed Behavior

====================[ Build | tbb_playground | Debug-fedora40 ]=================
/usr/bin/cmake --build /tmp/tmp.nGTF3scnLs/cmake-build-debug-fedora40 --target tbb_playground -j 2
[1/35] Building CXX object tbb/src/tbb/CMakeFiles/tbb.dir/allocator.cpp.o
FAILED: tbb/src/tbb/CMakeFiles/tbb.dir/allocator.cpp.o 
/usr/lib64/ccache/c++ -DTBB_USE_DEBUG -D__TBB_BUILD -I/tmp/tmp.nGTF3scnLs/cmake-build-debug-fedora40/tbb/src/tbb -I/tmp/tmp.nGTF3scnLs/tbb/src/tbb -I/tmp/tmp.nGTF3scnLs/tbb/src/tbb/../../include -g -std=c++20 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -flifetime-dse=1 -Wall -Wextra -Werror -Wfatal-errors -D__TBB_GNU_ASM_VERSION=2041 -fstack-clash-protection -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -ffile-prefix-map=/tmp/tmp.nGTF3scnLs/= -ffile-prefix-map=../..//= -MD -MT tbb/src/tbb/CMakeFiles/tbb.dir/allocator.cpp.o -MF tbb/src/tbb/CMakeFiles/tbb.dir/allocator.cpp.o.d -o tbb/src/tbb/CMakeFiles/tbb.dir/allocator.cpp.o -c /tmp/tmp.nGTF3scnLs/tbb/src/tbb/allocator.cpp
In file included from /usr/include/c++/14/bits/semaphore_base.h:45,
                 from /usr/include/c++/14/semaphore:37,
                 from /usr/include/c++/14/stop_token:42,
                 from /usr/include/c++/14/thread:42,
                 from /tmp/tmp.nGTF3scnLs/tbb/src/tbb/../../include/oneapi/tbb/detail/_machine.h:53,
                 from /tmp/tmp.nGTF3scnLs/tbb/src/tbb/../../include/oneapi/tbb/detail/_utils.h:27,
                 from /tmp/tmp.nGTF3scnLs/tbb/src/tbb/allocator.cpp:21:
/tmp/tmp.nGTF3scnLs/tbb/src/tbb/semaphore.h:174:27: error: expected class-name before ‘{’ token
  174 | class semaphore : no_copy {
      |                           ^
compilation terminated due to -Wfatal-errors.
[2/35] Building CXX object tbb/src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.o
FAILED: tbb/src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.o 
/usr/lib64/ccache/c++ -DTBB_USE_DEBUG -D__TBB_BUILD -I/tmp/tmp.nGTF3scnLs/cmake-build-debug-fedora40/tbb/src/tbb -I/tmp/tmp.nGTF3scnLs/tbb/src/tbb -I/tmp/tmp.nGTF3scnLs/tbb/src/tbb/../../include -g -std=c++20 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -flifetime-dse=1 -Wall -Wextra -Werror -Wfatal-errors -D__TBB_GNU_ASM_VERSION=2041 -fstack-clash-protection -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -ffile-prefix-map=/tmp/tmp.nGTF3scnLs/= -ffile-prefix-map=../..//= -MD -MT tbb/src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.o -MF tbb/src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.o.d -o tbb/src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.o -c /tmp/tmp.nGTF3scnLs/tbb/src/tbb/address_waiter.cpp
In file included from /usr/include/c++/14/bits/semaphore_base.h:45,
                 from /usr/include/c++/14/semaphore:37,
                 from /usr/include/c++/14/stop_token:42,
                 from /usr/include/c++/14/thread:42,
                 from /tmp/tmp.nGTF3scnLs/tbb/src/tbb/../../include/oneapi/tbb/detail/_machine.h:53,
                 from /tmp/tmp.nGTF3scnLs/tbb/src/tbb/../../include/oneapi/tbb/detail/_utils.h:27,
                 from /tmp/tmp.nGTF3scnLs/tbb/src/tbb/address_waiter.cpp:17:
/tmp/tmp.nGTF3scnLs/tbb/src/tbb/semaphore.h:174:27: error: expected class-name before ‘{’ token
  174 | class semaphore : no_copy {
      |                           ^
compilation terminated due to -Wfatal-errors.
ninja: build stopped: subcommand failed.

Expected Behavior

It should be possible to build the project with oneTBB as a submodule and having CMAKE_INCLUDE_CURRENT_DIR:BOOL=ON

Steps To Reproduce

Create an empty CMake-base project, add TBB as a submodule, try to build.

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

add_subdirectory(tbb EXCLUDE_FROM_ALL)

add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} TBB::tbb)
@muscowite muscowite added the bug label Oct 23, 2024
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

1 participant