Skip to content

Commit 3db04ea

Browse files
committed
Fix compilation for windows (no pthread)
1 parent f92c734 commit 3db04ea

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

CMakeLists.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,20 @@ set(ASL2_SOURCES ${ASL2_SOURCES} ${ASL2_HEADERS})
372372

373373
# Create ASL 1
374374
createSingleASL(asl ${ASL_SOURCE_DIR} ASL_SOURCES)
375+
375376
# Create ASL 2
376-
createSingleASL(asl2 ${ASL2_SOURCE_DIR} ASL2_SOURCES)
377+
set(ADDITIONALDEFS "")
378+
if(WIN32)
379+
set(ADDITIONALDEFS NO_MBLK_LOCK NO_PTHREADS)
380+
endif()
381+
createSingleASL(asl2 ${ASL2_SOURCE_DIR} ASL2_SOURCES
382+
DEFINITIONS ${ADDITIONALDEFS})
377383

378384
if(BUILD_LICCHECK_PRINT)
379385
createSingleASL(asl-lc ${ASL_SOURCE_DIR} ASL_SOURCES
380386
DEFINITIONS LICCHECKVERSION=${LICCHECKVERSION})
381387
createSingleASL(asl2-lc ${ASL2_SOURCE_DIR} ASL2_SOURCES
382-
DEFINITIONS LICCHECKVERSION=${LICCHECKVERSION})
388+
DEFINITIONS LICCHECKVERSION=${LICCHECKVERSION} ${ADDITIONALDEFS})
383389
endif()
384390

385391
# Create libs with support for multiple threads
@@ -414,22 +420,24 @@ if(MSVC AND BUILD_DYNRT_LIBS)
414420
# createSingleASL adds the appropriate public flags if the library name
415421
# matches "dynrt"
416422
createSingleASL(asl-dynrt ${ASL_SOURCE_DIR} ASL_SOURCES)
417-
createSingleASL(asl2-dynrt ${ASL2_SOURCE_DIR} ASL2_SOURCES)
423+
createSingleASL(asl2-dynrt ${ASL2_SOURCE_DIR} ASL2_SOURCES
424+
DEFINITIONS ${ADDITIONALDEFS})
418425
if(BUILD_LICCHECK_PRINT)
419426
createSingleASL(asl-dynrt-lc ${ASL_SOURCE_DIR} ASL_SOURCES
420427
DEFINITIONS LICCHECKVERSION=${LICCHECKVERSION})
421428
createSingleASL(asl2-dynrt-lc ${ASL2_SOURCE_DIR} ASL2_SOURCES
422-
DEFINITIONS LICCHECKVERSION=${LICCHECKVERSION})
429+
DEFINITIONS LICCHECKVERSION=${LICCHECKVERSION} ${ADDITIONALDEFS})
423430
endif()
424431
endif()
425432
if(BUILD_MCMODELLARGE)
426-
createSingleASL(asl2-large ${ASL2_SOURCE_DIR} ASL2_SOURCES)
433+
createSingleASL(asl2-large ${ASL2_SOURCE_DIR} ASL2_SOURCES
434+
DEFINITIONS ${ADDITIONALDEFS})
427435
if(${ARCH} EQUAL 64)
428436
target_compile_options(asl2-large PUBLIC "-mcmodel=large")
429437
endif()
430438
if(BUILD_LICCHECK_PRINT)
431439
createSingleASL(asl2-large-lc ${ASL2_SOURCE_DIR} ASL2_SOURCES
432-
DEFINITIONS LICCHECKVERSION=${LICCHECKVERSION})
440+
DEFINITIONS LICCHECKVERSION=${LICCHECKVERSION} ${ADDITIONALDEFS})
433441
if(${ARCH} EQUAL 64)
434442
target_compile_options(asl2-large-lc PUBLIC "-mcmodel=large")
435443
endif()

0 commit comments

Comments
 (0)