Skip to content

Commit

Permalink
Only add subdirectories if necessary
Browse files Browse the repository at this point in the history
If the build is using system libraries (for bzip2, lua, ode, or
xdgbasedir), there's no need to add the corresponding subdirectories.
This reduces build time and avoids potential mix-ups.

Signed-off-by: Stephen Kitt <steve@sk2.org>
  • Loading branch information
skitt committed Jul 8, 2020
1 parent 20bc4b9 commit 4c231d1
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,21 @@ find_package(ZLIB REQUIRED)

# sources

add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/bzip2" bzip2)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/libccd" libccd)
if(NOT USE_SYSTEM_Bzip2)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/bzip2" bzip2)
endif()
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/chipmunk" chipmunk)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/lua" lua)
if(NOT USE_SYSTEM_Lua)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/lua" lua)
endif()
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/md5sum" md5sum)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/ode" ode)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/xdgbasedir" xdgbasedir)
if(NOT USE_SYSTEM_ODE)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/libccd" libccd)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/ode" ode)
endif()
if(NOT USE_SYSTEM_XDG)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/xdgbasedir" xdgbasedir)
endif()
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/glad" glad)

set(common_src
Expand Down

0 comments on commit 4c231d1

Please sign in to comment.