Skip to content

Commit 1d96d78

Browse files
Merge pull request #337 from Devsh-Graphics-Programming/system_unification
Build System stuff
2 parents 4b17133 + 7f8bbdf commit 1d96d78

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

3rdparty/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ target_include_directories(volk PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Heade
6262
target_include_directories(volk_headers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/include")
6363

6464
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
65-
add_subdirectory(pstl pstl)
65+
add_subdirectory(pstl pstl EXCLUDE_FROM_ALL)
6666
endif()
6767

6868

3rdparty/pstl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # only non-multi-generators and clang
77
set(PREVIOUS_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
88
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
99
set(TBB_SANITIZE "" CACHE STRING "" FORCE)
10-
add_subdirectory(oneTBB oneTBB)
10+
add_subdirectory(oneTBB oneTBB EXCLUDE_FROM_ALL)
1111

1212
if(PREVIOUS_BUILD_SHARED_LIBS)
1313
set(BUILD_SHARED_LIBS ${PREVIOUS_BUILD_SHARED_LIBS} CACHE BOOL "" FORCE)

src/nbl/CMakeLists.txt

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,19 @@ file(GLOB_RECURSE TEMP_GLOB_RES "${NBL_ROOT_PATH}/include/*.h")
176176
set(NABLA_HEADERS_PUBLIC ${NABLA_HEADERS_PUBLIC} ${TEMP_GLOB_RES})
177177
file(GLOB_RECURSE TEMP_GLOB_RES "${NBL_ROOT_PATH}/include/*.tcc")
178178
set(NABLA_HEADERS_PUBLIC ${NABLA_HEADERS_PUBLIC} ${TEMP_GLOB_RES})
179+
file(GLOB_RECURSE TEMP_GLOB_RES "${NBL_ROOT_PATH}/src/*.h")
180+
set(NABLA_HEADERS_PUBLIC2 ${NABLA_HEADERS_PUBLIC2} ${TEMP_GLOB_RES}) # TODO: we should have moved all headers from src directory to /include, but we need it for install target
181+
182+
foreach(NBL_CURRENT_HEADER IN LISTS NABLA_HEADERS_PUBLIC2)
183+
cmake_path(GET NBL_CURRENT_HEADER PARENT_PATH NBL_CURRENT_HEADER_DIR)
184+
file(RELATIVE_PATH NBL_TMP_REL_DESTINATION "${NBL_ROOT_PATH}/src" ${NBL_CURRENT_HEADER_DIR})
185+
186+
install(FILES ${NBL_CURRENT_HEADER} DESTINATION include/${NBL_TMP_REL_DESTINATION} CONFIGURATIONS Release)
187+
install(FILES ${NBL_CURRENT_HEADER} DESTINATION debug/include/${NBL_TMP_REL_DESTINATION} CONFIGURATIONS Debug)
188+
install(FILES ${NBL_CURRENT_HEADER} DESTINATION relwithdebinfo/include/${NBL_TMP_REL_DESTINATION} CONFIGURATIONS RelWithDebInfo)
189+
endforeach()
190+
191+
unset(NABLA_HEADERS_PUBLIC2 ${NBL_TMP_FULL_PATHS})
179192

180193
file(GLOB_RECURSE NABLA_HEADERS_PRIV1 "*.h")
181194
file(GLOB_RECURSE NABLA_HEADERS_PRIV2 "${NBL_ROOT_PATH}/src/nbl/*.h")
@@ -647,7 +660,6 @@ start_tracking_variables_for_propagation_to_parent()
647660
add_subdirectory(ext)
648661
propagate_changed_variables_to_parent_scope()
649662

650-
651663
set(NABLA_HEADERS_TO_INSTALL
652664
${NABLA_HEADERS_PUBLIC}
653665
)
@@ -665,6 +677,12 @@ nbl_install_headers("${NABLA_HEADERS_TO_INSTALL}" "${NBL_ROOT_PATH}/include")
665677
nbl_install_headers("${NABLA_HEADERS_TO_INSTALL_SOURCE_REFACTOR}" "${NBL_ROOT_PATH}/source/Nabla")
666678
nbl_install_config_header(BuildConfigOptions.h)
667679

680+
macro(nbl_install_program _TRGT)
681+
install(PROGRAMS $<TARGET_FILE:${_TRGT}> DESTINATION lib CONFIGURATIONS Release)
682+
install(PROGRAMS $<TARGET_FILE:${_TRGT}> DESTINATION debug/lib CONFIGURATIONS Debug)
683+
install(PROGRAMS $<TARGET_FILE:${_TRGT}> DESTINATION relwithdebinfo/lib CONFIGURATIONS RelWithDebInfo)
684+
endmacro()
685+
668686
macro(nbl_install_lib _TRGT)
669687
install(TARGETS ${_TRGT} ARCHIVE DESTINATION lib CONFIGURATIONS Release)
670688
install(TARGETS ${_TRGT} ARCHIVE DESTINATION debug/lib CONFIGURATIONS Debug)
@@ -709,7 +727,7 @@ nbl_install_lib(zlibstatic)
709727
nbl_install_lib(simdjson)
710728
nbl_install_lib(volk)
711729
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
712-
nbl_install_lib(tbb)
713-
nbl_install_lib(tbbmalloc)
714-
nbl_install_lib(tbbmalloc_proxy)
730+
nbl_install_program(tbb)
731+
nbl_install_program(tbbmalloc)
732+
nbl_install_program(tbbmalloc_proxy)
715733
endif()

0 commit comments

Comments
 (0)