Skip to content

Commit 43ad8be

Browse files
committed
fixed cmake scripts for library
1 parent e2f02fe commit 43ad8be

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

cmake/cxx-macros.cmake

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ macro(define_installable_cxx_library_project PROJ_NAME PROJ_PREFIX)
9393
# target_compile_definitions(${PROJ_NAME} INTERFACE
9494
# ${PROJ_PREFIX}_ENABLE_ASSERTIONS=${_${PROJ_NAME}_enable_assertions}
9595
# ${PROJ_PREFIX}_ENABLE_PRECONDITION_CHECKS=${_${PROJ_NAME}_enable_precondition_checks})
96-
target_compile_definitions(${PROJ_NAME} INTERFACE
97-
${PROJ_PREFIX}_ENABLE_ASSERTIONS=${_${PROJ_NAME}_enable_assertions}
98-
${PROJ_PREFIX}_ENABLE_PRECONDITION_CHECKS=${_${PROJ_NAME}_enable_precondition_checks}
99-
${PROJ_PREFIX}_ENABLE_THREAD_POOL_READY_SIGNAL=${_${PROJ_NAME}_enable_thread_pool_ready_signal}
100-
${PROJ_PREFIX}_ENABLE_VERBOSE_LOG=${_${PROJ_NAME}_enable_verbose_log}
101-
${PROJ_PREFIX}_TEST_THREAD_POOL_DBGOUT=${_${PROJ_NAME}_enable_thread_pool_dbgout}
102-
#${PROJ_PREFIX}_UNIT_TEST=${_${PROJ_NAME}_unit_test}
103-
)
96+
# target_compile_definitions(${PROJ_NAME} INTERFACE
97+
# ${PROJ_PREFIX}_ENABLE_ASSERTIONS=${_${PROJ_NAME}_enable_assertions}
98+
# ${PROJ_PREFIX}_ENABLE_PRECONDITION_CHECKS=${_${PROJ_NAME}_enable_precondition_checks}
99+
# ${PROJ_PREFIX}_ENABLE_THREAD_POOL_READY_SIGNAL=${_${PROJ_NAME}_enable_thread_pool_ready_signal}
100+
# ${PROJ_PREFIX}_ENABLE_VERBOSE_LOG=${_${PROJ_NAME}_enable_verbose_log}
101+
# ${PROJ_PREFIX}_TEST_THREAD_POOL_DBGOUT=${_${PROJ_NAME}_enable_thread_pool_dbgout}
102+
# #${PROJ_PREFIX}_UNIT_TEST=${_${PROJ_NAME}_unit_test}
103+
# V=1
104+
# )
104105
# set_target_properties(${PROJ_NAME} PROPERTIES
105106
# #${PROJECT_MACRO_PREFIX}_ENABLE_ASSERTIONS=${_${PROJECT_MACRO_NAME}_enable_assertions}
106107
# #${PROJECT_MACRO_PREFIX}_ENABLE_PRECONDITION_CHECKS=${_${PROJECT_MACRO_NAME}_enable_precondition_checks}
@@ -116,10 +117,24 @@ macro(define_installable_cxx_library_project PROJ_NAME PROJ_PREFIX)
116117
if (MSVC)
117118
target_compile_options(${PROJ_NAME} INTERFACE /wd4800 # truncation to bool warning
118119
#/D${PROJ_PREFIX}_UNIT_TEST=${_${PROJ_NAME}_unit_test}
120+
#/D${PROJ_PREFIX}_ENABLE_ASSERTIONS=${_${PROJ_NAME}_enable_assertions}
121+
#/D${PROJ_PREFIX}_ENABLE_PRECONDITION_CHECKS=${_${PROJ_NAME}_enable_precondition_checks}
122+
#/D${PROJ_PREFIX}_ENABLE_THREAD_POOL_READY_SIGNAL=${_${PROJ_NAME}_enable_thread_pool_ready_signal}
123+
#/D${PROJ_PREFIX}_ENABLE_VERBOSE_LOG=${_${PROJ_NAME}_enable_verbose_log}
124+
#/D${PROJ_PREFIX}_TEST_THREAD_POOL_DBGOUT=${_${PROJ_NAME}_enable_thread_pool_dbgout}
125+
#/D#${PROJ_PREFIX}_UNIT_TEST=${_${PROJ_NAME}_unit_test}
126+
#/DV=1
119127
)
120128
else ()
121129
target_compile_options(${PROJ_NAME} INTERFACE
122130
#-D${PROJ_PREFIX}_UNIT_TEST=${_${PROJ_NAME}_unit_test}
131+
#-D${PROJ_PREFIX}_ENABLE_ASSERTIONS=${_${PROJ_NAME}_enable_assertions}
132+
#-D${PROJ_PREFIX}_ENABLE_PRECONDITION_CHECKS=${_${PROJ_NAME}_enable_precondition_checks}
133+
#-D${PROJ_PREFIX}_ENABLE_THREAD_POOL_READY_SIGNAL=${_${PROJ_NAME}_enable_thread_pool_ready_signal}
134+
#-D${PROJ_PREFIX}_ENABLE_VERBOSE_LOG=${_${PROJ_NAME}_enable_verbose_log}
135+
#-D${PROJ_PREFIX}_TEST_THREAD_POOL_DBGOUT=${_${PROJ_NAME}_enable_thread_pool_dbgout}
136+
#-D#${PROJ_PREFIX}_UNIT_TEST=${_${PROJ_NAME}_unit_test}
137+
#-DV=1
123138
)
124139
endif ()
125140

