summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Niklas Hasse <jhasse@bixense.com>2020-10-30 08:29:28 (GMT)
committerGitHub <noreply@github.com>2020-10-30 08:29:28 (GMT)
commit8323cf108f88d582d1f0ced0f44d266e0cd03c3a (patch)
treebbdb07674f4d5f8b290855fce1e11c60ed803873
parent5993141c0977f563de5e064fbbe617f9dc34bb8d (diff)
parente74884f02614c6718898d169632078a15e532e50 (diff)
downloadNinja-8323cf108f88d582d1f0ced0f44d266e0cd03c3a.zip
Ninja-8323cf108f88d582d1f0ced0f44d266e0cd03c3a.tar.gz
Ninja-8323cf108f88d582d1f0ced0f44d266e0cd03c3a.tar.bz2
Merge pull request #1865 from ThePrez/ibmi
build: Add IBM i compile/link flags
-rw-r--r--CMakeLists.txt7
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)