Fix GitHub CI build and minor CMake issues

- GitHub CI: fix wrong CMake option name
- fl_add_library: disable debug output (MSVC), fix formatting
This commit is contained in:
Albrecht Schlosser
2024-02-07 20:03:29 +01:00
parent fd5cd80935
commit a1d3bf182e
2 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
# Note the current convention is to use the -S and -B options here to specify source # Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher. # and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D FLTK_OPTION_USE_WAYLAND=OFF -D CMAKE_CXX_STANDARD=98 -D CMAKE_CXX_EXTENSIONS=OFF -D CMAKE_C_FLAGS_INIT="-Wall -Wunused" -D CMAKE_CXX_FLAGS_INIT="-Wall -Wunused" run: cmake $GITHUB_WORKSPACE -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D FLTK_BACKEND_WAYLAND=OFF -D CMAKE_CXX_STANDARD=98 -D CMAKE_CXX_EXTENSIONS=OFF -D CMAKE_C_FLAGS_INIT="-Wall -Wunused" -D CMAKE_CXX_FLAGS_INIT="-Wall -Wunused"
- name: Build - name: Build
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
+12 -12
View File
@@ -39,7 +39,7 @@
# #
####################################################################### #######################################################################
function (fl_add_library LIBNAME LIBTYPE SOURCES) function(fl_add_library LIBNAME LIBTYPE SOURCES)
# message(STATUS "Building library **************** ${LIBNAME} ${LIBTYPE}") # message(STATUS "Building library **************** ${LIBNAME} ${LIBTYPE}")
@@ -82,7 +82,7 @@ function (fl_add_library LIBNAME LIBTYPE SOURCES)
endif() endif()
set(alias_name "fltk::${alias_name}${suffix}") set(alias_name "fltk::${alias_name}${suffix}")
add_library (${alias_name} ALIAS ${TARGET_NAME}) add_library(${alias_name} ALIAS ${TARGET_NAME})
if(0) if(0)
fl_debug_var(TARGET_NAME) fl_debug_var(TARGET_NAME)
@@ -96,7 +96,7 @@ function (fl_add_library LIBNAME LIBTYPE SOURCES)
# Set 'PRIVATE' target compile definitions for the library # Set 'PRIVATE' target compile definitions for the library
# so they are not inherited by consumers # so they are not inherited by consumers
target_compile_definitions (${TARGET_NAME} PRIVATE "FL_LIBRARY") target_compile_definitions(${TARGET_NAME} PRIVATE "FL_LIBRARY")
# Set PUBLIC include and linker directories # Set PUBLIC include and linker directories
@@ -195,7 +195,7 @@ function (fl_add_library LIBNAME LIBTYPE SOURCES)
OUTPUT_NAME_DEBUG ${LIBNAME}_dlld OUTPUT_NAME_DEBUG ${LIBNAME}_dlld
OUTPUT_NAME_RELEASE ${LIBNAME}_dll OUTPUT_NAME_RELEASE ${LIBNAME}_dll
) )
target_compile_definitions (${TARGET_NAME} PRIVATE FL_DLL) target_compile_definitions(${TARGET_NAME} PRIVATE FL_DLL)
endif(MSVC) endif(MSVC)
endif(LIBTYPE STREQUAL "SHARED") endif(LIBTYPE STREQUAL "SHARED")
@@ -203,11 +203,11 @@ function (fl_add_library LIBNAME LIBTYPE SOURCES)
set(DEBUG_ONAME 0) set(DEBUG_ONAME 0)
if(DEBUG_ONAME) if(DEBUG_ONAME)
get_target_property (XX_NAME ${TARGET_NAME} NAME) get_target_property(XX_NAME ${TARGET_NAME} NAME)
get_target_property (XX_ONAME ${TARGET_NAME} OUTPUT_NAME) get_target_property(XX_ONAME ${TARGET_NAME} OUTPUT_NAME)
get_target_property (XX_ONAME_DEBUG ${TARGET_NAME} OUTPUT_NAME_DEBUG) get_target_property(XX_ONAME_DEBUG ${TARGET_NAME} OUTPUT_NAME_DEBUG)
get_target_property (XX_ONAME_RELEASE ${TARGET_NAME} OUTPUT_NAME_RELEASE) get_target_property(XX_ONAME_RELEASE ${TARGET_NAME} OUTPUT_NAME_RELEASE)
get_target_property (XX_EXPORT_NAME ${TARGET_NAME} EXPORT_NAME) get_target_property(XX_EXPORT_NAME ${TARGET_NAME} EXPORT_NAME)
message(STATUS "--- DEBUG_ONAME ---") message(STATUS "--- DEBUG_ONAME ---")
fl_debug_var(TARGET_NAME) fl_debug_var(TARGET_NAME)
@@ -221,8 +221,8 @@ function (fl_add_library LIBNAME LIBTYPE SOURCES)
if(MSVC) if(MSVC)
if(FLTK_OPTION_LARGE_FILE) if(FLTK_OPTION_LARGE_FILE)
fl_debug_var(FLTK_OPTION_LARGE_FILE) # fl_debug_var(FLTK_OPTION_LARGE_FILE)
fl_debug_var(TARGET_NAME) # fl_debug_var(TARGET_NAME)
set_target_properties(${TARGET_NAME} PROPERTIES set_target_properties(${TARGET_NAME} PROPERTIES
LINK_FLAGS /LARGEADDRESSAWARE LINK_FLAGS /LARGEADDRESSAWARE
) )
@@ -251,4 +251,4 @@ function (fl_add_library LIBNAME LIBTYPE SOURCES)
message("") message("")
endif() endif()
endfunction (fl_add_library LIBNAME LIBTYPE SOURCES) endfunction(fl_add_library LIBNAME LIBTYPE SOURCES)