Skip to content

Commit

Permalink
[ADD] : add ASAN in DemoApp of linux github/actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Feb 1, 2024
1 parent c07d176 commit 9773d6d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install OpenGL lib / Requirement for Glfw3
run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev
- name: configure
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_LEAK_SANITIZER=ON
- name: build
run: cmake --build build --config Release
- name: ctest
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Install OpenGL lib / Requirement for Glfw3
run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev
- name: configure
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_STD_FILESYSTEM=ON
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_STD_FILESYSTEM=ON -DUSE_LEAK_SANITIZER=ON
- name: build
run: cmake --build build --config Release
- name: ctest
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Install OpenGL lib / Requirement for Glfw3
run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev
- name: configure
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_BOOST_DEMO_FILESYSTEM=ON
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_BOOST_DEMO_FILESYSTEM=ON -DUSE_LEAK_SANITIZER=ON
- name: build
run: cmake --build build --config Release
- name: ctest
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ option(USE_TEST "Enable tests" ON)
option(USE_STD_FILESYSTEM "Enable std::filesystem use for path and ImGuiFileDialog" OFF)
option(USE_BOOST_DEMO_FILESYSTEM "Enable the demo of custom filesystem here with boost" OFF)

if (UNIX)
option(USE_LEAK_SANITIZER "Enable the Leak Sanitizer" OFF)
endif()

include(cmake/3rdparty.cmake)

if (USE_BOOST_DEMO_FILESYSTEM)
Expand Down Expand Up @@ -85,6 +89,11 @@ if (USE_TEST)
add_definitions(-DNEED_TO_BE_PUBLIC_FOR_TESTS)
endif()

if (USE_LEAK_SANITIZER)
add_compile_options(-fexceptions -pthread -ldl -lGL -Wall -Werror -g -fsanitize=undefined -fno-sanitize-recover -fsanitize=float-cast-overflow -fsanitize=leak -fsanitize=address -fsanitize-address-use-after-scope -fstack-protector -fstack-protector-all -fstack-check)
add_link_options(-fexceptions -pthread -ldl -lGL -Wall -Werror -g -fsanitize=undefined -fno-sanitize-recover -fsanitize=float-cast-overflow -fsanitize=leak -fsanitize=address -fsanitize-address-use-after-scope -fstack-protector -fstack-protector-all -fstack-check)
endif()

add_subdirectory(${CMAKE_SOURCE_DIR}/ImGuiFileDialog)

target_link_libraries(ImGuiFileDialog PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion ImGuiFileDialog

0 comments on commit 9773d6d

Please sign in to comment.