cmake/prerequisites.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,18 @@ endif ()
119119
#include(GNUInstallDirs)
120120

121121

122+
#set(CMAKE_VERBOSE_MAKEFILE ON)
122123
if ((${CMAKE_VERBOSE_DEBUG} AND ${USE_DEBUG}) OR ($ENV{CI_RUNNING}))
123124
# Enable verbose output from Makefile builds.
124125
# This variable is a cache entry initialized (to FALSE) by the project() command.
125126
# Users may enable the option in their local build tree to get more verbose
126127
# output from Makefile builds and show each command line as it is launched.
127-
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
128+
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL ON)
128129
# Default value for POSITION_INDEPENDENT_CODE of targets.
129130
# This variable is used to initialize the POSITION_INDEPENDENT_CODE property
130131
# on all the targets. See that target property for additional information.
131132
# If set, it’s value is also used by the try_compile() command.
132-
set(CMAKE_POSITION_INDEPENDENT_CODE CACHE BOOL "ON")
133+
set(CMAKE_POSITION_INDEPENDENT_CODE CACHE BOOL ON)
133134
message("CMAKE_VERBOSE_DEBUG ON")
134135
endif ()
135136

examples/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ function(define_example_app name)
2626
${PROJECT_MACRO_PREFIX}_ENABLE_ASSERTIONS=${_${PROJECT_MACRO_NAME}_enable_assertions}
2727
${PROJECT_MACRO_PREFIX}_ENABLE_PRECONDITION_CHECKS=${_${PROJECT_MACRO_NAME}_enable_precondition_checks}
2828
${PROJECT_MACRO_PREFIX}_ENABLE_THREAD_POOL_READY_SIGNAL=${_${PROJECT_MACRO_NAME}_enable_thread_pool_ready_signal}
29-
${PROJECT_MACRO_PREFIX}_ENABLE_VERBOSE_LOG=0 # ${_${PROJECT_MACRO_NAME}_enable_verbose_log}
30-
${PROJECT_MACRO_PREFIX}_TEST_THREAD_POOL_DBGOUT=0 # ${_${PROJECT_MACRO_NAME}_enable_thread_pool_dbgout}
31-
# ${PROJECT_MACRO_PREFIX}_UNIT_TEST=${_${PROJECT_MACRO_NAME}_unit_test}
29+
${PROJECT_MACRO_PREFIX}_ENABLE_VERBOSE_LOG=0
30+
${PROJECT_MACRO_PREFIX}_TEST_THREAD_POOL_DBGOUT=0
3231
${PROJECT_MACRO_PREFIX}_UNIT_TEST=0
3332
UNIT_TESTING=0
3433
)
@@ -56,7 +55,7 @@ function(define_example_app name)
5655
)
5756
else ()
5857
target_compile_options(${PROJECT_NAME}-${name} PRIVATE
59-
-pedantic -Wall -Wextra -Wshadow -Werror -pthread -Wno-macro-redefined
58+
-pedantic -Wall -Wextra -Wshadow -Werror -pthread # -Wno-macro-redefined
6059
#-D${PROJECT_MACRO_PREFIX}_UNIT_TEST=1
6160
)
6261
if (DEBUG)

0 commit comments

Comments
 (0)