Created
December 18, 2022 11:24
-
-
Save badlogic/e536462e9b7138ac7a8e6eb778e54378 to your computer and use it in GitHub Desktop.
A CMake toolchain file for DJGPP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set (CMAKE_SYSTEM_NAME linux-djgpp) | |
set (DJGPP TRUE) | |
# | |
# CMake toolchain file for DJGPP. Usage: | |
# | |
# 1. Download and extract DGJPP | |
# 2. Place this file into the root folder of DJGPP | |
# 3. When configuring your CMake project, specify the toolchain file like this: | |
# | |
# cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/djgpp/toolchain-djgpp.cmake ... | |
# | |
# specify the cross compiler | |
set (CMAKE_C_COMPILER ${CMAKE_CURRENT_LIST_DIR}/bin/i586-pc-msdosdjgpp-gcc) | |
set (CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/bin/i586-pc-msdosdjgpp-g++) | |
# where is the target environment | |
set (CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_LIST_DIR}) | |
# search for programs in the build host directories | |
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
# for libraries and headers in the target directories | |
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | |
# add sys-include dir to c/c++ flags by default. ides using | |
# compile-commands.json can't otherwise find includes. | |
set (CMAKE_C_FLAGS -I${CMAKE_CURRENT_LIST_DIR}/i586-pc-msdosdjgpp/sys-include/) | |
set (CMAKE_CXX_FLAGS -I${CMAKE_CURRENT_LIST_DIR}/i586-pc-msdosdjgpp/sys-include/) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment