vcpkg/ports/wxwidgets/example/CMakeLists.txt
Vitalii Koshura 6e16931acd
[wxwidgets] Remove debug asserts from Release build. (#25240)
* [wxWidgets] Remove debug asserts from Release build.

Currently when building wxWidgets in Release mode, the debug asserts are enabled.
This fixes this issue by providing a necessary define to disable them.

Ref: https://docs.wxwidgets.org/3.1.6/group__group__funcmacro__debug.html

[wxCharts, vcpkg-ci-wxwidgets] Update ports to include fix for wxWidgets release build with debug asserts off when building a dynamic/shared library.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>

* Update wxcharts.json

Co-authored-by: LilyWangLL <94091114+LilyWangLL@users.noreply.github.com>
2022-06-16 15:21:18 -07:00

32 lines
1.0 KiB
CMake

cmake_minimum_required(VERSION 3.7)
project(wxwidgets-example)
option(wxBUILD_DEBUG_LEVEL "Debug Level" Default)
if(NOT wxBUILD_DEBUG_LEVEL STREQUAL "Default")
add_compile_options("-DwxDEBUG_LEVEL=${wxBUILD_DEBUG_LEVEL}")
endif()
add_executable(main WIN32 popup.cpp)
find_package(wxWidgets REQUIRED)
target_compile_definitions(main PRIVATE ${wxWidgets_DEFINITIONS} "$<$<CONFIG:DEBUG>:${wxWidgets_DEFINITIONS_DEBUG}>")
target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES})
option(USE_WXRC "Use the wxrc resource compiler" ON)
if(USE_WXRC)
execute_process(
COMMAND "${wxWidgets_wxrc_EXECUTABLE}" --help
RESULTS_VARIABLE error_result
)
if(error_result)
message(FATAL_ERROR "Failed to run wxWidgets_wxrc_EXECUTABLE (${wxWidgets_wxrc_EXECUTABLE})")
endif()
endif()
set(PRINT_VARS "" CACHE STRING "Variables to print at the end of configuration")
foreach(var IN LISTS PRINT_VARS)
message(STATUS "${var}:=${${var}}")
endforeach()