Skip to content

Commit

Permalink
Some fixes to linux builds (#1144)
Browse files Browse the repository at this point in the history
* compile flag cleanup for linux
* rollback indra/llcommon/llprofiler.h
* use 3p fltk package
* fix build gcc 13 (dangling-pointer)
  • Loading branch information
AiraYumi authored Apr 8, 2024
1 parent e79c32e commit bbd6dfc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 18 deletions.
30 changes: 30 additions & 0 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,36 @@
<key>description</key>
<string>Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.</string>
</map>
<key>fltk</key>
<map>
<key>platforms</key>
<map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>691fef2ddd57d7b6c26e87fc82d9ace3f54e078c</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-fltk/releases/download/v1.3.9-r1/fltk-1.3.9.8556992788-linux64-8556992788.tar.zst</string>
</map>
<key>name</key>
<string>linux</string>
</map>
</map>
<key>license</key>
<string>LGPL/fltk</string>
<key>license_file</key>
<string>LICENSES/fltk.txt</string>
<key>copyright</key>
<string>Copyright (C) fltk project</string>
<key>version</key>
<string>1.3.5</string>
<key>name</key>
<string>fltk</string>
</map>
<key>apr_suite</key>
<map>
<key>platforms</key>
Expand Down
2 changes: 1 addition & 1 deletion indra/cmake/00-Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ if (LINUX OR DARWIN)
list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor )

if(LINUX)
list(APPEND GCC_WARNINGS -Wno-maybe-uninitialized -Wno-misleading-indentation -Wno-stringop-truncation -Wno-unused-value )
list(APPEND GCC_WARNINGS -Wno-maybe-uninitialized -Wno-dangling-pointer )
endif()

add_compile_options(${GCC_WARNINGS})
Expand Down
16 changes: 3 additions & 13 deletions indra/cmake/UI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,15 @@ include(GLIB)
add_library( ll::uilibraries INTERFACE IMPORTED )

if (LINUX)
target_compile_definitions(ll::uilibraries INTERFACE LL_X11=1 )
use_prebuilt_binary(fltk)
target_compile_definitions(ll::uilibraries INTERFACE LL_FLTK=1 LL_X11=1 )

if( USE_CONAN )
return()
endif()

find_package(FLTK REQUIRED )
find_library(ND_FLTK_STATIC_LIBRARY libfltk.a PATH_SUFFIXES fltk )

if( NOT ND_FLTK_STATIC_LIBRARY )
message(FATAL_ERROR "libfltk.a not found")
else()
message("libfltk.a found ${ND_FLTK_STATIC_LIBRARY}")
endif()

target_include_directories( ll::uilibraries SYSTEM INTERFACE ${FLTK_INCLUDE_DIR})
target_compile_definitions( ll::uilibraries INTERFACE LL_FLTK=1 )
target_link_libraries( ll::uilibraries INTERFACE
${ND_FLTK_STATIC_LIBRARY}
fltk
Xrender
Xcursor
Xfixes
Expand Down
5 changes: 1 addition & 4 deletions indra/llcommon/llprofiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
#define LL_PROFILER_CONFIGURATION LL_PROFILER_CONFIG_FAST_TIMER
#endif

#if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY || LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER
#include "Tracy.hpp"
#endif

extern thread_local bool gProfilerEnabled;

#if defined(LL_PROFILER_CONFIGURATION) && (LL_PROFILER_CONFIGURATION > LL_PROFILER_CONFIG_NONE)
Expand All @@ -88,6 +84,7 @@ extern thread_local bool gProfilerEnabled;
// #define TRACY_NO_BROADCAST 1
// #define TRACY_ONLY_LOCALHOST 1
#define TRACY_ONLY_IPV4 1
#include "Tracy.hpp"

// Enable OpenGL profiling
#define LL_PROFILER_ENABLE_TRACY_OPENGL 0
Expand Down

0 comments on commit bbd6dfc

Please sign in to comment.