Set variable for FreeBSD on CMakeLists.txt
@@ -107,6 +107,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Dd_m3LogOutput=0")
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID AND NOT N3DS)
set(LINUX TRUE)
+
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
+ set(FREEBSD TRUE)
+ endif()
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -436,9 +440,10 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED)
add_library(tic80core${SCRIPT} STATIC ${TIC80CORE_SRC})
- # FreeBSD
+ if (FREEBSD)
target_include_directories(tic80core${SCRIPT} PRIVATE ${SYSROOT_PATH}/usr/local/include)
target_link_directories(tic80core${SCRIPT} PRIVATE ${SYSROOT_PATH}/usr/local/lib)
+ endif()
target_include_directories(tic80core${SCRIPT}
PRIVATE
@@ -525,9 +530,10 @@ if(BUILD_SDL AND BUILD_PLAYER AND NOT RPI)
add_executable(player-sdl WIN32 ${CMAKE_SOURCE_DIR}/src/system/sdl/player.c)
- # FreeBSD
+ if (FREEBSD)
target_include_directories(player-sdl PRIVATE ${SYSROOT_PATH}/usr/local/include)
target_link_directories(player-sdl PRIVATE ${SYSROOT_PATH}/usr/local/lib)
+ endif()
target_include_directories(player-sdl PRIVATE
${THIRDPARTY_DIR}/sdl2/include
@@ -1045,9 +1051,10 @@ if(BUILD_SDL)
target_compile_definitions(tic80 PRIVATE TOUCH_INPUT_SUPPORT)
endif()
- # FreeBSD
+ if (FREEBSD)
target_include_directories(tic80 PRIVATE ${SYSROOT_PATH}/usr/local/include)
target_link_directories(tic80 PRIVATE ${SYSROOT_PATH}/usr/local/lib)
+ endif()
if(RPI)
target_include_directories(tic80 PRIVATE ${SYSROOT_PATH}/usr/local/include/SDL2)
