mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-23 14:39:34 -05:00
Change again C compiler selection in CI
This commit is contained in:
parent
694bd34f27
commit
74fa3bdf2b
@ -48,8 +48,8 @@ addons:
|
||||
|
||||
before_script:
|
||||
- env
|
||||
- if [ $TRAVIS_OS_NAME == linux ]; then qmake QMAKE_CC=$CC QMAKE_CXX=$CXX; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then qmake QMAKE_CC=clang QMAKE_CXX=$CXX CONFIG+=rs_macos10.14 INCLUDEPATH+=/usr/local/opt/openssl/include/ INCLUDEPATH+=/usr/local/Cellar/sqlcipher/4.0.1/include INCLUDEPATH+=/usr/local/Cellar/libmicrohttpd/0.9.62_1/include QMAKE_LIBDIR+=/usr/local/opt/openssl/lib/ QMAKE_LIBDIR+=/usr/local/Cellar/libmicrohttpd/0.9.62_1/lib QMAKE_LIBDIR+=/usr/local/Cellar/sqlcipher/4.0.1/lib; fi
|
||||
- if [ $TRAVIS_OS_NAME == linux ]; then qmake; fi
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then qmake CONFIG+=rs_macos10.14 INCLUDEPATH+=/usr/local/opt/openssl/include/ INCLUDEPATH+=/usr/local/Cellar/sqlcipher/4.0.1/include INCLUDEPATH+=/usr/local/Cellar/libmicrohttpd/0.9.62_1/include QMAKE_LIBDIR+=/usr/local/opt/openssl/lib/ QMAKE_LIBDIR+=/usr/local/Cellar/libmicrohttpd/0.9.62_1/lib QMAKE_LIBDIR+=/usr/local/Cellar/sqlcipher/4.0.1/lib; fi
|
||||
|
||||
script:
|
||||
- if [ $TRAVIS_OS_NAME == osx ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j4; fi
|
||||
|
@ -882,7 +882,8 @@ rs_jsonapi {
|
||||
git submodule update --init --recommend-shallow dependency/kashmir ; \
|
||||
true ) && \
|
||||
mkdir -p $${RESTBED_BUILD_PATH} && cd $${RESTBED_BUILD_PATH} && \
|
||||
cmake -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
|
||||
cmake -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
|
||||
-DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
|
||||
$${CMAKE_GENERATOR_OVERRIDE} -DBUILD_SSL=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=. -B. \
|
||||
-H$$shell_path($${RESTBED_SRC_PATH}) && \
|
||||
@ -939,14 +940,7 @@ rs_broadcast_discovery {
|
||||
no_rs_cross_compiling {
|
||||
DUMMYQMAKECOMPILERINPUT = FORCE
|
||||
CMAKE_GENERATOR_OVERRIDE=""
|
||||
CMAKE_C_COMPILER_OVERRIDE=""
|
||||
win32-g++ {
|
||||
CMAKE_GENERATOR_OVERRIDE="-G \"MSYS Makefiles\""
|
||||
APPVEYOR=$$(APPVEYOR)
|
||||
equals(APPVEYOR, "True") {
|
||||
CMAKE_C_COMPILER_OVERRIDE="-DCMAKE_C_COMPILER=gcc"
|
||||
}
|
||||
}
|
||||
win32-g++:CMAKE_GENERATOR_OVERRIDE="-G \"MSYS Makefiles\""
|
||||
udpdiscoverycpplib.name = Generating libudp-discovery.a.
|
||||
udpdiscoverycpplib.input = DUMMYQMAKECOMPILERINPUT
|
||||
udpdiscoverycpplib.output = $$clean_path($${UDP_DISCOVERY_BUILD_PATH}/libudp-discovery.a)
|
||||
@ -958,7 +952,7 @@ rs_broadcast_discovery {
|
||||
true ) && \
|
||||
mkdir -p $${UDP_DISCOVERY_BUILD_PATH} && \
|
||||
cd $${UDP_DISCOVERY_BUILD_PATH} && \
|
||||
cmake $${CMAKE_C_COMPILER_OVERRIDE} \
|
||||
cmake -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
|
||||
-DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
|
||||
$${CMAKE_GENERATOR_OVERRIDE} \
|
||||
-DBUILD_EXAMPLE=OFF -DBUILD_TOOL=OFF \
|
||||
|
@ -324,6 +324,19 @@ defineReplace(linkDynamicLibs) {
|
||||
return($$retDlib)
|
||||
}
|
||||
|
||||
## On some environements qmake chose a C++ compiler as C compiler, this breaks
|
||||
## some sub targets, such as those based on cmake which test for chosen C
|
||||
## compiler to be a proper C compiler. This function try to deduce the correct C
|
||||
## compiler also in those cases, and return it. So you can use
|
||||
## $$fixQmakeCC($$QMAKE_CC) in those cases instead of plain $$QMAKE_CC
|
||||
defineReplace(fixQmakeCC) {
|
||||
retVal = $$1
|
||||
contains(1, .*\+\+$):retVal=$$str_member($$1, 0 ,-3)
|
||||
contains(1, .*g\+\+$):retVal=$$str_member($$1, 0 ,-3)cc
|
||||
contains(1, .*clang\+\+$):retVal=$$str_member($$1, 0 ,-3)
|
||||
return($$retVal)
|
||||
}
|
||||
|
||||
################################################################################
|
||||
## Statements and variables that depends on build options (CONFIG) goes here ###
|
||||
################################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user