diff options
author | Chris Robinson <[email protected]> | 2017-12-23 21:23:32 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-12-23 21:23:32 -0800 |
commit | 3633b65e0407d1d802d3283f60473e818179987b (patch) | |
tree | da1ae92bb0067ceb2c26412f47bd6b18de65b3fa /CMakeLists.txt | |
parent | ce74098b40aa6fc70851df7b6037a441b9d1c745 (diff) |
Only link to the common lib when building as shared
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a5a0876..eebba3f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1249,6 +1249,7 @@ TARGET_COMPILE_OPTIONS(common PRIVATE ${C_FLAGS}) UNSET(HAS_ROUTER) SET(IMPL_TARGET OpenAL) +SET(COMMON_LIB ) SET(SUBSYS_FLAG ) # Build main library @@ -1262,6 +1263,7 @@ ELSE() # Make sure to compile the common code with PIC, since it'll be linked into # shared libs that needs it. SET_PROPERTY(TARGET common PROPERTY POSITION_INDEPENDENT_CODE TRUE) + SET(COMMON_LIB common) IF(WIN32) IF(MSVC) @@ -1276,7 +1278,7 @@ ELSE() TARGET_COMPILE_DEFINITIONS(OpenAL PRIVATE AL_BUILD_LIBRARY AL_ALEXT_PROTOTYPES ${CPP_DEFS}) TARGET_COMPILE_OPTIONS(OpenAL PRIVATE ${C_FLAGS}) - TARGET_LINK_LIBRARIES(OpenAL PRIVATE ${LINKER_FLAGS} common) + TARGET_LINK_LIBRARIES(OpenAL PRIVATE ${LINKER_FLAGS} ${COMMON_LIB}) SET_TARGET_PROPERTIES(OpenAL PROPERTIES PREFIX "") SET_TARGET_PROPERTIES(OpenAL PROPERTIES OUTPUT_NAME ${LIBNAME}) IF(TARGET build_version) @@ -1288,7 +1290,7 @@ ELSE() SET(IMPL_TARGET soft_oal) ENDIF() - ADD_LIBRARY(${IMPL_TARGET} SHARED ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS}) + ADD_LIBRARY(${IMPL_TARGET} SHARED ${OPENAL_OBJS} ${ALC_OBJS}) IF(WIN32) SET_TARGET_PROPERTIES(${IMPL_TARGET} PROPERTIES PREFIX "") ENDIF() @@ -1302,7 +1304,8 @@ TARGET_COMPILE_DEFINITIONS(${IMPL_TARGET} TARGET_INCLUDE_DIRECTORIES(${IMPL_TARGET} PRIVATE "${OpenAL_SOURCE_DIR}/OpenAL32/Include" "${OpenAL_SOURCE_DIR}/Alc" ${INC_PATHS}) TARGET_COMPILE_OPTIONS(${IMPL_TARGET} PRIVATE ${C_FLAGS}) -TARGET_LINK_LIBRARIES(${IMPL_TARGET} PRIVATE ${LINKER_FLAGS} common ${EXTRA_LIBS} ${MATH_LIB}) +TARGET_LINK_LIBRARIES(${IMPL_TARGET} + PRIVATE ${LINKER_FLAGS} ${COMMON_LIB} ${EXTRA_LIBS} ${MATH_LIB}) IF(TARGET build_version) ADD_DEPENDENCIES(${IMPL_TARGET} build_version) ENDIF() |