From 96865d6b992d1f0d004ed49918a545306d10427e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 24 Sep 2019 01:16:57 -0700 Subject: Only build ex-common as needed --- CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c20fa021..2f833e41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1422,14 +1422,13 @@ IF(ALSOFT_UTILS) MESSAGE(STATUS "") ENDIF() -IF(ALSOFT_EXAMPLES OR ALSOFT_TESTS) - # Add a static library with common functions used by multiple targets - ADD_LIBRARY(ex-common STATIC examples/common/alhelpers.c) - TARGET_COMPILE_DEFINITIONS(ex-common PUBLIC ${CPP_DEFS}) - TARGET_INCLUDE_DIRECTORIES(ex-common PUBLIC ${OpenAL_SOURCE_DIR}/common) - TARGET_COMPILE_OPTIONS(ex-common PUBLIC ${C_FLAGS}) - TARGET_LINK_LIBRARIES(ex-common PUBLIC OpenAL) -ENDIF() + +# Add a static library with common functions used by multiple example targets +ADD_LIBRARY(ex-common STATIC EXCLUDE_FROM_ALL examples/common/alhelpers.c) +TARGET_COMPILE_DEFINITIONS(ex-common PUBLIC ${CPP_DEFS}) +TARGET_INCLUDE_DIRECTORIES(ex-common PUBLIC ${OpenAL_SOURCE_DIR}/common) +TARGET_COMPILE_OPTIONS(ex-common PUBLIC ${C_FLAGS}) +TARGET_LINK_LIBRARIES(ex-common PUBLIC OpenAL) IF(ALSOFT_TESTS) ADD_EXECUTABLE(altonegen examples/altonegen.c) -- cgit v1.2.3