fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Again on "Compile time constant lookup tables"


From: Marcus Weseloh
Subject: Re: [fluid-dev] Again on "Compile time constant lookup tables"
Date: Tue, 18 Sep 2018 23:08:43 +0200

Am Di., 18. Sep. 2018 um 20:57 Uhr schrieb Tom M. <address@hidden>:
> Also, I prefer Carlo's C tool as it allows to use fluidsynths internal calculation routines to generate the constexpr tables. Whereas a python script would probably duplicate the existing implementation.

That's a good point. And if I remember correctly, then the idea of compiling it and using it to generate the tables during the normal build process was dropped because of cross-compiling problems. Maybe there's a way around that... I did some tests with ExternalProject_add and got to the point where, if I add a sub-directory to the source tree containing a small c program and a very simple CMakeLists.txt, the program in the sub-directory is compiled with the host compiler, the rest with the cross-compiler.

I've added the following to the end of the root CMakeLists.txt:

include(ExternalProject)
ExternalProject_Add(gentables
    DOWNLOAD_COMMAND ""
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/gentables
    CONFIGURE_COMMAND cmake <SOURCE_DIR>
    INSTALL_COMMAND ""
    BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables
)
add_dependencies(libfluidsynth-OBJ gentables)

My cmake knowledge is virtually non-existant, I got the idea from here: 
http://cmake.3232098.n2.nabble.com/Cross-compilation-and-native-executables-tp4463100p4483097.html

But maybe from here it could be possible to get cmake to execute the compiled tool to generate the files and place them in the fluidsynth source tree?

Cheers,

    Marcus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]