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 20, 2020
1 parent 2a62719 commit 112e33f
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 112e33f

Please sign in to comment.