orangeduck / Corange

Pure C Game Engine
http://www.youtube.com/watch?v=482GxqTWXtA
Other
1.78k stars 199 forks source link

How to Build this from CMake #45

Open CodeSwimBikeRunner opened 4 years ago

CodeSwimBikeRunner commented 4 years ago

Is there any chance to add CMakeLists support for this project?

orangeduck commented 4 years ago

You can take a look at this PR which adds CMake support: https://github.com/orangeduck/Corange/pull/29

CodeSwimBikeRunner commented 4 years ago

I'm not a big fan of CMake either @orangeduck but I like that the structure and purpose of cmake is it at least gives "hope" for cross platform building, with the project being a graphics engine, it would be really awesome to build for windows, android, ios, xbox, linux, mac, ios, my fridge, etc.

blogdron commented 4 years ago

@CodeSwimBikeRunner In the future, Cmake brings more problems than benefits, just a Makefile gives a clear understanding of how the assembly is done and what is needed for this. Cmake and the rest of the systems saying “rely on us” provide only trivial things, a step to the line and everything broke down; in the case of Cmake, you have to drag the project into the muses in the form of library search modules; in the case of Meson you need to have python and still have to install ninja all other systems are also dragged with a bunch of trash. In fact, speaking of the good portability of Corange, I need to (in my opinion) understand that it needs to be kept within POSIX on all portable systems.

A clean Makefile written by a person’s hand allows you to build a project even if you suddenly don’t have build systems on the target system so everything is clear and distinct, unlike generators of build files.

As it is now, the Makefile makes it quite simple to add a new build target. For example, I compile for Windows on linux using mingw and am currently working on porting to Android using CRYSTALX (since it allows you to use POSIX and gcc, google forcefully forces clang to be used in my NDK)

In its current form, all you need to build is any C compiler and make. In my opinion, you should not complicate it simply because it looks too simple.

Makefile Forever! :smile:

android, ios, xbox, linux, mac, ios, my fridge, etc.

android - no need cmake becouse build host not android linux - very eze build no need cmake mac - very eze build no need cmake ios - mission failed agent 007 ) my fridge - Hmmm. so eze! make PLATFORM=my_fridge FRIDGE_NDK=~/blabla/fndk

ifeq ($(findstring my_fridge,$(PLATFORM)),my_fridge)
        ifeq ($(FRIDGE_NDK),)
        FRIDGE_NDK=./fndk/
        endif
        CC=i686-fridge-cc
        AR=i686-fridge-ar
    DYNAMIC = libcorange.so
    STATIC = libcorange.a
    CFLAGS += -fPIC
    LFLAGS += -lFridgeGL -lfridgelibc -L$(FRIDGE_NDK)/libs/shred/
endif

Sorry for the intervention ::) and my english :D

The beauty of Corange is its transparency, transparent code where everything is clear and a transparent assembly where everything is also clear