Skip to content

Commit

Permalink
Build in the proper order.
Browse files Browse the repository at this point in the history
  • Loading branch information
viega committed Jul 6, 2024
1 parent 7fd2ff4 commit e73ccf4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
26 changes: 16 additions & 10 deletions dev
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ function log {
echo $(color blue "[-- libcon4m --]" $@)
}

function meson_build {

echo ${1} > .meson_last
rm deps/local 2>/dev/null
ln -s ${PWD}/deps/${OS}-${ARCH} ${PWD}/deps/local


function meson_init_target {
if [[ ! -d ${1} ]]; then
if [[ -f ${1} ]]; then
rm -rf ${1}
Expand All @@ -47,6 +41,16 @@ function meson_build {
log meson setup ${@}
meson setup ${@}
fi
}

function meson_build {

echo ${1} > .meson_last
rm deps/local 2>/dev/null
ln -s ${PWD}/deps/${OS}-${ARCH} ${PWD}/deps/local


meson_init_target ${@}
cd ${1}

log Compiling meson target ${1}
Expand Down Expand Up @@ -178,12 +182,14 @@ case $1 in
;;
build) meson_build build --buildtype=plain
;;
debug) meson_build debug --buildtype=debug
debug) meson_init_target debug --buildtype=debug
meson configure debug -Duse_memcheck=true
meson_build debug
debug_it
;;
testbuild) meson_build cicd --buildtype=debug
meson configure cicd -Duse_ubsan=true -Duse_asan=true -Duse_memcheck=true
testbuild) meson_init_target cicd --buildtype=debug
meson configure cicd -Duse_ubsan=true -Duse_asan=true -Duse_memcheck=true
meson_build cicd
;;
release) meson_build release --buildtype=release
;;
Expand Down
2 changes: 1 addition & 1 deletion include/con4m/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ void _c4m_memcheck_object(c4m_obj_t, char *, int);
#endif
#endif

#if defined(__SANITIZE_ADDRESS__)
#if defined(__SANITIZE_ADDRESS__) && defined(C4M_EXPERIMENTAL_POISONING)
void __asan_poison_memory_region(void const volatile *addr, size_t size);
void __asan_unpoison_memory_region(void const volatile *addr, size_t size);

Expand Down
15 changes: 9 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ endif

if (get_option('use_ubsan') == true)
c_args = c_args + ['-fsanitize=undefined',
'-fsanitize-recover=all'
]
'-fsanitize-recover=all'
]
link_args = link_args + ['-fsanitize=undefined',
'-fsanitize-recover=all'
]
'-fsanitize-recover=all'
]
endif

if (get_option('use_memcheck') == true)
Expand Down Expand Up @@ -211,8 +211,11 @@ lib_src = c4m_src + hat_primary
test_src = ['src/tests/test.c']

threads = dependency('threads')
math = cc.find_library('m', required : false)
ffi = cc.find_library('ffi', required : true, dirs: meson.current_source_dir() + '/deps/local/')
math = cc.find_library('m',
required : false)
ffi = cc.find_library('ffi',
required : true,
dirs: meson.current_source_dir() + '/deps/local/')

crypto = cc.find_library('crypto')
ssl = cc.find_library('ssl')
Expand Down

0 comments on commit e73ccf4

Please sign in to comment.