diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2020-10-30 08:29:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 08:29:28 (GMT) |
commit | 8323cf108f88d582d1f0ced0f44d266e0cd03c3a (patch) | |
tree | bbdb07674f4d5f8b290855fce1e11c60ed803873 /CMakeLists.txt | |
parent | 5993141c0977f563de5e064fbbe617f9dc34bb8d (diff) | |
parent | e74884f02614c6718898d169632078a15e532e50 (diff) | |
download | Ninja-8323cf108f88d582d1f0ced0f44d266e0cd03c3a.zip Ninja-8323cf108f88d582d1f0ced0f44d266e0cd03c3a.tar.gz Ninja-8323cf108f88d582d1f0ced0f44d266e0cd03c3a.tar.bz2 |
Merge pull request #1865 from ThePrez/ibmi
build: Add IBM i compile/link flags
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e6bdd9..b0b2fef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,13 @@ if(MINGW) target_compile_definitions(libninja PRIVATE _WIN32_WINNT=0x0601 __USE_MINGW_ANSI_STDIO=1) endif() +# On IBM i (identified as "OS400" for compatibility reasons), this fixes missing +# PRId64 (and others) at compile time, and links to libutil for getopt_long +if(CMAKE_SYSTEM_NAME STREQUAL "OS400") + string(APPEND CMAKE_CXX_FLAGS " -D__STDC_FORMAT_MACROS") + string(APPEND CMAKE_EXE_LINKER_FLAGS " -lutil") +endif() + # Main executable is library plus main() function. add_executable(ninja src/ninja.cc) target_link_libraries(ninja PRIVATE libninja libninja-re2c) |