improve NetBSD-specific code

NetBSD doesn't put packages in /usr/local like /CMakeLists.txt thought.
The `#ifdef __NetBSD__` around iconv was actually breaking compilation
on NetBSD when using the system libiconv (there's also a GNU iconv
package)
A C program included from C++ source broke on NetBSD specifically, work
around it.

This doesn't fix compilation on NetBSD, which is currently broken, but
is closer to correct.
This commit is contained in:
Guilherme Janczak
2024-05-03 00:30:15 +00:00
parent 5817be7bd3
commit 0859d2c472
3 changed files with 12 additions and 9 deletions

View File

@ -402,7 +402,7 @@ endif()
# All commands and submodule commands also need to see these
# changes, so just setting them in the project scope via
# include_directories and link_directories is not sufficient
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|NetBSD")
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/local")
set(CMAKE_REQUIRED_INCLUDES "/usr/local/include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")