Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat, build] Compatibility with other CMake generators #861

Merged
merged 3 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions .ci/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# don't do this for clang
if [ "$CXX" = "g++" ]; then
export CXX="g++-4.8" CC="gcc-4.8"
export CXX="g++-5" CC="gcc-5"
fi
# in case anything ignores the environment variables, override through PATH
mkdir bin
ln -s "$(command -v gcc-4.8)" bin/cc
ln -s "$(command -v gcc-4.8)" bin/gcc
ln -s "$(command -v c++-4.8)" bin/c++
ln -s "$(command -v g++-4.8)" bin/g++
ln -s "$(command -v gcc-5)" bin/cc
ln -s "$(command -v gcc-5)" bin/gcc
ln -s "$(command -v c++-5)" bin/c++
ln -s "$(command -v g++-5)" bin/g++

export PATH=$PWD/bin:$PATH
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
matrix:
- SHELLCHECKS=1
- EMULATE_READER=1 CC=gcc
- EMULATE_READER=1 CC=gcc USE_NINJA=1
- EMULATE_READER=1 CC=gcc KODEBUG=1
- EMULATE_READER=1 CC=clang
- TARGET=kindle DOCKER_IMG=frenzie/kokindle:0.1.0
Expand All @@ -30,7 +31,8 @@ addons:
apt:
packages:
- cmake
- g++-4.8
- ninja-build
- g++
- libsdl1.2-dev
- luarocks
# for luasec
Expand Down
5 changes: 5 additions & 0 deletions Makefile.defs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export CMAKE_BUILD_TYPE

# CMAKE=cmake --no-warn-unused-cli
CMAKE=cmake
KO_BUILD_SYSTEM=$(MAKE)
ifdef USE_NINJA
CMAKE:=cmake -G Ninja
KO_BUILD_SYSTEM:=ninja
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NiLuJe Any feedback on the variable name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a huge fan, but I'm at a loss for anything better right now...

Copy link
Member

@NiLuJe NiLuJe Mar 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(It's mainly the loss of MAKE in the name that bothers me, as that's recognizable at a glance).

Even if it technically wouldn't make much sense when MAKE isn't make anymore, but, still :D.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'd actually called it something like KOMAKE at first (not sure if that was it; never committed that) but then I looked at KOMAKE:=ninja and changed the name. :-P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could also be called something like (KO)MAKE_BACKEND, although that makes me think more of GNU Make vs BSD Make or whatever. But maybe KO_BUILD_BACKEND sounds better than system?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just something like KO_CMAKE_GENERATOR since it is in fact intended for CMake, with that KO_ prefix to differentiate it from CMake's built-in CMAKE_GENERATOR thingy? Or possibly not even that because CMake doesn't care about environment variables like that, although that might be confusing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, except CMake uses names like Ninja and Unix Makefiles for that one. They do use MAKE in this one:

//Program used to build from build.ninja files.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/ninja

So… (KO_)CMAKE_MAKE_PROGRAM?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I like that one ;)!

endif

# set this to your ARM cross compiler:
# set CC CXX AR LD RANLIB
Expand Down