aardappel / lobster

The Lobster Programming Language

Home Page:http://strlen.com/lobster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing include dir for libtcc

stolk opened this issue · comments

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.

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: #147
@dcurrie Can you explain why it was needed, maybe we can do it more elegantly?

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.

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.

Reverted: 5b94e13

@stolk I presume this fixes things for you :)