Fixed parallel compilation of librestbed

This commit is contained in:
hunbernd 2019-03-16 17:26:27 +01:00
parent a4ee76e402
commit bc294b207d
2 changed files with 26 additions and 13 deletions

View File

@ -861,9 +861,14 @@ rs_jsonapi {
WRAPPERS_REG_FILE=$$clean_path($${JSONAPI_GENERATOR_OUT}/jsonapi-wrappers.inl) WRAPPERS_REG_FILE=$$clean_path($${JSONAPI_GENERATOR_OUT}/jsonapi-wrappers.inl)
no_rs_cross_compiling { no_rs_cross_compiling {
restbed.target = $$clean_path($${RESTBED_BUILD_PATH}/library/librestbed.a) DUMMYRESTBEDINPUT = FORCE
genrestbedlib.name = Generating libresbed.
genrestbedlib.input = DUMMYRESTBEDINPUT
genrestbedlib.output = $$clean_path($${RESTBED_BUILD_PATH}/librestbed.a)
genrestbedlib.CONFIG += target_predeps combine
genrestbedlib.variable_out = PRE_TARGETDEPS
win32-g++ { win32-g++ {
restbed.commands = \ genrestbedlib.commands = \
cd $${RS_SRC_PATH} && \ cd $${RS_SRC_PATH} && \
git submodule update --init --recommend-shallow supportlibs/restbed && \ git submodule update --init --recommend-shallow supportlibs/restbed && \
cd $${RESTBED_SRC_PATH} && \ cd $${RESTBED_SRC_PATH} && \
@ -873,9 +878,9 @@ rs_jsonapi {
mkdir -p $${RESTBED_BUILD_PATH}; cd $${RESTBED_BUILD_PATH} && \ mkdir -p $${RESTBED_BUILD_PATH}; cd $${RESTBED_BUILD_PATH} && \
cmake -DCMAKE_CXX_COMPILER=$$QMAKE_CXX -G \"MSYS Makefiles\" -DBUILD_SSL=OFF \ cmake -DCMAKE_CXX_COMPILER=$$QMAKE_CXX -G \"MSYS Makefiles\" -DBUILD_SSL=OFF \
-DCMAKE_INSTALL_PREFIX=. -B. -H$$shell_path($${RESTBED_SRC_PATH}) && \ -DCMAKE_INSTALL_PREFIX=. -B. -H$$shell_path($${RESTBED_SRC_PATH}) && \
make && make install make
} else { } else {
restbed.commands = \ genrestbedlib.commands = \
cd $${RS_SRC_PATH};\ cd $${RS_SRC_PATH};\
git submodule update --init --recommend-shallow supportlibs/restbed;\ git submodule update --init --recommend-shallow supportlibs/restbed;\
cd $${RESTBED_SRC_PATH};\ cd $${RESTBED_SRC_PATH};\
@ -885,21 +890,28 @@ rs_jsonapi {
mkdir -p $${RESTBED_BUILD_PATH}; cd $${RESTBED_BUILD_PATH};\ mkdir -p $${RESTBED_BUILD_PATH}; cd $${RESTBED_BUILD_PATH};\
cmake -DCMAKE_CXX_COMPILER=$$QMAKE_CXX -DBUILD_SSL=OFF \ cmake -DCMAKE_CXX_COMPILER=$$QMAKE_CXX -DBUILD_SSL=OFF \
-DCMAKE_INSTALL_PREFIX=. -B. -H$$shell_path($${RESTBED_SRC_PATH});\ -DCMAKE_INSTALL_PREFIX=. -B. -H$$shell_path($${RESTBED_SRC_PATH});\
make; make install make
} }
QMAKE_EXTRA_TARGETS += restbed QMAKE_EXTRA_COMPILERS += genrestbedlib
libretroshare.depends += restbed
PRE_TARGETDEPS *= $${restbed.target} RESTBED_HEADER_FILE=$$clean_path($${RESTBED_BUILD_PATH}/include/restbed)
genrestbedheader.name = Generating restbed header.
genrestbedheader.input = genrestbedlib.output
genrestbedheader.output = $${RESTBED_HEADER_FILE}
genrestbedheader.CONFIG += target_predeps combine no_link
genrestbedheader.variable_out = HEADERS
genrestbedheader.commands = cd $${RESTBED_BUILD_PATH} && make install
QMAKE_EXTRA_COMPILERS += genrestbedheader
} }
INCLUDEPATH *= $${JSONAPI_GENERATOR_OUT} INCLUDEPATH *= $${JSONAPI_GENERATOR_OUT}
DEPENDPATH *= $${JSONAPI_GENERATOR_OUT} DEPENDPATH *= $${JSONAPI_GENERATOR_OUT}
apiheaders = $$files($${RS_SRC_PATH}/libretroshare/src/retroshare/*.h) APIHEADERS = $$files($${RS_SRC_PATH}/libretroshare/src/retroshare/*.h)
#Make sure that the jsonapigenerator executable are ready #Make sure that the jsonapigenerator executable are ready
apiheaders += $${JSONAPI_GENERATOR_EXE} APIHEADERS += $${JSONAPI_GENERATOR_EXE}
genjsonapi.name = Generating jsonapi headers. genjsonapi.name = Generating jsonapi headers.
genjsonapi.input = apiheaders genjsonapi.input = APIHEADERS
genjsonapi.output = $${WRAPPERS_INCL_FILE} $${WRAPPERS_REG_FILE} genjsonapi.output = $${WRAPPERS_INCL_FILE} $${WRAPPERS_REG_FILE}
genjsonapi.clean = $${WRAPPERS_INCL_FILE} $${WRAPPERS_REG_FILE} genjsonapi.clean = $${WRAPPERS_INCL_FILE} $${WRAPPERS_REG_FILE}
genjsonapi.CONFIG += target_predeps combine no_link genjsonapi.CONFIG += target_predeps combine no_link

View File

@ -55,9 +55,10 @@ rs_jsonapi {
RESTBED_SRC_PATH=$$clean_path($${RS_SRC_PATH}/supportlibs/restbed) RESTBED_SRC_PATH=$$clean_path($${RS_SRC_PATH}/supportlibs/restbed)
RESTBED_BUILD_PATH=$$clean_path($${RS_BUILD_PATH}/supportlibs/restbed) RESTBED_BUILD_PATH=$$clean_path($${RS_BUILD_PATH}/supportlibs/restbed)
INCLUDEPATH *= $$clean_path($${RESTBED_BUILD_PATH}/include/) INCLUDEPATH *= $$clean_path($${RESTBED_BUILD_PATH}/include/)
QMAKE_LIBDIR *= $$clean_path($${RESTBED_BUILD_PATH}/library/) DEPENDPATH *= $$clean_path($${RESTBED_BUILD_PATH}/include/)
QMAKE_LIBDIR *= $$clean_path($${RESTBED_BUILD_PATH}/)
# Using sLibs would fail as librestbed.a is generated at compile-time # Using sLibs would fail as librestbed.a is generated at compile-time
LIBS *= -L$$clean_path($${RESTBED_BUILD_PATH}/library/) -lrestbed LIBS *= -L$$clean_path($${RESTBED_BUILD_PATH}/) -lrestbed
} else:sLibs *= restbed } else:sLibs *= restbed
win32-g++:dLibs *= wsock32 win32-g++:dLibs *= wsock32