aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-24 01:16:57 -0700
committerChris Robinson <[email protected]>2019-09-24 01:16:57 -0700
commit96865d6b992d1f0d004ed49918a545306d10427e (patch)
treedc8d1e00f0fc617096a04d3a519fda86b0340142
parentbf31ce688a0674f4e2eef676872303db23e0d0e7 (diff)
Only build ex-common as needed
-rw-r--r--CMakeLists.txt15
1 files 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)