Skip to content

Commit c9f2ff0

Browse files
committed
review feedback
use option() rather than set()
1 parent fd6ae19 commit c9f2ff0

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ set($ENV{HTM_CPP} ${REPOSITORY_DIR})
3030
option(FORCE_CPP11 "Force compiler to use C++11 standard." OFF)
3131
option(FORCE_BOOST "Force compiler to install and use Boost." OFF)
3232
set(BINDING_BUILD "none" CACHE STRING "Specify the Binding to build 'Python2','Python3' or 'none', default 'none'." )
33-
set(NTA_LIBC_MUSL OFF CACHE BOOL "Are we using MUSL stdlibc++, or GLIBC?")
33+
option(NTA_LIBC_MUSL "Are we using MUSL stdlibc++? otherwise GLIBC" OFF)
3434

3535
# Note: by setting the CXX environment variable, a non-default c++ compiler can be specified.
3636

CommonCompilerConfig.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ else()
228228
-DHAVE_CONFIG_H
229229
-DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
230230
-DBOOST_NO_WREGEX
231-
-DNTA_LIBC_MUSL=${NTA_LIBC_MUSL}
232231
)
233232

234233
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")

src/CMakeLists.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ add_library(${src_lib_static} STATIC $<TARGET_OBJECTS:${src_objlib}>)
251251
if(MSVC)
252252
set_property(TARGET ${src_lib_static} PROPERTY LINK_LIBRARIES ${INTERNAL_LINKER_FLAGS})
253253
elseif(${NTA_LIBC_MUSL})
254-
message("Doing static build with MUSL libc")
254+
message("Doing static build with MUSL libc ${COMMON_COMPILER_DEFINITIONS}")
255255
target_link_libraries(${src_lib_static} -static)
256256
endif()
257257
#
@@ -335,11 +335,7 @@ target_link_libraries(${src_executable_hotgym}
335335
# link with ${src_lib_shared} rather than ${core_library}
336336

337337
target_compile_options( ${src_executable_hotgym} PUBLIC ${INTERNAL_CXX_FLAGS})
338-
if(${NTA_LIBC_MUSL})
339-
target_compile_definitions(${src_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS} -DNTA_LIBC_MUSL=${NTA_LIBC_MUSL})
340-
else()
341-
target_compile_definitions(${src_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
342-
endif()
338+
target_compile_definitions(${src_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
343339
target_include_directories(${src_executable_hotgym} PRIVATE
344340
${CORE_LIB_INCLUDES}
345341
${EXTERNAL_INCLUDES}
@@ -363,11 +359,7 @@ else()
363359
${COMMON_OS_LIBS}
364360
)
365361
target_compile_options( ${src_dyn_executable_hotgym} PUBLIC ${INTERNAL_CXX_FLAGS})
366-
if(${NTA_LIBC_MUSL})
367-
target_compile_definitions(${src_dyn_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS} -DNTA_LIBC_MUSL=${NTA_LIBC_MUSL})
368-
else()
369-
target_compile_definitions(${src_dyn_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
370-
endif()
362+
target_compile_definitions(${src_dyn_executable_hotgym} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
371363
target_include_directories(${src_dyn_executable_hotgym} PRIVATE
372364
${CORE_LIB_INCLUDES}
373365
${EXTERNAL_INCLUDES}

src/test/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,7 @@ target_include_directories(${unit_tests_executable} PRIVATE
150150
${gtest_INCLUDE_DIRS}
151151
${CORE_LIB_INCLUDES}
152152
${EXTERNAL_INCLUDES})
153-
if(${NTA_LIBC_MUSL})
154-
target_compile_definitions(${unit_tests_executable} PRIVATE ${COMMON_COMPILER_DEFINITIONS} -DNTA_LIBC_MUSL=${NTA_LIBC_MUSL})
155-
else()
156-
target_compile_definitions(${unit_tests_executable} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
157-
endif()
153+
target_compile_definitions(${unit_tests_executable} PRIVATE ${COMMON_COMPILER_DEFINITIONS})
158154
target_compile_options(${unit_tests_executable} PUBLIC ${INTERNAL_CXX_FLAGS})
159155
add_dependencies(${unit_tests_executable} ${core_library})
160156
#add_dependencies(${unit_tests_executable} ${src_lib_shared})

0 commit comments

Comments
 (0)