# file : curl/buildfile # license : cURL License; see accompanying COPYING file import libs = libcurl%lib{curl} import libs += libca-certificates-curl%lib{ca-certificates-curl} exe{curl}: h{**} c{** -src/tool_main -lib/**} $libs tclass = $c.target.class tsys = $c.target.system # Build options. # c.poptions += -DHAVE_CONFIG_H # Note that the upstream package uses the -pthread compiler/linker option on # Linux and FreeBSD. The option is unsupported by build2 so we pass # -D_REENTRANT and -lpthread preprocessor/linker options instead. # switch $tclass, $tsys { case 'linux' | 'bsd' c.poptions += -D_REENTRANT case 'windows', 'win32-msvc' c.poptions += -DWIN32 } c.poptions =+ "-I$src_base" "-I$src_base/src" "-I$src_base/lib" switch $c.class, $tsys { case 'gcc' { # Disable the Clang targeting MSVC warnings. # if ($c.id == 'clang' && $tsys == 'win32-msvc') c.coptions += -Wno-deprecated-declarations } case 'msvc' { # Disable warnings that pop up with /W3. # c.coptions += /wd4996 } } switch $tclass, $tsys { case 'linux' | 'bsd' c.libs += -lpthread case 'windows', 'mingw32' c.libs+= -lws2_32 case 'windows' c.libs += ws2_32.lib }