CC_EXTRA_OPS and LD_EXTRA_OPS are not used inside the
CMakeLists. I will adopt this so, it appends to the already defined options! Is this the
expected behavior or you want to override them?
@linuxmaniac Regarding this, `CMake` offer some env variables
([
CFLAGS](https://cmake.org/cmake/help/latest/envvar/CFLAGS.html) and
[
LDFLAGS](https://cmake.org/cmake/help/latest/envvar/LDFLAGS.html#ldflags)) where the user
can use, and then `CMake` use them to initialize the lists along some default compiler
specifics.
So, to use them you have to set them as env variables just before the `cmake`
configuration phase like:
**_Note: Be sure to run this the first time you run the CMake configuration phase.
Subsquent call have the corresponding CMake variables used as cached already and therefore
do no use the provided ones to initialize them. You can use --fresh though, as if you were
calling it the first time._**
```
LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro " CFLAGS="-g -O2
-fdebug-prefix-map=/home/xenofon/kamailio-cmake=. -fstack-protector-strong -Wformat
-Werror=format-security" cmake -S . -B build -DCMAKE_INSTALL_PREFIX=./kam6.0
-DINCLUDE_MODULES="async" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DVERBOSE=ON
-DMODULE_GROUP_NAME=KSTANDARD -DBUILD_DOC=ON -DEXCLUDE_MODULES="db_oracle dnssec jwt
microhttpd nats nsq ruxc secsipid_proc stirshaken tls_wolfssl"
-DCMAKE_BUILD_TYPE="Debug --fresh"
```
and then for verifying:
`cmake --build build -t acc -v ` outputs (see bold -g -O2 ...)
cd /home/xenofon/kamailio-cmake/build/src/modules/acc
&& /usr/bin/cc -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024
-DARCH=\"x86_64\" -DCC_GCC_LIKE_ASM
-DCFG_DIR=\"/home/xenofon/kamailio-cmake/kam6.0/etc/kamailio/\"
-DCOMPILER="\"gcc 10.5.0\"" -DDBG_SR_MEMORY -DDISABLE_NAGLE
-DDNS_IP_HACK -DFAST_LOCK -DFMSTATS -DF_MALLOC -DHAVE_ALLOCA_H -DHAVE_EPOLL
-DHAVE_GETHOSTBYNAME2 -DHAVE_IP_MREQN -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_MSG_NOSIGNAL
-DHAVE_RESOLV_RES -DHAVE_SCHED_SETSCHEDULER -DHAVE_SCHED_YIELD -DHAVE_SELECT
-DHAVE_SIGIO_RT -DHAVE_TIMEGM -DHAVE_UNION_SEMUN -DKMSTATS -DKSR_PTHREAD_MUTEX_SHARED
-DMALLOC_STATS -DMOD_NAME=\"acc\" -DMOD_NAMEID=acc -DNAME=\"kamailio\"
-DOS=Linux -DOS_QUOTED=\"Linux\" -DPIC -DPKG_MALLOC -DQ_MALLOC -DRAW_SOCKS
-DRUN_DIR=\"/home/xenofon/kamailio-cmake/kam6.0/var/run/kamailio\"
-DSHARE_DIR=\"/home/xenofon/kamailio-cmake/kam6.0/share/kamailio/\" -DSHM_MMAP
-DSIGINFO64_WORKAROUND -DSTATISTICS -DTLSF_MALLOC -DTLS_HOOKS -DUSE_DNS_CACHE
-DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_FUTEX -DUSE_MCAST -DUSE_NAPTR -DUSE_RAW_SOCKS
-DUSE_SCTP -DUSE_TCP -DUSE_TLS -DVERSION=\"6.0.0-dev2\" -DVERSIONVAL=6000000
-D__CPU_x86_64 -D__OS_linux -Dacc_EXPORTS **-g -O2
-fdebug-prefix-map=/home/xenofon/kamailio-cmake=. -fstack-protector-strong -Wformat
-Werror=format-security** -g -std=gnu11 -fPIC
-ffile-prefix-map=/home/xenofon/kamailio-cmake/src/modules/acc/= -fPIC -O0 -Wall
-funroll-loops -Wcast-align -Werror=implicit-function-declaration -Werror=implicit-int
-m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow
-mtune=generic -MD -MT src/modules/acc/CMakeFiles/acc.dir/acc_mod.c.o -MF
CMakeFiles/acc.dir/acc_mod.c.o.d -o CMakeFiles/acc.dir/acc_mod.c.o -c
/home/xenofon/kamailio-cmake/src/modules/acc/acc_mod.c
/usr/bin/cc -fPIC -g -O2
-fdebug-prefix-map=/home/xenofon/kamailio-cmake=. -fstack-protector-strong -Wformat
-Werror=format-security -g **-Wl,-Bsymbolic-functions -Wl,-z,relro** -shared
-Wl,-soname,acc.so -o acc.so
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4053#issuecomment-2545146514
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4053/2545146514(a)github.com>