aardappel / lobster

The Lobster Programming Language
http://strlen.com/lobster
2.24k stars 121 forks source link

Missing include dir for libtcc #215

Closed stolk closed 1 year ago

stolk commented 1 year ago

From dev/CMakeLists.txt

# include only for QUOTE includes: external/libtcc

What is the rationale for not adding external/libtcc directory? Currently, building on Ubuntu 22.10 machine fails with:

/home/bram/src/lobster/dev/src/tccbind.cpp:5:10: fatal error: libtcc.h: No such file or directory

Putting it back in, makes my build succeed.

aardappel commented 1 year ago

Weird, it currently builds just fine on GitHub CI with CMake on Linux with both Clang and GCC. Anything that could be different about your setup?

That said, I would agree it is a strange way of doing things, and that change was introduced here: https://github.com/aardappel/lobster/pull/147 @dcurrie Can you explain why it was needed, maybe we can do it more elegantly?

dcurrie commented 1 year ago

The hack no longer appears necessary on my system (macOS 12.6 and Apple clang version 14.0.0). So, as far as I am concerned, the patch can be reverted. If compatibility with older macOS and Apple clang versions are desired, an alternative patch is

include_directories(include
                    src
                    external/SDL/include
                    external/SDLMixer
                    external/freetype/include
                    external/imgui
                    # include only for QUOTE includes on macOS: external/libtcc
                    )
# include only for QUOTE includes on macOS:
if(APPLE)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -iquote external/libtcc")
else()
  include_directories(external/libtcc)
endif()

Either approach should fix this issue, though I have only tested on macOS 12.6 and Apple clang version 14.0.0.

aardappel commented 1 year ago

I think this project is still small enough that telling people "you need a newer XCode" is acceptable, and I'd rather simplify things.

I'll push a revert.

aardappel commented 1 year ago

Reverted: https://github.com/aardappel/lobster/commit/5b94e130067890ccd171902efceb176b013156b9

@stolk I presume this fixes things for you :)