aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-08-28 10:31:23 -0700
committerChris Robinson <[email protected]>2017-08-28 10:31:23 -0700
commit2916efee213d0d0c6fe67669bf666141e6149f27 (patch)
treeb00720de5977bcc8d7ba6c2d51697014ac5606db /CMakeLists.txt
parent6c367cad6e358a0ea4fd71fc94120dd7e036c621 (diff)
Automatically generate the bsinc table when building
This makes bsincgen a native tool like bin2h, so it can run automatically when compiling.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 14 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3f45376..b99d2549 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1129,15 +1129,17 @@ SET(NATIVE_BIN_DIR "${OpenAL_BINARY_DIR}/native-tools/")
FILE(MAKE_DIRECTORY "${NATIVE_BIN_DIR}")
SET(BIN2H_COMMAND "${NATIVE_BIN_DIR}bin2h")
-ADD_CUSTOM_COMMAND(OUTPUT "${BIN2H_COMMAND}"
+SET(BSINCGEN_COMMAND "${NATIVE_BIN_DIR}bsincgen")
+ADD_CUSTOM_COMMAND(OUTPUT "${BIN2H_COMMAND}" "${BSINCGEN_COMMAND}"
COMMAND ${CMAKE_COMMAND} "${NATIVE_SRC_DIR}"
- COMMAND ${CMAKE_COMMAND} --build . --clean-first --config "Release"
+ COMMAND ${CMAKE_COMMAND} -E remove "${BIN2H_COMMAND}" "${BSINCGEN_COMMAND}"
+ COMMAND ${CMAKE_COMMAND} --build . --config "Release"
WORKING_DIRECTORY "${NATIVE_BIN_DIR}"
- DEPENDS "${NATIVE_SRC_DIR}CMakeLists.txt" "${NATIVE_SRC_DIR}bin2h.c"
+ DEPENDS "${NATIVE_SRC_DIR}CMakeLists.txt" "${NATIVE_SRC_DIR}bin2h.c" "${NATIVE_SRC_DIR}bsincgen.c"
VERBATIM
)
ADD_CUSTOM_TARGET(native-tools
- DEPENDS "${BIN2H_COMMAND}"
+ DEPENDS "${BIN2H_COMMAND}" "${BSINCGEN_COMMAND}"
VERBATIM
)
@@ -1152,7 +1154,6 @@ if(ALSOFT_EMBED_HRTF_DATA)
DEPENDS native-tools "${infile}"
VERBATIM
)
-
SET(ALC_OBJS ${ALC_OBJS} "${outfile}")
ENDMACRO()
@@ -1160,6 +1161,13 @@ if(ALSOFT_EMBED_HRTF_DATA)
make_hrtf_header(default-48000.mhr "hrtf_default_48000")
endif()
+ADD_CUSTOM_COMMAND(OUTPUT "${OpenAL_BINARY_DIR}/bsinc_inc.h"
+ COMMAND "${BSINCGEN_COMMAND}" "${OpenAL_BINARY_DIR}/bsinc_inc.h"
+ DEPENDS native-tools "${NATIVE_SRC_DIR}bsincgen.c"
+ VERBATIM
+)
+SET(ALC_OBJS ${ALC_OBJS} "${OpenAL_BINARY_DIR}/bsinc_inc.h")
+
IF(ALSOFT_UTILS AND NOT ALSOFT_NO_CONFIG_UTIL)
add_subdirectory(utils/alsoft-config)
@@ -1414,17 +1422,8 @@ IF(ALSOFT_UTILS)
SET_PROPERTY(TARGET makehrtf APPEND_STRING PROPERTY LINK_FLAGS " -municode")
ENDIF()
- ADD_EXECUTABLE(bsincgen utils/bsincgen.c)
- SET_PROPERTY(TARGET bsincgen APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
- IF(HAVE_LIBM)
- TARGET_LINK_LIBRARIES(bsincgen m)
- ENDIF()
- IF(WIN32 AND CMAKE_COMPILER_IS_GNUCC)
- SET_PROPERTY(TARGET bsincgen APPEND_STRING PROPERTY LINK_FLAGS " -municode")
- ENDIF()
-
IF(ALSOFT_INSTALL)
- INSTALL(TARGETS openal-info makehrtf bsincgen
+ INSTALL(TARGETS openal-info makehrtf
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}